[STATEMENT]
lemma ccw'_sortedP_polychain_of3:
  assumes "ccw'.sortedP 0 (u#v#w#xs)"
  shows "ccw'.sortedP x0 (map snd (polychain_of x0 (u#v#w#xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ccw'.sortedP 0 (u # v # w # xs)

goal (1 subgoal):
 1. ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs)))
[PROOF STEP]
proof (induct xs arbitrary: x0 u v w)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x0 u v w. ccw'.sortedP 0 [u, v, w] \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 [u, v, w]))
 2. \<And>a xs x0 u v w. \<lbrakk>\<And>x0 u v w. ccw'.sortedP 0 (u # v # w # xs) \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs))); ccw'.sortedP 0 (u # v # w # a # xs)\<rbrakk> \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # a # xs)))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
ccw'.sortedP 0 [u, v, w]

goal (2 subgoals):
 1. \<And>x0 u v w. ccw'.sortedP 0 [u, v, w] \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 [u, v, w]))
 2. \<And>a xs x0 u v w. \<lbrakk>\<And>x0 u v w. ccw'.sortedP 0 (u # v # w # xs) \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs))); ccw'.sortedP 0 (u # v # w # a # xs)\<rbrakk> \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # a # xs)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ccw'.sortedP 0 [u, v, w]
[PROOF STEP]
have *: "ccw' 0 u v" "ccw' 0 v w" "ccw' 0 u w"
[PROOF STATE]
proof (prove)
using this:
ccw'.sortedP 0 [u, v, w]

goal (1 subgoal):
 1. ccw' 0 u v &&& ccw' 0 v w &&& ccw' 0 u w
[PROOF STEP]
by (auto intro!: linorder_list0.sortedP.Nil linorder_list0.sortedP.Cons
      elim!: linorder_list0.sortedP_Cons simp: ac_simps)
[PROOF STATE]
proof (state)
this:
ccw' 0 u v
ccw' 0 v w
ccw' 0 u w

goal (2 subgoals):
 1. \<And>x0 u v w. ccw'.sortedP 0 [u, v, w] \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 [u, v, w]))
 2. \<And>a xs x0 u v w. \<lbrakk>\<And>x0 u v w. ccw'.sortedP 0 (u # v # w # xs) \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs))); ccw'.sortedP 0 (u # v # w # a # xs)\<rbrakk> \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # a # xs)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ccw' 0 u v
ccw' 0 v w
ccw' 0 u w

goal (2 subgoals):
 1. \<And>x0 u v w. ccw'.sortedP 0 [u, v, w] \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 [u, v, w]))
 2. \<And>a xs x0 u v w. \<lbrakk>\<And>x0 u v w. ccw'.sortedP 0 (u # v # w # xs) \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs))); ccw'.sortedP 0 (u # v # w # a # xs)\<rbrakk> \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # a # xs)))
[PROOF STEP]
have "ccw' 0 (u + v) (u + (v + w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw' 0 (u + v) (u + (v + w))
[PROOF STEP]
by (metis add.assoc ccw'.add1 ccw'.add3_self *(2-))
[PROOF STATE]
proof (state)
this:
ccw' 0 (u + v) (u + (v + w))

goal (2 subgoals):
 1. \<And>x0 u v w. ccw'.sortedP 0 [u, v, w] \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 [u, v, w]))
 2. \<And>a xs x0 u v w. \<lbrakk>\<And>x0 u v w. ccw'.sortedP 0 (u # v # w # xs) \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs))); ccw'.sortedP 0 (u # v # w # a # xs)\<rbrakk> \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # a # xs)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ccw' 0 u v
ccw' 0 v w
ccw' 0 u w
ccw' 0 (u + v) (u + (v + w))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ccw' 0 u v
ccw' 0 v w
ccw' 0 u w
ccw' 0 (u + v) (u + (v + w))

goal (1 subgoal):
 1. ccw'.sortedP x0 (map snd (polychain_of x0 [u, v, w]))
[PROOF STEP]
by (auto intro!: linorder_list0.sortedP.Nil linorder_list0.sortedP.Cons
      elim!: linorder_list0.sortedP_Cons simp: ac_simps ccw'.translate_origin ccw'.add3)
[PROOF STATE]
proof (state)
this:
ccw'.sortedP x0 (map snd (polychain_of x0 [u, v, w]))

goal (1 subgoal):
 1. \<And>a xs x0 u v w. \<lbrakk>\<And>x0 u v w. ccw'.sortedP 0 (u # v # w # xs) \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs))); ccw'.sortedP 0 (u # v # w # a # xs)\<rbrakk> \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # a # xs)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs x0 u v w. \<lbrakk>\<And>x0 u v w. ccw'.sortedP 0 (u # v # w # xs) \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs))); ccw'.sortedP 0 (u # v # w # a # xs)\<rbrakk> \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # a # xs)))
[PROOF STEP]
case (Cons y ys)
[PROOF STATE]
proof (state)
this:
ccw'.sortedP 0 (?u # ?v # ?w # ys) \<Longrightarrow> ccw'.sortedP ?x0.0 (map snd (polychain_of ?x0.0 (?u # ?v # ?w # ys)))
ccw'.sortedP 0 (u # v # w # y # ys)

goal (1 subgoal):
 1. \<And>a xs x0 u v w. \<lbrakk>\<And>x0 u v w. ccw'.sortedP 0 (u # v # w # xs) \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs))); ccw'.sortedP 0 (u # v # w # a # xs)\<rbrakk> \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # a # xs)))
[PROOF STEP]
have s1: "linorder_list0.sortedP (ccw' 0)  ((u + v)#w#y#ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw'.sortedP 0 ((u + v) # w # y # ys)
[PROOF STEP]
using Cons.prems
[PROOF STATE]
proof (prove)
using this:
ccw'.sortedP 0 (u # v # w # y # ys)

goal (1 subgoal):
 1. ccw'.sortedP 0 ((u + v) # w # y # ys)
[PROOF STEP]
by (auto intro!: linorder_list0.sortedP.Nil linorder_list0.sortedP.Cons
      elim!: linorder_list0.sortedP_Cons simp: ccw'.add1)
[PROOF STATE]
proof (state)
this:
ccw'.sortedP 0 ((u + v) # w # y # ys)

goal (1 subgoal):
 1. \<And>a xs x0 u v w. \<lbrakk>\<And>x0 u v w. ccw'.sortedP 0 (u # v # w # xs) \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs))); ccw'.sortedP 0 (u # v # w # a # xs)\<rbrakk> \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # a # xs)))
[PROOF STEP]
have s2: "linorder_list0.sortedP (ccw' 0)  (u#(v + w)#y#ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw'.sortedP 0 (u # (v + w) # y # ys)
[PROOF STEP]
using Cons.prems
[PROOF STATE]
proof (prove)
using this:
ccw'.sortedP 0 (u # v # w # y # ys)

goal (1 subgoal):
 1. ccw'.sortedP 0 (u # (v + w) # y # ys)
[PROOF STEP]
by (auto intro!: linorder_list0.sortedP.Nil linorder_list0.sortedP.Cons
      elim!: linorder_list0.sortedP_Cons simp: ccw'.add3 ccw'.add1)
[PROOF STATE]
proof (state)
this:
ccw'.sortedP 0 (u # (v + w) # y # ys)

goal (1 subgoal):
 1. \<And>a xs x0 u v w. \<lbrakk>\<And>x0 u v w. ccw'.sortedP 0 (u # v # w # xs) \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs))); ccw'.sortedP 0 (u # v # w # a # xs)\<rbrakk> \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # a # xs)))
[PROOF STEP]
have s3: "linorder_list0.sortedP (ccw' 0)  (u#v#(w + y)#ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw'.sortedP 0 (u # v # (w + y) # ys)
[PROOF STEP]
using Cons.prems
[PROOF STATE]
proof (prove)
using this:
ccw'.sortedP 0 (u # v # w # y # ys)

goal (1 subgoal):
 1. ccw'.sortedP 0 (u # v # (w + y) # ys)
[PROOF STEP]
by (auto intro!: linorder_list0.sortedP.Nil linorder_list0.sortedP.Cons
      elim!: linorder_list0.sortedP_Cons simp: ccw'.add3 ccw'.add1)
[PROOF STATE]
proof (state)
this:
ccw'.sortedP 0 (u # v # (w + y) # ys)

goal (1 subgoal):
 1. \<And>a xs x0 u v w. \<lbrakk>\<And>x0 u v w. ccw'.sortedP 0 (u # v # w # xs) \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # xs))); ccw'.sortedP 0 (u # v # w # a # xs)\<rbrakk> \<Longrightarrow> ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # a # xs)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # y # ys)))
[PROOF STEP]
using Cons.hyps[OF s1, of x0] Cons.hyps[OF s2, of x0] Cons.hyps[OF s3, of x0] Cons.prems
[PROOF STATE]
proof (prove)
using this:
ccw'.sortedP x0 (map snd (polychain_of x0 ((u + v) # w # y # ys)))
ccw'.sortedP x0 (map snd (polychain_of x0 (u # (v + w) # y # ys)))
ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # (w + y) # ys)))
ccw'.sortedP 0 (u # v # w # y # ys)

goal (1 subgoal):
 1. ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # y # ys)))
[PROOF STEP]
by (auto intro!: linorder_list0.sortedP.Nil linorder_list0.sortedP.Cons
      elim!: linorder_list0.sortedP_Cons simp: ac_simps)
[PROOF STATE]
proof (state)
this:
ccw'.sortedP x0 (map snd (polychain_of x0 (u # v # w # y # ys)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vint_minus_eq_plus_uminus:
  assumes "x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
  shows "x -\<^sub>\<int> y = x +\<^sub>\<int> (-\<^sub>\<int> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x -\<^sub>\<int> y = x +\<^sub>\<int> -\<^sub>\<int> y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x -\<^sub>\<int> y = x +\<^sub>\<int> -\<^sub>\<int> y
[PROOF STEP]
have "x' - y' = x' + (-y')" for x' y' :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' - y' = x' + - y'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x' - ?y' = ?x' + - ?y'

goal (1 subgoal):
 1. x -\<^sub>\<int> y = x +\<^sub>\<int> -\<^sub>\<int> y
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x -\<^sub>\<int> y = x +\<^sub>\<int> -\<^sub>\<int> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x -\<^sub>\<int> y = x +\<^sub>\<int> -\<^sub>\<int> y

goal (1 subgoal):
 1. x -\<^sub>\<int> y = x +\<^sub>\<int> -\<^sub>\<int> y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x -\<^sub>\<int> y = x +\<^sub>\<int> -\<^sub>\<int> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma clean_slots_map_add_comm:
  "cmps_a \<inter> cmps_b = {}
  \<Longrightarrow> clean_slots slots_a cmps_a ++ clean_slots slots_b cmps_b =
      clean_slots slots_b cmps_b ++ clean_slots slots_a cmps_a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmps_a \<inter> cmps_b = {} \<Longrightarrow> clean_slots slots_a cmps_a ++ clean_slots slots_b cmps_b = clean_slots slots_b cmps_b ++ clean_slots slots_a cmps_a
[PROOF STEP]
apply (clarsimp simp: clean_slots_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmps_a \<inter> cmps_b = {} \<Longrightarrow> slots_a |` the_set cmps_a ++ slots_b |` the_set cmps_b = slots_b |` the_set cmps_b ++ slots_a |` the_set cmps_a
[PROOF STEP]
apply (drule the_set_inter_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the_set cmps_a \<inter> the_set cmps_b = {} \<Longrightarrow> slots_a |` the_set cmps_a ++ slots_b |` the_set cmps_b = slots_b |` the_set cmps_b ++ slots_a |` the_set cmps_a
[PROOF STEP]
apply (erule map_add_restrict_comm)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma transfer_enn2ereal_continuous_on [transfer_rule]:
  "rel_fun (=) (rel_fun (rel_fun (=) pcr_ennreal) (=)) continuous_on continuous_on"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_fun (=) (rel_fun (rel_fun (=) pcr_ennreal) (=)) continuous_on continuous_on
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_fun (=) (rel_fun (rel_fun (=) pcr_ennreal) (=)) continuous_on continuous_on
[PROOF STEP]
have "continuous_on A f" if "continuous_on A (\<lambda>x. enn2ereal (f x))" for A and f :: "'a \<Rightarrow> ennreal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A f
[PROOF STEP]
using continuous_on_compose2[OF continuous_on_e2ennreal[of "{0..}"] that]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. enn2ereal (f x)) ` A \<subseteq> {0..} \<Longrightarrow> continuous_on A (\<lambda>x. e2ennreal (enn2ereal (f x)))

goal (1 subgoal):
 1. continuous_on A f
[PROOF STEP]
by (auto simp: ennreal.enn2ereal_inverse subset_eq e2ennreal_def max_absorb2)
[PROOF STATE]
proof (state)
this:
continuous_on ?A (\<lambda>x. enn2ereal (?f x)) \<Longrightarrow> continuous_on ?A ?f

goal (1 subgoal):
 1. rel_fun (=) (rel_fun (rel_fun (=) pcr_ennreal) (=)) continuous_on continuous_on
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on ?A (\<lambda>x. enn2ereal (?f x)) \<Longrightarrow> continuous_on ?A ?f

goal (1 subgoal):
 1. rel_fun (=) (rel_fun (rel_fun (=) pcr_ennreal) (=)) continuous_on continuous_on
[PROOF STEP]
have "continuous_on A (\<lambda>x. enn2ereal (f x))" if "continuous_on A f" for A and f :: "'a \<Rightarrow> ennreal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A (\<lambda>x. enn2ereal (f x))
[PROOF STEP]
using continuous_on_compose2[OF continuous_on_enn2ereal that]
[PROOF STATE]
proof (prove)
using this:
f ` A \<subseteq> UNIV \<Longrightarrow> continuous_on A (\<lambda>x. enn2ereal (f x))

goal (1 subgoal):
 1. continuous_on A (\<lambda>x. enn2ereal (f x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on ?A ?f \<Longrightarrow> continuous_on ?A (\<lambda>x. enn2ereal (?f x))

goal (1 subgoal):
 1. rel_fun (=) (rel_fun (rel_fun (=) pcr_ennreal) (=)) continuous_on continuous_on
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous_on ?A (\<lambda>x. enn2ereal (?f x)) \<Longrightarrow> continuous_on ?A ?f
continuous_on ?A ?f \<Longrightarrow> continuous_on ?A (\<lambda>x. enn2ereal (?f x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on ?A (\<lambda>x. enn2ereal (?f x)) \<Longrightarrow> continuous_on ?A ?f
continuous_on ?A ?f \<Longrightarrow> continuous_on ?A (\<lambda>x. enn2ereal (?f x))

goal (1 subgoal):
 1. rel_fun (=) (rel_fun (rel_fun (=) pcr_ennreal) (=)) continuous_on continuous_on
[PROOF STEP]
by (auto simp add: rel_fun_def ennreal.pcr_cr_eq cr_ennreal_def)
[PROOF STATE]
proof (state)
this:
rel_fun (=) (rel_fun (rel_fun (=) pcr_ennreal) (=)) continuous_on continuous_on

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem lrange_set:
  assumes "sorted_less (leaves t)"
    and "aligned l t u"
  shows "lrange t x = lrange_filter x (leaves t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lrange t x = lrange_filter x (leaves t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sorted_less (leaves t)
aligned l t u

goal (1 subgoal):
 1. lrange t x = lrange_filter x (leaves t)
[PROOF STEP]
proof(induction t x arbitrary: l u rule: lrange.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ks x l u. \<lbrakk>sorted_less (leaves (Leaf ks)); aligned l (Leaf ks) u\<rbrakk> \<Longrightarrow> lrange (Leaf ks) x = lrange_filter x (leaves (Leaf ks))
 2. \<And>ts t x l u. \<lbrakk>\<And>xa y l u. \<lbrakk>(xa, y) = split ts x; y = []; sorted_less (leaves t); aligned l t u\<rbrakk> \<Longrightarrow> lrange t x = lrange_filter x (leaves t); \<And>xa y x21 x22 xaa ya l u. \<lbrakk>(xa, y) = split ts x; y = x21 # x22; (xaa, ya) = x21; sorted_less (leaves xaa); aligned l xaa u\<rbrakk> \<Longrightarrow> lrange xaa x = lrange_filter x (leaves xaa); sorted_less (leaves (Node ts t)); aligned l (Node ts t) u\<rbrakk> \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
case (1 ks x)
[PROOF STATE]
proof (state)
this:
sorted_less (leaves (Leaf ks))
aligned l (Leaf ks) u

goal (2 subgoals):
 1. \<And>ks x l u. \<lbrakk>sorted_less (leaves (Leaf ks)); aligned l (Leaf ks) u\<rbrakk> \<Longrightarrow> lrange (Leaf ks) x = lrange_filter x (leaves (Leaf ks))
 2. \<And>ts t x l u. \<lbrakk>\<And>xa y l u. \<lbrakk>(xa, y) = split ts x; y = []; sorted_less (leaves t); aligned l t u\<rbrakk> \<Longrightarrow> lrange t x = lrange_filter x (leaves t); \<And>xa y x21 x22 xaa ya l u. \<lbrakk>(xa, y) = split ts x; y = x21 # x22; (xaa, ya) = x21; sorted_less (leaves xaa); aligned l xaa u\<rbrakk> \<Longrightarrow> lrange xaa x = lrange_filter x (leaves xaa); sorted_less (leaves (Node ts t)); aligned l (Node ts t) u\<rbrakk> \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sorted_less (leaves (Leaf ks))
aligned l (Leaf ks) u
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sorted_less (leaves (Leaf ks))
aligned l (Leaf ks) u

goal (1 subgoal):
 1. lrange (Leaf ks) x = lrange_filter x (leaves (Leaf ks))
[PROOF STEP]
using lrange_list_req
[PROOF STATE]
proof (prove)
using this:
sorted_less (leaves (Leaf ks))
aligned l (Leaf ks) u
sorted_less ?ks \<Longrightarrow> lrange_list ?l ?ks = lrange_filter ?l ?ks

goal (1 subgoal):
 1. lrange (Leaf ks) x = lrange_filter x (leaves (Leaf ks))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lrange (Leaf ks) x = lrange_filter x (leaves (Leaf ks))

goal (1 subgoal):
 1. \<And>ts t x l u. \<lbrakk>\<And>xa y l u. \<lbrakk>(xa, y) = split ts x; y = []; sorted_less (leaves t); aligned l t u\<rbrakk> \<Longrightarrow> lrange t x = lrange_filter x (leaves t); \<And>xa y x21 x22 xaa ya l u. \<lbrakk>(xa, y) = split ts x; y = x21 # x22; (xaa, ya) = x21; sorted_less (leaves xaa); aligned l xaa u\<rbrakk> \<Longrightarrow> lrange xaa x = lrange_filter x (leaves xaa); sorted_less (leaves (Node ts t)); aligned l (Node ts t) u\<rbrakk> \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ts t x l u. \<lbrakk>\<And>xa y l u. \<lbrakk>(xa, y) = split ts x; y = []; sorted_less (leaves t); aligned l t u\<rbrakk> \<Longrightarrow> lrange t x = lrange_filter x (leaves t); \<And>xa y x21 x22 xaa ya l u. \<lbrakk>(xa, y) = split ts x; y = x21 # x22; (xaa, ya) = x21; sorted_less (leaves xaa); aligned l xaa u\<rbrakk> \<Longrightarrow> lrange xaa x = lrange_filter x (leaves xaa); sorted_less (leaves (Node ts t)); aligned l (Node ts t) u\<rbrakk> \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
case (2 ts t x)
[PROOF STATE]
proof (state)
this:
\<lbrakk>(?xa, ?y) = split ts x; ?y = []; sorted_less (leaves t); aligned ?l t ?u\<rbrakk> \<Longrightarrow> lrange t x = lrange_filter x (leaves t)
\<lbrakk>(?xa, ?y) = split ts x; ?y = ?x21.0 # ?x22.0; (?xaa, ?ya) = ?x21.0; sorted_less (leaves ?xaa); aligned ?l ?xaa ?u\<rbrakk> \<Longrightarrow> lrange ?xaa x = lrange_filter x (leaves ?xaa)
sorted_less (leaves (Node ts t))
aligned l (Node ts t) u

goal (1 subgoal):
 1. \<And>ts t x l u. \<lbrakk>\<And>xa y l u. \<lbrakk>(xa, y) = split ts x; y = []; sorted_less (leaves t); aligned l t u\<rbrakk> \<Longrightarrow> lrange t x = lrange_filter x (leaves t); \<And>xa y x21 x22 xaa ya l u. \<lbrakk>(xa, y) = split ts x; y = x21 # x22; (xaa, ya) = x21; sorted_less (leaves xaa); aligned l xaa u\<rbrakk> \<Longrightarrow> lrange xaa x = lrange_filter x (leaves xaa); sorted_less (leaves (Node ts t)); aligned l (Node ts t) u\<rbrakk> \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>(?xa, ?y) = split ts x; ?y = []; sorted_less (leaves t); aligned ?l t ?u\<rbrakk> \<Longrightarrow> lrange t x = lrange_filter x (leaves t)
\<lbrakk>(?xa, ?y) = split ts x; ?y = ?x21.0 # ?x22.0; (?xaa, ?ya) = ?x21.0; sorted_less (leaves ?xaa); aligned ?l ?xaa ?u\<rbrakk> \<Longrightarrow> lrange ?xaa x = lrange_filter x (leaves ?xaa)
sorted_less (leaves (Node ts t))
aligned l (Node ts t) u
[PROOF STEP]
obtain ls rs where list_split: "split ts x = (ls, rs)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?xa, ?y) = split ts x; ?y = []; sorted_less (leaves t); aligned ?l t ?u\<rbrakk> \<Longrightarrow> lrange t x = lrange_filter x (leaves t)
\<lbrakk>(?xa, ?y) = split ts x; ?y = ?x21.0 # ?x22.0; (?xaa, ?ya) = ?x21.0; sorted_less (leaves ?xaa); aligned ?l ?xaa ?u\<rbrakk> \<Longrightarrow> lrange ?xaa x = lrange_filter x (leaves ?xaa)
sorted_less (leaves (Node ts t))
aligned l (Node ts t) u

goal (1 subgoal):
 1. (\<And>ls rs. split ts x = (ls, rs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson surj_pair)
[PROOF STATE]
proof (state)
this:
split ts x = (ls, rs)

goal (1 subgoal):
 1. \<And>ts t x l u. \<lbrakk>\<And>xa y l u. \<lbrakk>(xa, y) = split ts x; y = []; sorted_less (leaves t); aligned l t u\<rbrakk> \<Longrightarrow> lrange t x = lrange_filter x (leaves t); \<And>xa y x21 x22 xaa ya l u. \<lbrakk>(xa, y) = split ts x; y = x21 # x22; (xaa, ya) = x21; sorted_less (leaves xaa); aligned l xaa u\<rbrakk> \<Longrightarrow> lrange xaa x = lrange_filter x (leaves xaa); sorted_less (leaves (Node ts t)); aligned l (Node ts t) u\<rbrakk> \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
split ts x = (ls, rs)
[PROOF STEP]
have list_conc: "ts = ls @ rs"
[PROOF STATE]
proof (prove)
using this:
split ts x = (ls, rs)

goal (1 subgoal):
 1. ts = ls @ rs
[PROOF STEP]
using split_conc
[PROOF STATE]
proof (prove)
using this:
split ts x = (ls, rs)
split ?xs ?p = (?ls, ?rs) \<Longrightarrow> ?xs = ?ls @ ?rs

goal (1 subgoal):
 1. ts = ls @ rs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ts = ls @ rs

goal (1 subgoal):
 1. \<And>ts t x l u. \<lbrakk>\<And>xa y l u. \<lbrakk>(xa, y) = split ts x; y = []; sorted_less (leaves t); aligned l t u\<rbrakk> \<Longrightarrow> lrange t x = lrange_filter x (leaves t); \<And>xa y x21 x22 xaa ya l u. \<lbrakk>(xa, y) = split ts x; y = x21 # x22; (xaa, ya) = x21; sorted_less (leaves xaa); aligned l xaa u\<rbrakk> \<Longrightarrow> lrange xaa x = lrange_filter x (leaves xaa); sorted_less (leaves (Node ts t)); aligned l (Node ts t) u\<rbrakk> \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
proof (cases rs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rs = [] \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
 2. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
rs = []

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
 2. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rs = []
[PROOF STEP]
have "lrange (Node ts t) x = lrange t x"
[PROOF STATE]
proof (prove)
using this:
rs = []

goal (1 subgoal):
 1. lrange (Node ts t) x = lrange t x
[PROOF STEP]
by (simp add: list_split)
[PROOF STATE]
proof (state)
this:
lrange (Node ts t) x = lrange t x

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
 2. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lrange (Node ts t) x = lrange t x

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
 2. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
have "\<dots> = lrange_filter x (leaves t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lrange t x = lrange_filter x (leaves t)
[PROOF STEP]
by (metis "2.IH"(1) "2.prems"(1) "2.prems"(2) align_last' list_split local.Nil sorted_leaves_induct_last)
[PROOF STATE]
proof (state)
this:
lrange t x = lrange_filter x (leaves t)

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
 2. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lrange t x = lrange_filter x (leaves t)

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
 2. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
have "\<dots> = lrange_filter x (leaves (Node ts t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lrange_filter x (leaves t) = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
by (metis "2.prems"(1) "2.prems"(2) aligned_imp_Laligned leaves.simps(2) list_conc list_split local.Nil lrange_sorted_split same_append_eq self_append_conv split_tree.leaves_split split_tree_axioms)
[PROOF STATE]
proof (state)
this:
lrange_filter x (leaves t) = lrange_filter x (leaves (Node ts t))

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
 2. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))

goal (1 subgoal):
 1. lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
case (Cons a list)
[PROOF STATE]
proof (state)
this:
rs = a # list

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rs = a # list
[PROOF STEP]
obtain sub sep where a_split: "a = (sub,sep)"
[PROOF STATE]
proof (prove)
using this:
rs = a # list

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

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = (sub, sep)
[PROOF STEP]
have "lrange (Node ts t) x = lrange sub x @ leaves_list list @ leaves t"
[PROOF STATE]
proof (prove)
using this:
a = (sub, sep)

goal (1 subgoal):
 1. lrange (Node ts t) x = lrange sub x @ leaves_list list @ leaves t
[PROOF STEP]
using list_split Cons a_split
[PROOF STATE]
proof (prove)
using this:
a = (sub, sep)
split ts x = (ls, rs)
rs = a # list
a = (sub, sep)

goal (1 subgoal):
 1. lrange (Node ts t) x = lrange sub x @ leaves_list list @ leaves t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lrange (Node ts t) x = lrange sub x @ leaves_list list @ leaves t

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lrange (Node ts t) x = lrange sub x @ leaves_list list @ leaves t

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
have "\<dots> = lrange_filter x (leaves sub) @ leaves_list list @ leaves t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lrange sub x @ leaves_list list @ leaves t = lrange_filter x (leaves sub) @ leaves_list list @ leaves t
[PROOF STEP]
using "2.IH"(2)[of ls rs "(sub,sep)" list sub sep]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(ls, rs) = split ts x; rs = (sub, sep) # list; (sub, sep) = (sub, sep); sorted_less (leaves sub); aligned ?l sub ?u\<rbrakk> \<Longrightarrow> lrange sub x = lrange_filter x (leaves sub)

goal (1 subgoal):
 1. lrange sub x @ leaves_list list @ leaves t = lrange_filter x (leaves sub) @ leaves_list list @ leaves t
[PROOF STEP]
using "2.prems" a_split list_conc list_split local.Cons sorted_leaves_induct_subtree
              align_sub
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(ls, rs) = split ts x; rs = (sub, sep) # list; (sub, sep) = (sub, sep); sorted_less (leaves sub); aligned ?l sub ?u\<rbrakk> \<Longrightarrow> lrange sub x = lrange_filter x (leaves sub)
sorted_less (leaves (Node ts t))
aligned l (Node ts t) u
a = (sub, sep)
ts = ls @ rs
split ts x = (ls, rs)
rs = a # list
sorted_less (leaves (Node (?ls @ (?sub, ?sep) # ?rs) ?t)) \<Longrightarrow> sorted_less (leaves ?sub)
\<lbrakk>aligned ?l (Node ?ts ?t) ?u; (?sub, ?sep) \<in> set ?ts\<rbrakk> \<Longrightarrow> \<exists>l'\<in>set (separators ?ts) \<union> {?l}. aligned l' ?sub ?sep

goal (1 subgoal):
 1. lrange sub x @ leaves_list list @ leaves t = lrange_filter x (leaves sub) @ leaves_list list @ leaves t
[PROOF STEP]
by (metis in_set_conv_decomp)
[PROOF STATE]
proof (state)
this:
lrange sub x @ leaves_list list @ leaves t = lrange_filter x (leaves sub) @ leaves_list list @ leaves t

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lrange sub x @ leaves_list list @ leaves t = lrange_filter x (leaves sub) @ leaves_list list @ leaves t

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
have "\<dots> = lrange_filter x (leaves (Node ts t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lrange_filter x (leaves sub) @ leaves_list list @ leaves t = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
by (metis "2.prems"(1) "2.prems"(2) a_split aligned_imp_Laligned list_split local.Cons lrange_sorted_split lrange_sorted_split_right)
[PROOF STATE]
proof (state)
this:
lrange_filter x (leaves sub) @ leaves_list list @ leaves t = lrange_filter x (leaves (Node ts t))

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))

goal (1 subgoal):
 1. lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lrange (Node ts t) x = lrange_filter x (leaves (Node ts t))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wf_nodeOrder: "wf(nodeOrder j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf (nodeOrder j)
[PROOF STEP]
apply (unfold nodeOrder_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf (Restr (measure (\<lambda>i. (j + N - i) mod N)) {..<N})
[PROOF STEP]
apply (rule wf_measure [THEN wf_subset], blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lapp_fin_infT: "\<lbrakk>s \<in> A\<^sup>\<star>; t \<in> A\<^sup>\<omega>\<rbrakk> \<Longrightarrow> s @@ t \<in> A\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<in> A\<^sup>\<star>; t \<in> A\<^sup>\<omega>\<rbrakk> \<Longrightarrow> s @@ t \<in> A\<^sup>\<omega>
[PROOF STEP]
by (induct rule: finlsts.induct)
     (auto intro: inflstsI2)


[STATEMENT]
lemma restrict_sup:
  fixes f g :: "('a,'b::bounded_semilattice_sup_bot) square"
  shows "ks\<langle>f \<oplus> g\<rangle>ls = ks\<langle>f\<rangle>ls \<oplus> ks\<langle>g\<rangle>ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ks \<langle>f \<oplus> g\<rangle> ls = ks \<langle>f\<rangle> ls \<oplus> ks \<langle>g\<rangle> ls
[PROOF STEP]
by (unfold restrict_matrix_def sup_matrix_def) auto


[STATEMENT]
lemma dual_map_compose:
  "dual_map S f (dual_map T g x) = dual_map S (g \<circ> f) x"
  if "x \<in> dual_space U" and "linear_on T U scaleR scaleR g"
  and f: "linear_on S T scaleR scaleR f"
  and defined: "f ` S \<subseteq> T"
  and ST: "real_vector_space_pair_on S T"
  and TU: "real_vector_space_pair_on T U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual_map S f (dual_map T g x) = dual_map S (g \<circ> f) x
[PROOF STEP]
proof (rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. dual_map S f (dual_map T g x) xa = dual_map S (g \<circ> f) x xa
[PROOF STEP]
have SU: "real_vector_space_pair_on S U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_vector_space_pair_on S U
[PROOF STEP]
using ST TU
[PROOF STATE]
proof (prove)
using this:
real_vector_space_pair_on S T
real_vector_space_pair_on T U

goal (1 subgoal):
 1. real_vector_space_pair_on S U
[PROOF STEP]
by (auto simp add: real_vector_space_pair_on_def)
[PROOF STATE]
proof (state)
this:
real_vector_space_pair_on S U

goal (1 subgoal):
 1. \<And>xa. dual_map S f (dual_map T g x) xa = dual_map S (g \<circ> f) x xa
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. dual_map S f (dual_map T g x) xa = dual_map S (g \<circ> f) x xa
[PROOF STEP]
show "dual_map S f (dual_map T g x) v = dual_map S (g \<circ> f) x v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual_map S f (dual_map T g x) v = dual_map S (g \<circ> f) x v
[PROOF STEP]
unfolding dual_map_def[OF ST] dual_map_def[OF TU] dual_map_def[OF SU] restrict0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if v \<in> S then if f v \<in> T then x (g (f v)) else 0 else 0) = (if v \<in> S then x ((g \<circ> f) v) else 0)
[PROOF STEP]
using defined
[PROOF STATE]
proof (prove)
using this:
f ` S \<subseteq> T

goal (1 subgoal):
 1. (if v \<in> S then if f v \<in> T then x (g (f v)) else 0 else 0) = (if v \<in> S then x ((g \<circ> f) v) else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dual_map S f (dual_map T g x) v = dual_map S (g \<circ> f) x v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vint_uminus_closed:
  assumes "x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
  shows "-\<^sub>\<int> x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. -\<^sub>\<int> x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. -\<^sub>\<int> x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
have "(-x'::int) \<in> UNIV" for x'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x' \<in> UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- ?x' \<in> UNIV

goal (1 subgoal):
 1. -\<^sub>\<int> x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
-\<^sub>\<int> x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
-\<^sub>\<int> x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>

goal (1 subgoal):
 1. -\<^sub>\<int> x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
-\<^sub>\<int> x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma differentiable_on_eq_differentiable_at:
  "open s \<Longrightarrow> f differentiable_on s \<longleftrightarrow> (\<forall>x\<in>s. f differentiable at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open s \<Longrightarrow> (f differentiable_on s) = (\<forall>x\<in>s. f differentiable at x)
[PROOF STEP]
unfolding differentiable_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open s \<Longrightarrow> (\<forall>x\<in>s. f differentiable at x within s) = (\<forall>x\<in>s. f differentiable at x)
[PROOF STEP]
by (metis at_within_interior interior_open)


[STATEMENT]
lemma robdd_invar_alt_def :
  "robdd_invar b = (robdd_invar_ids {b} \<and> robdd_invar_vars b \<and> robdd_invar_reduced b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. robdd_invar b = (robdd_invar_ids {b} \<and> robdd_invar_vars b \<and> robdd_invar_reduced b)
[PROOF STEP]
unfolding robdd_invar_def robdd_invar_ext_def robdd_invar_vars_def subrobdds_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b \<in> \<Union> (subrobdds ` {b}) \<and> robdd_invar_ids {b} \<and> robdd_invar_vars_greater 0 b \<and> robdd_invar_reduced b) = (robdd_invar_ids {b} \<and> robdd_invar_vars_greater 0 b \<and> robdd_invar_reduced b)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in cring) eval_poly_mult:
  assumes "set p \<subseteq> carrier R" "set q \<subseteq> carrier R" and "a \<in> carrier R"
  shows "eval (poly_mult p q) a = (eval p a) \<otimes> (eval q a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a
[PROOF STEP]
proof (induct p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult [] q) a = local.eval [] a \<otimes> local.eval q a
 2. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
set [] \<subseteq> carrier R

goal (2 subgoals):
 1. set [] \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult [] q) a = local.eval [] a \<otimes> local.eval q a
 2. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
set [] \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval (poly_mult [] q) a = local.eval [] a \<otimes> local.eval q a
[PROOF STEP]
using eval_in_carrier[OF assms(2-3)]
[PROOF STATE]
proof (prove)
using this:
set [] \<subseteq> carrier R
local.eval q a \<in> carrier R

goal (1 subgoal):
 1. local.eval (poly_mult [] q) a = local.eval [] a \<otimes> local.eval q a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.eval (poly_mult [] q) a = local.eval [] a \<otimes> local.eval q a

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
fix n b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
assume b: "b \<in> carrier R"
[PROOF STATE]
proof (state)
this:
b \<in> carrier R

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
hence "set (map ((\<otimes>) b) q) \<subseteq> carrier R" and "set (replicate n \<zero>) \<subseteq> carrier R"
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier R

goal (1 subgoal):
 1. set (map ((\<otimes>) b) q) \<subseteq> carrier R &&& set (replicate n \<zero>) \<subseteq> carrier R
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier R
set q \<subseteq> carrier R

goal (1 subgoal):
 1. set (map ((\<otimes>) b) q) \<subseteq> carrier R &&& set (replicate n \<zero>) \<subseteq> carrier R
[PROOF STEP]
by (induct q) (auto)
[PROOF STATE]
proof (state)
this:
set (map ((\<otimes>) b) q) \<subseteq> carrier R
set (replicate n \<zero>) \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
hence "eval ((map ((\<otimes>) b) q) @ (replicate n \<zero>)) a = (eval ((map ((\<otimes>) b) q)) a) \<otimes> (a [^] n) \<oplus> \<zero>"
[PROOF STATE]
proof (prove)
using this:
set (map ((\<otimes>) b) q) \<subseteq> carrier R
set (replicate n \<zero>) \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = local.eval (map ((\<otimes>) b) q) a \<otimes> a [^] n \<oplus> \<zero>
[PROOF STEP]
using eval_append[OF _ _ assms(3), of "map ((\<otimes>) b) q" "replicate n \<zero>"]
            eval_replicate[OF _ assms(3), of "[]"]
[PROOF STATE]
proof (prove)
using this:
set (map ((\<otimes>) b) q) \<subseteq> carrier R
set (replicate n \<zero>) \<subseteq> carrier R
\<lbrakk>set (map ((\<otimes>) b) q) \<subseteq> carrier R; set (replicate n \<zero>) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = local.eval (map ((\<otimes>) b) q) a \<otimes> a [^] length (replicate n \<zero>) \<oplus> local.eval (replicate n \<zero>) a
set [] \<subseteq> carrier R \<Longrightarrow> local.eval (replicate ?n \<zero> @ []) a = local.eval [] a

goal (1 subgoal):
 1. local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = local.eval (map ((\<otimes>) b) q) a \<otimes> a [^] n \<oplus> \<zero>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = local.eval (map ((\<otimes>) b) q) a \<otimes> a [^] n \<oplus> \<zero>

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = local.eval (map ((\<otimes>) b) q) a \<otimes> a [^] n \<oplus> \<zero>

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
have "eval (map ((\<otimes>) b) q) a = b \<otimes> eval q a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval (map ((\<otimes>) b) q) a = b \<otimes> local.eval q a
[PROOF STEP]
using assms(2-3) eval_in_carrier b
[PROOF STATE]
proof (prove)
using this:
set q \<subseteq> carrier R
a \<in> carrier R
\<lbrakk>set ?p \<subseteq> carrier R; ?x \<in> carrier R\<rbrakk> \<Longrightarrow> local.eval ?p ?x \<in> carrier R
b \<in> carrier R

goal (1 subgoal):
 1. local.eval (map ((\<otimes>) b) q) a = b \<otimes> local.eval q a
[PROOF STEP]
by(induct q) (auto simp add: m_assoc r_distr)
[PROOF STATE]
proof (state)
this:
local.eval (map ((\<otimes>) b) q) a = b \<otimes> local.eval q a

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = local.eval (map ((\<otimes>) b) q) a \<otimes> a [^] n \<oplus> \<zero>
local.eval (map ((\<otimes>) b) q) a = b \<otimes> local.eval q a
[PROOF STEP]
have "eval ((map ((\<otimes>) b) q) @ (replicate n \<zero>)) a = (b \<otimes> eval q a) \<otimes> (a [^] n) \<oplus> \<zero>"
[PROOF STATE]
proof (prove)
using this:
local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = local.eval (map ((\<otimes>) b) q) a \<otimes> a [^] n \<oplus> \<zero>
local.eval (map ((\<otimes>) b) q) a = b \<otimes> local.eval q a

goal (1 subgoal):
 1. local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = b \<otimes> local.eval q a \<otimes> a [^] n \<oplus> \<zero>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = b \<otimes> local.eval q a \<otimes> a [^] n \<oplus> \<zero>

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = b \<otimes> local.eval q a \<otimes> a [^] n \<oplus> \<zero>

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
have " ... = (b \<otimes> (a [^] n)) \<otimes> (eval q a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<otimes> local.eval q a \<otimes> a [^] n \<oplus> \<zero> = b \<otimes> a [^] n \<otimes> local.eval q a
[PROOF STEP]
using eval_in_carrier[OF assms(2-3)] b assms(3) m_assoc m_comm
[PROOF STATE]
proof (prove)
using this:
local.eval q a \<in> carrier R
b \<in> carrier R
a \<in> carrier R
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R; ?z \<in> carrier R\<rbrakk> \<Longrightarrow> ?x \<otimes> ?y \<otimes> ?z = ?x \<otimes> (?y \<otimes> ?z)
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R\<rbrakk> \<Longrightarrow> ?x \<otimes> ?y = ?y \<otimes> ?x

goal (1 subgoal):
 1. b \<otimes> local.eval q a \<otimes> a [^] n \<oplus> \<zero> = b \<otimes> a [^] n \<otimes> local.eval q a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<otimes> local.eval q a \<otimes> a [^] n \<oplus> \<zero> = b \<otimes> a [^] n \<otimes> local.eval q a

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = b \<otimes> a [^] n \<otimes> local.eval q a
[PROOF STEP]
have "eval ((map ((\<otimes>) b) q) @ (replicate n \<zero>)) a = (eval (monom b n) a) \<otimes> (eval q a)"
[PROOF STATE]
proof (prove)
using this:
local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = b \<otimes> a [^] n \<otimes> local.eval q a

goal (1 subgoal):
 1. local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = local.eval (local.monom b n) a \<otimes> local.eval q a
[PROOF STEP]
using eval_monom[OF b assms(3)]
[PROOF STATE]
proof (prove)
using this:
local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = b \<otimes> a [^] n \<otimes> local.eval q a
local.eval (local.monom b ?n) a = b \<otimes> a [^] ?n

goal (1 subgoal):
 1. local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = local.eval (local.monom b n) a \<otimes> local.eval q a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.eval (map ((\<otimes>) b) q @ replicate n \<zero>) a = local.eval (local.monom b n) a \<otimes> local.eval q a

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?b2 \<in> carrier R \<Longrightarrow> local.eval (map ((\<otimes>) ?b2) q @ replicate ?n2 \<zero>) a = local.eval (local.monom ?b2 ?n2) a \<otimes> local.eval q a

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
note aux_lemma = this
[PROOF STATE]
proof (state)
this:
?b2 \<in> carrier R \<Longrightarrow> local.eval (map ((\<otimes>) ?b2) q @ replicate ?n2 \<zero>) a = local.eval (local.monom ?b2 ?n2) a \<otimes> local.eval q a

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
case (Cons b p)
[PROOF STATE]
proof (state)
this:
set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a
set (b # p) \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
hence in_carrier:
    "eval (monom b (length p)) a \<in> carrier R" "eval p a \<in> carrier R" "eval q a \<in> carrier R" "b \<in> carrier R"
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a
set (b # p) \<subseteq> carrier R

goal (1 subgoal):
 1. (local.eval (local.monom b (length p)) a \<in> carrier R &&& local.eval p a \<in> carrier R) &&& local.eval q a \<in> carrier R &&& b \<in> carrier R
[PROOF STEP]
using eval_in_carrier monom_in_carrier assms
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a
set (b # p) \<subseteq> carrier R
\<lbrakk>set ?p \<subseteq> carrier R; ?x \<in> carrier R\<rbrakk> \<Longrightarrow> local.eval ?p ?x \<in> carrier R
?a \<in> carrier R \<Longrightarrow> set (local.monom ?a ?n) \<subseteq> carrier R
set p \<subseteq> carrier R
set q \<subseteq> carrier R
a \<in> carrier R

goal (1 subgoal):
 1. (local.eval (local.monom b (length p)) a \<in> carrier R &&& local.eval p a \<in> carrier R) &&& local.eval q a \<in> carrier R &&& b \<in> carrier R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.eval (local.monom b (length p)) a \<in> carrier R
local.eval p a \<in> carrier R
local.eval q a \<in> carrier R
b \<in> carrier R

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
have set_map: "set ((map ((\<otimes>) b) q) @ (replicate (length p) \<zero>)) \<subseteq> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map ((\<otimes>) b) q @ replicate (length p) \<zero>) \<subseteq> carrier R
[PROOF STEP]
using in_carrier(4) assms(2)
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier R
set q \<subseteq> carrier R

goal (1 subgoal):
 1. set (map ((\<otimes>) b) q @ replicate (length p) \<zero>) \<subseteq> carrier R
[PROOF STEP]
by (induct q) (auto)
[PROOF STATE]
proof (state)
this:
set (map ((\<otimes>) b) q @ replicate (length p) \<zero>) \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
have set_poly: "set (poly_mult p q) \<subseteq> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (poly_mult p q) \<subseteq> carrier R
[PROOF STEP]
using poly_mult_in_carrier[OF _ assms(2), of p] Cons(2)
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> carrier R \<Longrightarrow> set (poly_mult p q) \<subseteq> carrier R
set (b # p) \<subseteq> carrier R

goal (1 subgoal):
 1. set (poly_mult p q) \<subseteq> carrier R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (poly_mult p q) \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
have "eval (poly_mult (b # p) q) a =
      ((eval (monom b (length p)) a) \<otimes> (eval q a)) \<oplus> ((eval p a) \<otimes> (eval q a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval (poly_mult (b # p) q) a = local.eval (local.monom b (length p)) a \<otimes> local.eval q a \<oplus> local.eval p a \<otimes> local.eval q a
[PROOF STEP]
using eval_poly_add[OF set_map set_poly assms(3)] aux_lemma[OF in_carrier(4), of "length p"] Cons
[PROOF STATE]
proof (prove)
using this:
local.eval (poly_add (map ((\<otimes>) b) q @ replicate (length p) \<zero>) (poly_mult p q)) a = local.eval (map ((\<otimes>) b) q @ replicate (length p) \<zero>) a \<oplus> local.eval (poly_mult p q) a
local.eval (map ((\<otimes>) b) q @ replicate (length p) \<zero>) a = local.eval (local.monom b (length p)) a \<otimes> local.eval q a
set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a
set (b # p) \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval (poly_mult (b # p) q) a = local.eval (local.monom b (length p)) a \<otimes> local.eval q a \<oplus> local.eval p a \<otimes> local.eval q a
[PROOF STEP]
by (auto simp del: poly_add.simps)
[PROOF STATE]
proof (state)
this:
local.eval (poly_mult (b # p) q) a = local.eval (local.monom b (length p)) a \<otimes> local.eval q a \<oplus> local.eval p a \<otimes> local.eval q a

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.eval (poly_mult (b # p) q) a = local.eval (local.monom b (length p)) a \<otimes> local.eval q a \<oplus> local.eval p a \<otimes> local.eval q a

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
have " ... = ((eval (monom b (length p)) a) \<oplus> (eval p a)) \<otimes> (eval q a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval (local.monom b (length p)) a \<otimes> local.eval q a \<oplus> local.eval p a \<otimes> local.eval q a = (local.eval (local.monom b (length p)) a \<oplus> local.eval p a) \<otimes> local.eval q a
[PROOF STEP]
using l_distr[OF in_carrier(1-3)]
[PROOF STATE]
proof (prove)
using this:
(local.eval (local.monom b (length p)) a \<oplus> local.eval p a) \<otimes> local.eval q a = local.eval (local.monom b (length p)) a \<otimes> local.eval q a \<oplus> local.eval p a \<otimes> local.eval q a

goal (1 subgoal):
 1. local.eval (local.monom b (length p)) a \<otimes> local.eval q a \<oplus> local.eval p a \<otimes> local.eval q a = (local.eval (local.monom b (length p)) a \<oplus> local.eval p a) \<otimes> local.eval q a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.eval (local.monom b (length p)) a \<otimes> local.eval q a \<oplus> local.eval p a \<otimes> local.eval q a = (local.eval (local.monom b (length p)) a \<oplus> local.eval p a) \<otimes> local.eval q a

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.eval (local.monom b (length p)) a \<otimes> local.eval q a \<oplus> local.eval p a \<otimes> local.eval q a = (local.eval (local.monom b (length p)) a \<oplus> local.eval p a) \<otimes> local.eval q a

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
have " ... = (eval (b # p) a) \<otimes> (eval q a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (local.eval (local.monom b (length p)) a \<oplus> local.eval p a) \<otimes> local.eval q a = local.eval (b # p) a \<otimes> local.eval q a
[PROOF STEP]
unfolding eval_monom[OF in_carrier(4) assms(3), of "length p"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b \<otimes> a [^] length p \<oplus> local.eval p a) \<otimes> local.eval q a = local.eval (b # p) a \<otimes> local.eval q a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(local.eval (local.monom b (length p)) a \<oplus> local.eval p a) \<otimes> local.eval q a = local.eval (b # p) a \<otimes> local.eval q a

goal (1 subgoal):
 1. \<And>aa p. \<lbrakk>set p \<subseteq> carrier R \<Longrightarrow> local.eval (poly_mult p q) a = local.eval p a \<otimes> local.eval q a; set (aa # p) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (poly_mult (aa # p) q) a = local.eval (aa # p) a \<otimes> local.eval q a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.eval (poly_mult (b # p) q) a = local.eval (b # p) a \<otimes> local.eval q a
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
local.eval (poly_mult (b # p) q) a = local.eval (b # p) a \<otimes> local.eval q a

goal (1 subgoal):
 1. local.eval (poly_mult (b # p) q) a = local.eval (b # p) a \<otimes> local.eval q a
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.eval (poly_mult (b # p) q) a = local.eval (b # p) a \<otimes> local.eval q a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma borel_measurable_simple_function_limit:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  shows "f \<in> borel_measurable (lebesgue_on S) \<longleftrightarrow>
         (\<exists>g. (\<forall>n. (g n) \<in> borel_measurable (lebesgue_on S)) \<and>
              (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> borel_measurable (lebesgue_on S)) = (\<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f \<in> borel_measurable (lebesgue_on S)) = (\<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x))
[PROOF STEP]
have "\<exists>g. (\<forall>n. (g n) \<in> borel_measurable (lebesgue_on S)) \<and>
            (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)"
       if f: "\<And>a i. i \<in> Basis \<Longrightarrow> {x \<in> S. f x \<bullet> i < a} \<in> sets (lebesgue_on S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)
[PROOF STEP]
have "\<exists>g. (\<forall>n. (g n) \<in> borel_measurable (lebesgue_on S)) \<and>
                  (\<forall>n. finite(image (g n) UNIV)) \<and>
                  (\<forall>x. ((\<lambda>n. g n x) \<longlonglongrightarrow> f x \<bullet> i))" if "i \<in> Basis" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x \<bullet> i)
[PROOF STEP]
proof (rule measurable_on_sf_limit_lemma1 [of S "\<lambda>x. f x \<bullet> i"])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. {x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} \<in> sets (lebesgue_on S)
 2. \<And>g. \<lbrakk>\<And>n. g n \<in> borel_measurable (lebesgue_on S); \<And>n. finite (range (g n)); \<And>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x \<bullet> i\<rbrakk> \<Longrightarrow> \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x \<bullet> i)
[PROOF STEP]
show "{x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} \<in> sets (lebesgue_on S)" for a b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} \<in> sets (lebesgue_on S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} \<in> sets (lebesgue_on S)
[PROOF STEP]
have "{x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} = {x \<in> S. f x \<bullet> i < b} - {x \<in> S. a > f x \<bullet> i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} = {x \<in> S. f x \<bullet> i < b} - {x \<in> S. f x \<bullet> i < a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} = {x \<in> S. f x \<bullet> i < b} - {x \<in> S. f x \<bullet> i < a}

goal (1 subgoal):
 1. {x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} \<in> sets (lebesgue_on S)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} = {x \<in> S. f x \<bullet> i < b} - {x \<in> S. f x \<bullet> i < a}

goal (1 subgoal):
 1. {x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} \<in> sets (lebesgue_on S)
[PROOF STEP]
have "\<dots> \<in> sets (lebesgue_on S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> S. f x \<bullet> i < b} - {x \<in> S. f x \<bullet> i < a} \<in> sets (lebesgue_on S)
[PROOF STEP]
using f that
[PROOF STATE]
proof (prove)
using this:
?i \<in> Basis \<Longrightarrow> {x \<in> S. f x \<bullet> ?i < ?a} \<in> sets (lebesgue_on S)
i \<in> Basis

goal (1 subgoal):
 1. {x \<in> S. f x \<bullet> i < b} - {x \<in> S. f x \<bullet> i < a} \<in> sets (lebesgue_on S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x \<in> S. f x \<bullet> i < b} - {x \<in> S. f x \<bullet> i < a} \<in> sets (lebesgue_on S)

goal (1 subgoal):
 1. {x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} \<in> sets (lebesgue_on S)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} \<in> sets (lebesgue_on S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} \<in> sets (lebesgue_on S)

goal (1 subgoal):
 1. {x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} \<in> sets (lebesgue_on S)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
{x \<in> S. a \<le> f x \<bullet> i \<and> f x \<bullet> i < b} \<in> sets (lebesgue_on S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{x \<in> S. ?a \<le> f x \<bullet> i \<and> f x \<bullet> i < ?b} \<in> sets (lebesgue_on S)

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<And>n. g n \<in> borel_measurable (lebesgue_on S); \<And>n. finite (range (g n)); \<And>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x \<bullet> i\<rbrakk> \<Longrightarrow> \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x \<bullet> i)
[PROOF STEP]
qed blast
[PROOF STATE]
proof (state)
this:
?i \<in> Basis \<Longrightarrow> \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x \<bullet> ?i)

goal (1 subgoal):
 1. \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<in> Basis \<Longrightarrow> \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x \<bullet> ?i)
[PROOF STEP]
obtain g where g:
          "\<And>i n. i \<in> Basis \<Longrightarrow> g i n \<in> borel_measurable (lebesgue_on S)"
          "\<And>i n. i \<in> Basis \<Longrightarrow> finite(range (g i n))"
          "\<And>i x. i \<in> Basis \<Longrightarrow> ((\<lambda>n. g i n x) \<longlonglongrightarrow> f x \<bullet> i)"
[PROOF STATE]
proof (prove)
using this:
?i \<in> Basis \<Longrightarrow> \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x \<bullet> ?i)

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>\<And>i n. i \<in> Basis \<Longrightarrow> g i n \<in> borel_measurable (lebesgue_on S); \<And>i n. i \<in> Basis \<Longrightarrow> finite (range (g i n)); \<And>i x. i \<in> Basis \<Longrightarrow> (\<lambda>n. g i n x) \<longlonglongrightarrow> f x \<bullet> i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?i \<in> Basis \<Longrightarrow> g ?i ?n \<in> borel_measurable (lebesgue_on S)
?i \<in> Basis \<Longrightarrow> finite (range (g ?i ?n))
?i \<in> Basis \<Longrightarrow> (\<lambda>n. g ?i n ?x) \<longlonglongrightarrow> f ?x \<bullet> ?i

goal (1 subgoal):
 1. \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)
[PROOF STEP]
proof (intro conjI allI exI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. ?g n \<in> borel_measurable (lebesgue_on S)
 2. \<And>n. finite (range (?g n))
 3. \<And>x. (\<lambda>n. ?g n x) \<longlonglongrightarrow> f x
[PROOF STEP]
show "(\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<in> borel_measurable (lebesgue_on S)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
by (intro borel_measurable_sum borel_measurable_scaleR) (auto intro: g)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i\<in>Basis. g i ?n x *\<^sub>R i) \<in> borel_measurable (lebesgue_on S)

goal (2 subgoals):
 1. \<And>n. finite (range (\<lambda>x. \<Sum>i\<in>Basis. g i (?n9 n) x *\<^sub>R i))
 2. \<And>x. (\<lambda>n. \<Sum>i\<in>Basis. g i (?n9 n) x *\<^sub>R i) \<longlonglongrightarrow> f x
[PROOF STEP]
show "finite (range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i))" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i))
[PROOF STEP]
have "range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<subseteq> (\<lambda>h. \<Sum>i\<in>Basis. h i *\<^sub>R i) ` PiE Basis (\<lambda>i. range (g i n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<subseteq> (\<lambda>h. \<Sum>i\<in>Basis. h i *\<^sub>R i) ` (\<Pi>\<^sub>E i\<in>Basis. range (g i n))
[PROOF STEP]
proof clarify
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> (\<Sum>i\<in>Basis. g i n xa *\<^sub>R i) \<in> (\<lambda>h. \<Sum>i\<in>Basis. h i *\<^sub>R i) ` (\<Pi>\<^sub>E i\<in>Basis. range (g i n))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> (\<Sum>i\<in>Basis. g i n xa *\<^sub>R i) \<in> (\<lambda>h. \<Sum>i\<in>Basis. h i *\<^sub>R i) ` (\<Pi>\<^sub>E i\<in>Basis. range (g i n))
[PROOF STEP]
show "(\<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<in> (\<lambda>h. \<Sum>i\<in>Basis. h i *\<^sub>R i) ` (\<Pi>\<^sub>E i\<in>Basis. range (g i n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<in> (\<lambda>h. \<Sum>i\<in>Basis. h i *\<^sub>R i) ` (\<Pi>\<^sub>E i\<in>Basis. range (g i n))
[PROOF STEP]
by (rule_tac x="\<lambda>i\<in>Basis. g i n x" in image_eqI) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<in> (\<lambda>h. \<Sum>i\<in>Basis. h i *\<^sub>R i) ` (\<Pi>\<^sub>E i\<in>Basis. range (g i n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<subseteq> (\<lambda>h. \<Sum>i\<in>Basis. h i *\<^sub>R i) ` (\<Pi>\<^sub>E i\<in>Basis. range (g i n))

goal (1 subgoal):
 1. finite (range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<subseteq> (\<lambda>h. \<Sum>i\<in>Basis. h i *\<^sub>R i) ` (\<Pi>\<^sub>E i\<in>Basis. range (g i n))

goal (1 subgoal):
 1. finite (range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i))
[PROOF STEP]
have "finite(PiE Basis (\<lambda>i. range (g i n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Pi>\<^sub>E i\<in>Basis. range (g i n))
[PROOF STEP]
by (simp add: g finite_PiE)
[PROOF STATE]
proof (state)
this:
finite (\<Pi>\<^sub>E i\<in>Basis. range (g i n))

goal (1 subgoal):
 1. finite (range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<subseteq> (\<lambda>h. \<Sum>i\<in>Basis. h i *\<^sub>R i) ` (\<Pi>\<^sub>E i\<in>Basis. range (g i n))
finite (\<Pi>\<^sub>E i\<in>Basis. range (g i n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<subseteq> (\<lambda>h. \<Sum>i\<in>Basis. h i *\<^sub>R i) ` (\<Pi>\<^sub>E i\<in>Basis. range (g i n))
finite (\<Pi>\<^sub>E i\<in>Basis. range (g i n))

goal (1 subgoal):
 1. finite (range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i))
[PROOF STEP]
by (metis (mono_tags, lifting) finite_surj)
[PROOF STATE]
proof (state)
this:
finite (range (\<lambda>x. \<Sum>i\<in>Basis. g i n x *\<^sub>R i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite (range (\<lambda>x. \<Sum>i\<in>Basis. g i ?n x *\<^sub>R i))

goal (1 subgoal):
 1. \<And>x. (\<lambda>n. \<Sum>i\<in>Basis. g i (?n9 n) x *\<^sub>R i) \<longlonglongrightarrow> f x
[PROOF STEP]
show "(\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> f x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> f x
[PROOF STEP]
have "(\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> (\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> (\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i)
[PROOF STEP]
by (auto intro!: tendsto_sum tendsto_scaleR g)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> (\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i)

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> f x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> (\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i)

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> f x
[PROOF STEP]
have "(\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i) = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i) = f x
[PROOF STEP]
using euclidean_representation
[PROOF STATE]
proof (prove)
using this:
(\<Sum>b\<in>Basis. (?x \<bullet> b) *\<^sub>R b) = ?x

goal (1 subgoal):
 1. (\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i) = f x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i) = f x

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> f x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> (\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i)
(\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i) = f x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> (\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i)
(\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i) = f x

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> f x
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>i\<in>Basis. g i n x *\<^sub>R i) \<longlonglongrightarrow> f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>i\<in>Basis. g i n ?x *\<^sub>R i) \<longlonglongrightarrow> f ?x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<And>a i. i \<in> Basis \<Longrightarrow> {x \<in> S. f x \<bullet> i < a} \<in> sets (lebesgue_on S)) \<Longrightarrow> \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)

goal (1 subgoal):
 1. (f \<in> borel_measurable (lebesgue_on S)) = (\<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<And>a i. i \<in> Basis \<Longrightarrow> {x \<in> S. f x \<bullet> i < a} \<in> sets (lebesgue_on S)) \<Longrightarrow> \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)

goal (1 subgoal):
 1. (f \<in> borel_measurable (lebesgue_on S)) = (\<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x))
[PROOF STEP]
have "f \<in> borel_measurable (lebesgue_on S)"
              if meas_g: "\<And>n. g n \<in> borel_measurable (lebesgue_on S)"
                 and fin: "\<And>n. finite (range (g n))"
                 and to_f: "\<And>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x" for  g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
by (rule borel_measurable_LIMSEQ_metric [OF meas_g to_f])
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>n. ?g n \<in> borel_measurable (lebesgue_on S); \<And>n. finite (range (?g n)); \<And>x. (\<lambda>n. ?g n x) \<longlonglongrightarrow> f x\<rbrakk> \<Longrightarrow> f \<in> borel_measurable (lebesgue_on S)

goal (1 subgoal):
 1. (f \<in> borel_measurable (lebesgue_on S)) = (\<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<And>a i. i \<in> Basis \<Longrightarrow> {x \<in> S. f x \<bullet> i < a} \<in> sets (lebesgue_on S)) \<Longrightarrow> \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)
\<lbrakk>\<And>n. ?g n \<in> borel_measurable (lebesgue_on S); \<And>n. finite (range (?g n)); \<And>x. (\<lambda>n. ?g n x) \<longlonglongrightarrow> f x\<rbrakk> \<Longrightarrow> f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>a i. i \<in> Basis \<Longrightarrow> {x \<in> S. f x \<bullet> i < a} \<in> sets (lebesgue_on S)) \<Longrightarrow> \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)
\<lbrakk>\<And>n. ?g n \<in> borel_measurable (lebesgue_on S); \<And>n. finite (range (?g n)); \<And>x. (\<lambda>n. ?g n x) \<longlonglongrightarrow> f x\<rbrakk> \<Longrightarrow> f \<in> borel_measurable (lebesgue_on S)

goal (1 subgoal):
 1. (f \<in> borel_measurable (lebesgue_on S)) = (\<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x))
[PROOF STEP]
using borel_measurable_vimage_halfspace_component_lt
[PROOF STATE]
proof (prove)
using this:
(\<And>a i. i \<in> Basis \<Longrightarrow> {x \<in> S. f x \<bullet> i < a} \<in> sets (lebesgue_on S)) \<Longrightarrow> \<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x)
\<lbrakk>\<And>n. ?g n \<in> borel_measurable (lebesgue_on S); \<And>n. finite (range (?g n)); \<And>x. (\<lambda>n. ?g n x) \<longlonglongrightarrow> f x\<rbrakk> \<Longrightarrow> f \<in> borel_measurable (lebesgue_on S)
(?f \<in> borel_measurable (lebesgue_on ?S)) = (\<forall>a i. i \<in> Basis \<longrightarrow> {x \<in> ?S. ?f x \<bullet> i < a} \<in> sets (lebesgue_on ?S))

goal (1 subgoal):
 1. (f \<in> borel_measurable (lebesgue_on S)) = (\<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(f \<in> borel_measurable (lebesgue_on S)) = (\<exists>g. (\<forall>n. g n \<in> borel_measurable (lebesgue_on S)) \<and> (\<forall>n. finite (range (g n))) \<and> (\<forall>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma empty_fset_if_mdeg_le1_not_single_suc: "\<lbrakk>\<forall>x. sucs t \<noteq> {|x|}; max_deg t \<le> 1\<rbrakk> \<Longrightarrow> sucs t = {||}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. sucs t \<noteq> {|x|}; max_deg t \<le> 1\<rbrakk> \<Longrightarrow> sucs t = {||}
[PROOF STEP]
using fcard0_if_mdeg_le1_not_single_suc
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>x. sucs ?t \<noteq> {|x|}; max_deg ?t \<le> 1\<rbrakk> \<Longrightarrow> fcard (sucs ?t) = 0

goal (1 subgoal):
 1. \<lbrakk>\<forall>x. sucs t \<noteq> {|x|}; max_deg t \<le> 1\<rbrakk> \<Longrightarrow> sucs t = {||}
[PROOF STEP]
by auto


[STATEMENT]
lemma sums_divide: "f sums a \<Longrightarrow> (\<lambda>n. f n / c) sums (a / c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums a \<Longrightarrow> (\<lambda>n. f n / c) sums (a / c)
[PROOF STEP]
by (rule bounded_linear.sums [OF bounded_linear_divide])


[STATEMENT]
lemma dghm_cn_comp_ArrMap_vrange:
  assumes "\<GG> : \<BB> \<^sub>D\<^sub>G\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<^sub>D\<^sub>G\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "\<R>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Arr\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<GG> : op_dg \<BB> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<CC>
\<FF> : op_dg \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Arr\<rparr>
[PROOF STEP]
by
    (
      cs_concl cs_shallow
        cs_simp: dghm_cn_comp_components
        cs_intro: is_dghm.dghm_ArrMap_vrange V_cs_intros
    )


[STATEMENT]
lemma \<omega>_sum_take_drop: "\<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)
[PROOF STEP]
proof (induction k arbitrary: \<alpha>s)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take 0 \<alpha>s) + \<omega>_sum (drop 0 \<alpha>s)
 2. \<And>k \<alpha>s. (\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)) \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take 0 \<alpha>s) + \<omega>_sum (drop 0 \<alpha>s)
 2. \<And>k \<alpha>s. (\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)) \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega>_sum \<alpha>s = \<omega>_sum (take 0 \<alpha>s) + \<omega>_sum (drop 0 \<alpha>s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<omega>_sum \<alpha>s = \<omega>_sum (take 0 \<alpha>s) + \<omega>_sum (drop 0 \<alpha>s)

goal (1 subgoal):
 1. \<And>k \<alpha>s. (\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)) \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k \<alpha>s. (\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)) \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
\<omega>_sum ?\<alpha>s = \<omega>_sum (take k ?\<alpha>s) + \<omega>_sum (drop k ?\<alpha>s)

goal (1 subgoal):
 1. \<And>k \<alpha>s. (\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)) \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<omega>_sum ?\<alpha>s = \<omega>_sum (take k ?\<alpha>s) + \<omega>_sum (drop k ?\<alpha>s)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<omega>_sum ?\<alpha>s = \<omega>_sum (take k ?\<alpha>s) + \<omega>_sum (drop k ?\<alpha>s)

goal (1 subgoal):
 1. \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
proof (cases "\<alpha>s")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = []\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
 2. \<And>a list. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = a # list\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
\<alpha>s = []

goal (2 subgoals):
 1. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = []\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
 2. \<And>a list. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = a # list\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha>s = []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha>s = []

goal (1 subgoal):
 1. \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)

goal (1 subgoal):
 1. \<And>a list. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = a # list\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = a # list\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
case (Cons a list)
[PROOF STATE]
proof (state)
this:
\<alpha>s = a # list

goal (1 subgoal):
 1. \<And>a list. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = a # list\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
with Suc.prems
[PROOF STATE]
proof (chain)
picking this:
\<alpha>s = a # list
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha>s = a # list

goal (1 subgoal):
 1. \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
by (simp add: add.assoc flip: Suc.IH)
[PROOF STATE]
proof (state)
this:
\<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inverse_map_identity [simp]:
  "inverse_map (identity S) S S = identity S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse_map (identity S) S S = identity S
[PROOF STEP]
by (metis Id_compose compose_id_inv_into image_ident image_restrict_eq inv_into_funcset inverse_map_def restrict_extensional)


[STATEMENT]
lemma find_outside_node:
  assumes "(u,v)\<in>E\<^sup>*"
  assumes "(u,v)\<notin>(E\<inter>U\<times>U)\<^sup>*"
  assumes "u\<in>U" "v\<in>U"
  shows "\<exists>u'. u'\<notin>U \<and> (u,u')\<in>E\<^sup>* \<and> (u',v)\<in>E\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', v) \<in> E\<^sup>*
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(u, v) \<in> E\<^sup>*
(u, v) \<notin> (Restr E U)\<^sup>*
u \<in> U
v \<in> U

goal (1 subgoal):
 1. \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', v) \<in> E\<^sup>*
[PROOF STEP]
apply (induction)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>(u, u) \<notin> (Restr E U)\<^sup>*; u \<in> U; u \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', u) \<in> E\<^sup>*
 2. \<And>y z. \<lbrakk>(u, y) \<in> E\<^sup>*; (y, z) \<in> E; \<lbrakk>(u, y) \<notin> (Restr E U)\<^sup>*; u \<in> U; y \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', y) \<in> E\<^sup>*; (u, z) \<notin> (Restr E U)\<^sup>*; u \<in> U; z \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', z) \<in> E\<^sup>*
[PROOF STEP]
apply auto []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>(u, y) \<in> E\<^sup>*; (y, z) \<in> E; \<lbrakk>(u, y) \<notin> (Restr E U)\<^sup>*; u \<in> U; y \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', y) \<in> E\<^sup>*; (u, z) \<notin> (Restr E U)\<^sup>*; u \<in> U; z \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', z) \<in> E\<^sup>*
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>(u, y) \<in> E\<^sup>*; (y, z) \<in> E; \<lbrakk>(u, y) \<notin> (Restr E U)\<^sup>*; y \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', y) \<in> E\<^sup>*; (u, z) \<notin> (Restr E U)\<^sup>*; u \<in> U; z \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', z) \<in> E\<^sup>*
[PROOF STEP]
by (metis IntI mem_Sigma_iff rtrancl.simps)


[STATEMENT]
lemma formulaTrueSubset:
  fixes formula :: Formula and formula' :: Formula and valuation :: Valuation
  assumes
  formulaTrue: "formulaTrue formula valuation" and
  subset: "\<forall> (clause::Clause). clause el formula' \<longrightarrow> clause el formula"
  shows "formulaTrue formula' valuation"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
fix clause :: Clause
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
assume "clause el formula'"
[PROOF STATE]
proof (state)
this:
clause el formula'

goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
with formulaTrue subset
[PROOF STATE]
proof (chain)
picking this:
formulaTrue formula valuation
\<forall>clause. clause el formula' \<longrightarrow> clause el formula
clause el formula'
[PROOF STEP]
have "clauseTrue clause valuation"
[PROOF STATE]
proof (prove)
using this:
formulaTrue formula valuation
\<forall>clause. clause el formula' \<longrightarrow> clause el formula
clause el formula'

goal (1 subgoal):
 1. clauseTrue clause valuation
[PROOF STEP]
by (simp add:formulaTrueIffAllClausesAreTrue)
[PROOF STATE]
proof (state)
this:
clauseTrue clause valuation

goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?clause2 el formula' \<Longrightarrow> clauseTrue ?clause2 valuation

goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?clause2 el formula' \<Longrightarrow> clauseTrue ?clause2 valuation

goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
by (simp add:formulaTrueIffAllClausesAreTrue)
[PROOF STATE]
proof (state)
this:
formulaTrue formula' valuation

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma natural_eqI:
  "nat_of_natural m = nat_of_natural n \<Longrightarrow> m = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_of_natural m = nat_of_natural n \<Longrightarrow> m = n
[PROOF STEP]
using natural_eq_iff [of m n]
[PROOF STATE]
proof (prove)
using this:
(m = n) = (nat_of_natural m = nat_of_natural n)

goal (1 subgoal):
 1. nat_of_natural m = nat_of_natural n \<Longrightarrow> m = n
[PROOF STEP]
by simp


[STATEMENT]
lemma expands_to_uminus:
  "basis_wf basis \<Longrightarrow> (f expands_to F) basis \<Longrightarrow> ((\<lambda>x. -f x) expands_to -F) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>basis_wf basis; (f expands_to F) basis\<rbrakk> \<Longrightarrow> ((\<lambda>x. - f x) expands_to - F) basis
[PROOF STEP]
by (auto simp: expands_to.simps is_expansion_uminus)


[STATEMENT]
lemma rev_compower [simp]: "rev ` (A ^^ n) = (rev ` A) ^^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev ` (A ^^ n) = rev ` A ^^ n
[PROOF STEP]
by (induction n) (simp_all add: conc_pow_comm)


[STATEMENT]
lemma ec_sup: "ec \<phi> \<Longrightarrow> ec \<psi> \<Longrightarrow> \<phi> \<sqinter> \<psi> \<noteq> bot \<Longrightarrow> ec (\<phi> \<squnion> \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ec \<phi>; ec \<psi>; \<phi> \<sqinter> \<psi> \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> ec (\<phi> \<squnion> \<psi>)
[PROOF STEP]
by (simp add: ec_def sc_supI closed_mdpc_supI)