[STATEMENT]
lemma tiling_domino_finite:
  assumes t: "t \<in> tiling domino"  (is "t \<in> ?T")
  shows "finite t"  (is "?F t")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite t
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
t \<in> tiling domino

goal (1 subgoal):
 1. finite t
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {}
 2. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
show "?F {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {}
[PROOF STEP]
by (rule finite.emptyI)
[PROOF STATE]
proof (state)
this:
finite {}

goal (1 subgoal):
 1. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
fix a t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
assume "?F t"
[PROOF STATE]
proof (state)
this:
finite t

goal (1 subgoal):
 1. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
assume "a \<in> domino"
[PROOF STATE]
proof (state)
this:
a \<in> domino

goal (1 subgoal):
 1. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> domino
[PROOF STEP]
have "?F a"
[PROOF STATE]
proof (prove)
using this:
a \<in> domino

goal (1 subgoal):
 1. finite a
[PROOF STEP]
by (rule domino_finite)
[PROOF STATE]
proof (state)
this:
finite a

goal (1 subgoal):
 1. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
from this and \<open>?F t\<close>
[PROOF STATE]
proof (chain)
picking this:
finite a
finite t
[PROOF STEP]
show "?F (a \<union> t)"
[PROOF STATE]
proof (prove)
using this:
finite a
finite t

goal (1 subgoal):
 1. finite (a \<union> t)
[PROOF STEP]
by (rule finite_UnI)
[PROOF STATE]
proof (state)
this:
finite (a \<union> t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enat_mult_cancel1 [simp]:
  "k * m = k * n \<longleftrightarrow> m = n \<or> k = 0 \<or> k = (\<infinity> :: enat) \<and> n \<noteq> 0 \<and> m \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k * m = k * n) = (m = n \<or> k = 0 \<or> k = \<infinity> \<and> n \<noteq> 0 \<and> m \<noteq> 0)
[PROOF STEP]
by(cases k m n rule: enat.exhaust[case_product enat.exhaust[case_product enat.exhaust]])(simp_all add: zero_enat_def)


[STATEMENT]
lemma mset_tree_merge:
  "braun (Node l x r) \<Longrightarrow> mset_tree(merge l r) = mset_tree l + mset_tree r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. braun \<langle>l, x, r\<rangle> \<Longrightarrow> mset_tree (merge l r) = mset_tree l + mset_tree r
[PROOF STEP]
by(induction l r rule: merge.induct)
  (auto simp: Let_def tree.set_sel(2) mset_sift_down replace_min_sift_down
        simp del: replace_min.simps dest!: del_left_mset split!: prod.split)


[STATEMENT]
lemma listsum_Cons: "listsum ds (A # As) = A + listsum ds As"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listsum ds (A # As) = A + listsum ds As
[PROOF STEP]
unfolding listsum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (+) (A # As) (tensor0 ds) = A + foldr (+) As (tensor0 ds)
[PROOF STEP]
by auto


[STATEMENT]
lemma convex_simplex: "n simplex S \<Longrightarrow> convex S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n simplex S \<Longrightarrow> convex S
[PROOF STEP]
by (metis convex_convex_hull simplex_def)


[STATEMENT]
lemma poly_zero_add: "poly_add zero_poly p = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_add zero_poly p = p
[PROOF STEP]
unfolding zero_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_add [] p = p
[PROOF STEP]
using poly_add.simps
[PROOF STATE]
proof (prove)
using this:
poly_add [] ?q = ?q
poly_add ((?m, ?c) # ?p) ?q = (case List.extract (\<lambda>mc. fst mc = ?m) ?q of None \<Rightarrow> (?m, ?c) # poly_add ?p ?q | Some (q1, (x, d), q2) \<Rightarrow> if ?c + d = (0::?'a) then poly_add ?p (q1 @ q2) else (?m, ?c + d) # poly_add ?p (q1 @ q2))

goal (1 subgoal):
 1. poly_add [] p = p
[PROOF STEP]
by auto


[STATEMENT]
lemma one_matrix_mult_left[simp]: "nrows A <= n \<Longrightarrow> (one_matrix n) * A = (A::('a::semiring_1) matrix)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrows A \<le> n \<Longrightarrow> one_matrix n * A = A
[PROOF STEP]
apply (subst Rep_matrix_inject[THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrows A \<le> n \<Longrightarrow> Rep_matrix (one_matrix n * A) = Rep_matrix A
[PROOF STEP]
apply (rule ext)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. nrows A \<le> n \<Longrightarrow> Rep_matrix (one_matrix n * A) x xa = Rep_matrix A x xa
[PROOF STEP]
apply (simp add: times_matrix_def Rep_mult_matrix)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. nrows A \<le> n \<Longrightarrow> foldseq (+) (\<lambda>k. (if x = k \<and> x < n then 1::'a else (0::'a)) * Rep_matrix A k xa) n = Rep_matrix A x xa
[PROOF STEP]
apply (rule_tac j1="x" in ssubst[OF foldseq_almostzero])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x xa. nrows A \<le> n \<Longrightarrow> \<forall>x. (0::'a) + x = x
 2. \<And>x xa. nrows A \<le> n \<Longrightarrow> \<forall>x. x + (0::'a) = x
 3. \<And>x xa. nrows A \<le> n \<Longrightarrow> \<forall>i. i \<noteq> x \<longrightarrow> (if x = i \<and> x < n then 1::'a else (0::'a)) * Rep_matrix A i xa = (0::'a)
 4. \<And>x xa. nrows A \<le> n \<Longrightarrow> (if x \<le> n then (if x = x \<and> x < n then 1::'a else (0::'a)) * Rep_matrix A x xa else (0::'a)) = Rep_matrix A x xa
[PROOF STEP]
apply (simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. nrows A \<le> n \<Longrightarrow> \<not> x < n \<longrightarrow> (x = n \<longrightarrow> Rep_matrix A n xa = (0::'a)) \<and> (x \<noteq> n \<longrightarrow> Rep_matrix A x xa = (0::'a))
[PROOF STEP]
by (simp add: nrows)


[STATEMENT]
lemma d_delta_ln_upper_5: "x > 0 \<Longrightarrow>
    ((\<lambda>x. ln_upper_5 x - ln x) has_field_derivative diff_delta_ln_upper_5 x) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ((\<lambda>x. ln_upper_5 x - ln x) has_real_derivative diff_delta_ln_upper_5 x) (at x)
[PROOF STEP]
unfolding ln_upper_5_def diff_delta_ln_upper_5_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ((\<lambda>x. (x\<^sup>2 + 19 * x + 10) * (x - 1) / (3 * (3 * x\<^sup>2 + 6 * x + 1)) - ln x) has_real_derivative (x - 1) ^ 5 / ((3 * x\<^sup>2 + 6 * x + 1)\<^sup>2 * x)) (at x)
[PROOF STEP]
apply (intro derivative_eq_intros | simp add: add_nonneg_eq_0_iff)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (((2 * x + 19) * (x - 1) + (x\<^sup>2 + 19 * x + 10)) * (9 * x\<^sup>2 + 18 * x + 3) - (x\<^sup>2 + 19 * x + 10) * (x - 1) * (18 * x + 18)) / ((9 * x\<^sup>2 + 18 * x + 3) * (9 * x\<^sup>2 + 18 * x + 3)) - 1 / x = (x - 1) ^ 5 / ((3 * x\<^sup>2 + 6 * x + 1)\<^sup>2 * x)
[PROOF STEP]
apply (simp add: divide_simps add_nonneg_eq_0_iff, algebra)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma all_total_Join: "[|all_total F; all_total G|] ==> all_total (F\<squnion>G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>all_total F; all_total G\<rbrakk> \<Longrightarrow> all_total (F \<squnion> G)
[PROOF STEP]
by (simp add: all_total_def, blast)


[STATEMENT]
lemma sum2:
  assumes fin: "finite X"
  assumes ne: "X\<noteq>{}"
  assumes ncoll: "(\<And>x. x \<in> X \<Longrightarrow> ccw 0 (f x) a)"
  shows "ccw 0 (sum f X) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw (0::'a) (sum f X) a
[PROOF STEP]
using sum[OF assms(1,2), of "-a" f] ncoll
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> X \<Longrightarrow> ccw (0::'a) (- a) (f x)) \<Longrightarrow> ccw (0::'a) (- a) (sum f X)
?x \<in> X \<Longrightarrow> ccw (0::'a) (f ?x) a

goal (1 subgoal):
 1. ccw (0::'a) (sum f X) a
[PROOF STEP]
by simp


[STATEMENT]
lemma Rep_Abs_mod: "Rep (Abs (m mod n)) = m mod n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep (Abs (m mod n)) = m mod n
[PROOF STEP]
using size0
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. Rep (Abs (m mod n)) = m mod n
[PROOF STEP]
by (simp add: Abs_inverse)


[STATEMENT]
lemma insert_subset_equality: "\<lbrakk> a\<notin>A; a\<notin>B; insert a A = insert a B \<rbrakk> \<Longrightarrow> A=B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<notin> A; a \<notin> B; insert a A = insert a B\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
by auto


[STATEMENT]
lemma equal_elim_rule1: "(A \<equiv> B) \<Longrightarrow> A \<Longrightarrow> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<equiv> B; A\<rbrakk> \<Longrightarrow> B
[PROOF STEP]
by auto


[STATEMENT]
lemma ic_not_closed:
  assumes "a < (b::real)"
  shows "\<not> closed {a<..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> closed {a<..b}
[PROOF STEP]
using assms frontier_subset_eq frontier_ic greaterThanAtMost_iff
[PROOF STATE]
proof (prove)
using this:
a < b
(frontier ?S \<subseteq> ?S) = closed ?S
?a < ?b \<Longrightarrow> frontier {?a<..?b} = {?a, ?b}
(?i \<in> {?l<..?u}) = (?l < ?i \<and> ?i \<le> ?u)

goal (1 subgoal):
 1. \<not> closed {a<..b}
[PROOF STEP]
by blast


[STATEMENT]
lemma qiterl_inductl: "x \<squnion> y \<cdot> z \<le> z \<Longrightarrow> qiterl (x::'a::unital_near_quantale) y \<le> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y \<cdot> z \<le> z \<Longrightarrow> qiterl x y \<le> z
[PROOF STEP]
by (simp add: lfp_lowerbound qiterl_def qiter_fun_def)


[STATEMENT]
lemma equiv_order_trans[trans]:
  assumes xy: "x \<simeq> y" and yz: "y \<sqsubseteq> z" and x: "x \<in> A" and y: "y \<in> A" and z: "z \<in> A"
  shows "x \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> z
[PROOF STEP]
using attract[OF _ _ _ x y z] xy yz
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<sqsubseteq> y; y \<sqsubseteq> x; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> x \<sqsubseteq> z
x \<simeq> y
y \<sqsubseteq> z

goal (1 subgoal):
 1. x \<sqsubseteq> z
[PROOF STEP]
by (auto elim: equivpartpE)


[STATEMENT]
lemma set_prefixes_eq: "set (prefixes xs) = {ys. prefix ys xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (prefixes xs) = {ys. prefix ys xs}
[PROOF STEP]
by auto


[STATEMENT]
lemma sings_image: "sings B =  (\<lambda> x. [x]) ` B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sings B = (\<lambda>x. [x]) ` B
[PROOF STEP]
using Setcompr_eq_image
[PROOF STATE]
proof (prove)
using this:
{?f x |x. x \<in> ?A} = ?f ` ?A

goal (1 subgoal):
 1. sings B = (\<lambda>x. [x]) ` B
[PROOF STEP]
.


[STATEMENT]
lemma push_bit_double:
  "push_bit n (a * 2) = push_bit n a * 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit n (a * (2::'a)) = push_bit n a * (2::'a)
[PROOF STEP]
by (simp add: push_bit_eq_mult ac_simps)


[STATEMENT]
theorem p49: "\<exists>x y. \<forall>(z::'a). z = x \<or> z = y \<Longrightarrow> P(a) \<and> P(b) \<Longrightarrow> (a::'a) \<noteq> b \<Longrightarrow> \<forall>x. P(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x y. \<forall>z. z = x \<or> z = y; P a \<and> P b; a \<noteq> b\<rbrakk> \<Longrightarrow> \<forall>x. P x
[PROOF STEP]
@proof
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x y. \<forall>z. z = x \<or> z = y; P a \<and> P b; a \<noteq> b\<rbrakk> \<Longrightarrow> \<forall>x. P x
[PROOF STEP]
@obtain x y where "\<forall>(z::'a). z = x \<or> z = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x y. \<forall>z. z = x \<or> z = y; P a \<and> P b; a \<noteq> b\<rbrakk> \<Longrightarrow> \<forall>x. P x
[PROOF STEP]
@have "x = a \<or> x = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x y. \<forall>z. z = x \<or> z = y; P a \<and> P b; a \<noteq> b\<rbrakk> \<Longrightarrow> \<forall>x. P x
[PROOF STEP]
@have "\<forall>c. P(c)" @with
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x y. \<forall>z. z = x \<or> z = y; P a \<and> P b; a \<noteq> b\<rbrakk> \<Longrightarrow> \<forall>x. P x
[PROOF STEP]
@have "c = a \<or> c = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x y. \<forall>z. z = x \<or> z = y; P a \<and> P b; a \<noteq> b\<rbrakk> \<Longrightarrow> \<forall>x. P x
[PROOF STEP]
@end
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x y. \<forall>z. z = x \<or> z = y; P a \<and> P b; a \<noteq> b\<rbrakk> \<Longrightarrow> \<forall>x. P x
[PROOF STEP]
@qed


[STATEMENT]
lemma cinner_sum_left: "cinner (\<Sum>x\<in>A. f x) y = (\<Sum>x\<in>A. cinner (f x) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cinner (sum f A) y = (\<Sum>x\<in>A. cinner (f x) y)
[PROOF STEP]
by (cases "finite A", induct set: finite, simp_all add: cinner_add_left)


[STATEMENT]
lemma path_append[simp]:
  "path g u (p1@p2) w \<longleftrightarrow> (\<exists>v. path g u p1 v \<and> path g v p2 w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path g u (p1 @ p2) w = (\<exists>v. path g u p1 v \<and> path g v p2 w)
[PROOF STEP]
by (induction p1 arbitrary: u) auto


[STATEMENT]
lemma smod_word_minus_one [simp]:
  \<open>w smod - 1 = 0\<close> for w :: \<open>'a::len word\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w smod - 1 = 0
[PROOF STEP]
by (simp add: smod_word_def signed_modulo_int_def)


[STATEMENT]
lemma le_list_trans:
  assumes ord: "order r A"
      and xs:  "xs \<in> nlists n A" and ys: "ys \<in> nlists n A" and zs: "zs \<in> nlists n A"
      and      "xs [\<sqsubseteq>\<^bsub>r\<^esub>] ys" and "ys [\<sqsubseteq>\<^bsub>r\<^esub>] zs"
    shows      "xs [\<sqsubseteq>\<^bsub>r\<^esub>] zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs [\<sqsubseteq>\<^bsub>r\<^esub>] zs
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs [\<sqsubseteq>\<^bsub>r\<^esub>] zs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
order r A
xs \<in> nlists n A
ys \<in> nlists n A
zs \<in> nlists n A
xs [\<sqsubseteq>\<^bsub>r\<^esub>] ys
ys [\<sqsubseteq>\<^bsub>r\<^esub>] zs

goal (1 subgoal):
 1. xs [\<sqsubseteq>\<^bsub>r\<^esub>] zs
[PROOF STEP]
proof (unfold le_def lesssub_def lesub_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
assume "list_all2 r xs ys" and "list_all2 r ys zs"
[PROOF STATE]
proof (state)
this:
list_all2 r xs ys
list_all2 r ys zs

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
hence xs_ys_zs:  "\<forall>i < length xs. r (xs!i) (ys!i) \<and> r (ys!i) (zs!i)"
        and len_xs_zs: "length xs = length zs"
[PROOF STATE]
proof (prove)
using this:
list_all2 r xs ys
list_all2 r ys zs

goal (1 subgoal):
 1. \<forall>i<length xs. r (xs ! i) (ys ! i) \<and> r (ys ! i) (zs ! i) &&& length xs = length zs
[PROOF STEP]
by (auto simp add: list_all2_conv_all_nth)
[PROOF STATE]
proof (state)
this:
\<forall>i<length xs. r (xs ! i) (ys ! i) \<and> r (ys ! i) (zs ! i)
length xs = length zs

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
from xs ys zs
[PROOF STATE]
proof (chain)
picking this:
xs \<in> nlists n A
ys \<in> nlists n A
zs \<in> nlists n A
[PROOF STEP]
have inA: "\<forall>i<length xs. xs!i \<in> A \<and> ys!i \<in> A \<and> zs!i \<in> A"
[PROOF STATE]
proof (prove)
using this:
xs \<in> nlists n A
ys \<in> nlists n A
zs \<in> nlists n A

goal (1 subgoal):
 1. \<forall>i<length xs. xs ! i \<in> A \<and> ys ! i \<in> A \<and> zs ! i \<in> A
[PROOF STEP]
by (unfold nlists_def) auto
[PROOF STATE]
proof (state)
this:
\<forall>i<length xs. xs ! i \<in> A \<and> ys ! i \<in> A \<and> zs ! i \<in> A

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
from ord
[PROOF STATE]
proof (chain)
picking this:
order r A
[PROOF STEP]
have "\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. x \<sqsubseteq>\<^sub>r y \<and> y \<sqsubseteq>\<^sub>r z \<longrightarrow> x \<sqsubseteq>\<^sub>r z"
[PROOF STATE]
proof (prove)
using this:
order r A

goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. x \<sqsubseteq>\<^bsub>r\<^esub> y \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z \<longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> z
[PROOF STEP]
by (unfold order_def) blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. x \<sqsubseteq>\<^bsub>r\<^esub> y \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z \<longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> z

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
hence "\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. r x y \<and> r y z \<longrightarrow> r x z"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. x \<sqsubseteq>\<^bsub>r\<^esub> y \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z \<longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> z

goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. r x y \<and> r y z \<longrightarrow> r x z
[PROOF STEP]
by (unfold lesssub_def lesub_def)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. r x y \<and> r y z \<longrightarrow> r x z

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
with xs_ys_zs inA
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length xs. r (xs ! i) (ys ! i) \<and> r (ys ! i) (zs ! i)
\<forall>i<length xs. xs ! i \<in> A \<and> ys ! i \<in> A \<and> zs ! i \<in> A
\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. r x y \<and> r y z \<longrightarrow> r x z
[PROOF STEP]
have "\<forall>i<length xs. r (xs!i) (zs!i)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length xs. r (xs ! i) (ys ! i) \<and> r (ys ! i) (zs ! i)
\<forall>i<length xs. xs ! i \<in> A \<and> ys ! i \<in> A \<and> zs ! i \<in> A
\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. r x y \<and> r y z \<longrightarrow> r x z

goal (1 subgoal):
 1. \<forall>i<length xs. r (xs ! i) (zs ! i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>i<length xs. r (xs ! i) (zs ! i)

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
with len_xs_zs
[PROOF STATE]
proof (chain)
picking this:
length xs = length zs
\<forall>i<length xs. r (xs ! i) (zs ! i)
[PROOF STEP]
show "list_all2 r xs zs"
[PROOF STATE]
proof (prove)
using this:
length xs = length zs
\<forall>i<length xs. r (xs ! i) (zs ! i)

goal (1 subgoal):
 1. list_all2 r xs zs
[PROOF STEP]
by (simp add:list_all2_conv_all_nth)
[PROOF STATE]
proof (state)
this:
list_all2 r xs zs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_image_mirror: "path_image (-g) = uminus ` path_image g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (- g) = uminus ` path_image g
[PROOF STEP]
by (auto simp: path_image_def)


[STATEMENT]
lemma times_iff [simp]: "\<langle>a,b\<rangle> \<^bold>\<in> A * B \<longleftrightarrow> a \<^bold>\<in> A \<and> b \<^bold>\<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<langle>a, b\<rangle> \<^bold>\<in> A * B) = (a \<^bold>\<in> A \<and> b \<^bold>\<in> B)
[PROOF STEP]
by (simp add: times_hf_def)


[STATEMENT]
lemma combine_append_replicate:
  "set Us \<subseteq> carrier R \<Longrightarrow> combine (Ks @ (replicate n \<zero>)) Us = combine Ks Us"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set Us \<subseteq> carrier R \<Longrightarrow> combine (Ks @ replicate n \<zero>) Us = combine Ks Us
[PROOF STEP]
by (induct n) (auto, metis append.assoc combine_append_zero replicate_append_same)


[STATEMENT]
lemma "P x \<and> (\<forall>y. P y \<longrightarrow> y = x) \<longrightarrow> Eps P = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P x \<and> (\<forall>y. P y \<longrightarrow> y = x) \<longrightarrow> Eps P = x
[PROOF STEP]
nitpick [expect = none]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P x \<and> (\<forall>y. P y \<longrightarrow> y = x) \<longrightarrow> Eps P = x
[PROOF STEP]
by auto


[STATEMENT]
lemma index_ordered_less:
  assumes "i < j" shows "index i < index j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index i < index j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. index i < index j
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
i < j
[PROOF STEP]
have "Suc i \<le> j"
[PROOF STATE]
proof (prove)
using this:
i < j

goal (1 subgoal):
 1. Suc i \<le> j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc i \<le> j

goal (1 subgoal):
 1. index i < index j
[PROOF STEP]
from index_ordered_le[OF this]
[PROOF STATE]
proof (chain)
picking this:
index (Suc i) \<le> index j
[PROOF STEP]
have "index (Suc i) \<le> index j"
[PROOF STATE]
proof (prove)
using this:
index (Suc i) \<le> index j

goal (1 subgoal):
 1. index (Suc i) \<le> index j
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
index (Suc i) \<le> index j

goal (1 subgoal):
 1. index i < index j
[PROOF STEP]
with index_ordered[of i]
[PROOF STATE]
proof (chain)
picking this:
index i < index (Suc i)
index (Suc i) \<le> index j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
index i < index (Suc i)
index (Suc i) \<le> index j

goal (1 subgoal):
 1. index i < index j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
index i < index j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subst_fv_aux: assumes fvv: "FV v = {}" shows "FV (subst x v e) \<subseteq> FV e - {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FV (subst x v e) \<subseteq> FV e - {x}
[PROOF STEP]
using fvv
[PROOF STATE]
proof (prove)
using this:
FV v = {}

goal (1 subgoal):
 1. FV (subst x v e) \<subseteq> FV e - {x}
[PROOF STEP]
proof (induction e arbitrary: x v rule: exp.induct)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (EVar x)) \<subseteq> FV (EVar x) - {xa}
 2. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (ENat x)) \<subseteq> FV (ENat x) - {xa}
 3. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 4. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 5. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 6. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
case (EVar x)
[PROOF STATE]
proof (state)
this:
FV v = {}

goal (6 subgoals):
 1. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (EVar x)) \<subseteq> FV (EVar x) - {xa}
 2. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (ENat x)) \<subseteq> FV (ENat x) - {xa}
 3. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 4. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 5. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 6. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FV v = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
FV v = {}

goal (1 subgoal):
 1. FV (subst x v (EVar xa__)) \<subseteq> FV (EVar xa__) - {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
FV (subst x v (EVar xa__)) \<subseteq> FV (EVar xa__) - {x}

goal (5 subgoals):
 1. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (ENat x)) \<subseteq> FV (ENat x) - {xa}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 3. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 5. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (ENat x)) \<subseteq> FV (ENat x) - {xa}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 3. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 5. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
case (ENat x)
[PROOF STATE]
proof (state)
this:
FV v = {}

goal (5 subgoals):
 1. \<And>x xa v. FV v = {} \<Longrightarrow> FV (subst xa v (ENat x)) \<subseteq> FV (ENat x) - {xa}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 3. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 5. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FV v = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
FV v = {}

goal (1 subgoal):
 1. FV (subst x v (ENat xa__)) \<subseteq> FV (ENat xa__) - {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
FV (subst x v (ENat xa__)) \<subseteq> FV (ENat xa__) - {x}

goal (4 subgoals):
 1. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 3. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 3. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
case (ELam y e)
[PROOF STATE]
proof (state)
this:
FV ?v = {} \<Longrightarrow> FV (subst ?x ?v e) \<subseteq> FV e - {?x}
FV v = {}

goal (4 subgoals):
 1. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (ELam x1a x2a)) \<subseteq> FV (ELam x1a x2a) - {x}
 2. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 3. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 4. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FV ?v = {} \<Longrightarrow> FV (subst ?x ?v e) \<subseteq> FV e - {?x}
FV v = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
FV ?v = {} \<Longrightarrow> FV (subst ?x ?v e) \<subseteq> FV e - {?x}
FV v = {}

goal (1 subgoal):
 1. FV (subst x v (ELam y e)) \<subseteq> FV (ELam y e) - {x}
[PROOF STEP]
by (cases "x = y") auto
[PROOF STATE]
proof (state)
this:
FV (subst x v (ELam y e)) \<subseteq> FV (ELam y e) - {x}

goal (3 subgoals):
 1. \<And>x1a x2a x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EApp x1a x2a)) \<subseteq> FV (EApp x1a x2a) - {x}
 2. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EPrim x1a x2a x3)) \<subseteq> FV (EPrim x1a x2a x3) - {x}
 3. \<And>x1a x2a x3 x v. \<lbrakk>\<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x1a) \<subseteq> FV x1a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x2a) \<subseteq> FV x2a - {x}; \<And>x v. FV v = {} \<Longrightarrow> FV (subst x v x3) \<subseteq> FV x3 - {x}; FV v = {}\<rbrakk> \<Longrightarrow> FV (subst x v (EIf x1a x2a x3)) \<subseteq> FV (EIf x1a x2a x3) - {x}
[PROOF STEP]
qed (simp,blast)+


[STATEMENT]
lemma (in Module) finitesum_sub_carrier:"f \<in> I \<rightarrow> {X. submodule R M X} \<Longrightarrow>
                       finitesum M I f \<subseteq> carrier M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> I \<rightarrow> {X. submodule R M X} \<Longrightarrow> finitesum M I f \<subseteq> carrier M
[PROOF STEP]
apply (rule subsetI, simp add:finitesum_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> I \<rightarrow> {X. submodule R M X}; \<exists>n g. g \<in> {j. j \<le> n} \<rightarrow> finitesum_base M I f \<and> x = \<Sigma>\<^sub>e M g n\<rbrakk> \<Longrightarrow> x \<in> carrier M
[PROOF STEP]
apply ((erule exE)+, erule conjE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n g. \<lbrakk>f \<in> I \<rightarrow> {X. submodule R M X}; g \<in> {j. j \<le> n} \<rightarrow> finitesum_base M I f; x = \<Sigma>\<^sub>e M g n\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e M g n \<in> carrier M
[PROOF STEP]
apply (frule finitesumbase_sub_carrier)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n g. \<lbrakk>f \<in> I \<rightarrow> {X. submodule R M X}; g \<in> {j. j \<le> n} \<rightarrow> finitesum_base M I f; x = \<Sigma>\<^sub>e M g n; finitesum_base M I f \<subseteq> carrier M\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e M g n \<in> carrier M
[PROOF STEP]
apply (rule nsum_mem, rule allI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n g j. \<lbrakk>f \<in> I \<rightarrow> {X. submodule R M X}; g \<in> {j. j \<le> n} \<rightarrow> finitesum_base M I f; x = \<Sigma>\<^sub>e M g n; finitesum_base M I f \<subseteq> carrier M; j \<le> n\<rbrakk> \<Longrightarrow> g j \<in> carrier M
[PROOF STEP]
apply (frule_tac x = j and f = g and A = "{j. j \<le> n}" and
        B = "finitesum_base M I f" in funcset_mem, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n g j. \<lbrakk>f \<in> I \<rightarrow> {X. submodule R M X}; g \<in> {j. j \<le> n} \<rightarrow> finitesum_base M I f; x = \<Sigma>\<^sub>e M g n; finitesum_base M I f \<subseteq> carrier M; j \<le> n; g j \<in> finitesum_base M I f\<rbrakk> \<Longrightarrow> g j \<in> carrier M
[PROOF STEP]
apply (simp add:subsetD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Iface_less_eq_empty: "Iface x \<le> Iface [] \<Longrightarrow> x = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Iface x \<le> Iface [] \<Longrightarrow> x = []
[PROOF STEP]
by(induction "Iface x" "Iface []" rule: less_eq_iface.induct) auto


[STATEMENT]
lemma lexordp_induct [consumes 1, case_names Nil Cons Cons_eq, induct pred: lexordp]:
  assumes major: "lexordp xs ys"
  and Nil: "\<And>y ys. P [] (y # ys)"
  and Cons: "\<And>x xs y ys. x < y \<Longrightarrow> P (x # xs) (y # ys)"
  and Cons_eq: "\<And>x xs ys. \<lbrakk> lexordp xs ys; P xs ys \<rbrakk> \<Longrightarrow> P (x # xs) (x # ys)"
  shows "P xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P xs ys
[PROOF STEP]
using major
[PROOF STATE]
proof (prove)
using this:
lexordp xs ys

goal (1 subgoal):
 1. P xs ys
[PROOF STEP]
by induct (simp_all add: Nil Cons not_less_iff_gr_or_eq Cons_eq)


[STATEMENT]
lemma projecting_increasing:
     "projecting C h F (increasing (func o f)) (increasing func)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projecting C h F (increasing (func \<circ> f)) (increasing func)
[PROOF STEP]
apply (unfold projecting_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>G. extend h F \<squnion> G \<in> increasing (func \<circ> f) \<longrightarrow> F \<squnion> project h (C G) G \<in> increasing func
[PROOF STEP]
apply (blast intro: project_increasing_I)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sumlist_rev:
  assumes "set xs \<subseteq> carrier G"
  shows "sumlist (rev xs) = sumlist xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumlist (rev xs) = sumlist xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> carrier G

goal (1 subgoal):
 1. sumlist (rev xs) = sumlist xs
[PROOF STEP]
by (simp add: sumlist_as_summset)


[STATEMENT]
lemma notIn_insertion_sub : "x\<notin>vars(p::real mpoly) \<Longrightarrow> x\<notin>vars(q::real mpoly)
                             \<Longrightarrow> insertion f (p-q) = insertion f p - insertion f q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> vars p; x \<notin> vars q\<rbrakk> \<Longrightarrow> insertion f (p - q) = insertion f p - insertion f q
[PROOF STEP]
by (metis ab_group_add_class.ab_diff_conv_add_uminus insertion_add insertion_neg)


[STATEMENT]
lemma set_incl_pred3:
"A \<le> B \<longleftrightarrow> (\<forall> a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)" (is "_ \<longleftrightarrow> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
have "A \<le> B \<longleftrightarrow> (\<forall> a1. A a1 \<le> B a1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1. A a1 \<le> B a1)
[PROOF STEP]
by (metis le_funD le_funI)
[PROOF STATE]
proof (state)
this:
(A \<le> B) = (\<forall>a1. A a1 \<le> B a1)

goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A \<le> B) = (\<forall>a1. A a1 \<le> B a1)

goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
have "... \<longleftrightarrow> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a1. A a1 \<le> B a1) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
apply(rule iff_allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a1. (A a1 \<le> B a1) = (\<forall>a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
unfolding set_incl_pred2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a1. (\<forall>a1a a2. A a1 a1a a2 \<longrightarrow> B a1 a1a a2) = (\<forall>a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<forall>a1. A a1 \<le> B a1) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)

goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)

goal (1 subgoal):
 1. (A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(A \<le> B) = (\<forall>a1 a2 a3. A a1 a2 a3 \<longrightarrow> B a1 a2 a3)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quasi_ordered_subset: "B \<subseteq> A \<Longrightarrow> quasi_ordered_set B (\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> A \<Longrightarrow> quasi_ordered_set B (\<sqsubseteq>)
[PROOF STEP]
apply intro_locales
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. B \<subseteq> A \<Longrightarrow> reflexive B (\<sqsubseteq>)
 2. B \<subseteq> A \<Longrightarrow> transitive B (\<sqsubseteq>)
[PROOF STEP]
using reflexive_subset transitive_subset
[PROOF STATE]
proof (prove)
using this:
?B \<subseteq> A \<Longrightarrow> reflexive ?B (\<sqsubseteq>)
?B \<subseteq> A \<Longrightarrow> transitive ?B (\<sqsubseteq>)

goal (2 subgoals):
 1. B \<subseteq> A \<Longrightarrow> reflexive B (\<sqsubseteq>)
 2. B \<subseteq> A \<Longrightarrow> transitive B (\<sqsubseteq>)
[PROOF STEP]
by auto


[STATEMENT]
lemma rtrancl3p_appendE:
  assumes "rtrancl3p r a (bs @ bs') a''"
  obtains a' where "rtrancl3p r a bs a'" "rtrancl3p r a' bs' a''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a'. \<lbrakk>rtrancl3p r a bs a'; rtrancl3p r a' bs' a''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
rtrancl3p r a (bs @ bs') a''

goal (1 subgoal):
 1. (\<And>a'. \<lbrakk>rtrancl3p r a bs a'; rtrancl3p r a' bs' a''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply(induct a "bs @ bs'" arbitrary: bs rule: rtrancl3p_converse_induct')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>bs. \<lbrakk>[] = bs @ bs'; \<And>a'. \<lbrakk>rtrancl3p r a'' bs a'; rtrancl3p r a' bs' a''\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
 2. \<And>a b a' bs bsa. \<lbrakk>rtrancl3p r a' bs a''; r a b a'; \<And>bsa. \<lbrakk>bs = bsa @ bs'; \<And>a'a. \<lbrakk>rtrancl3p r a' bsa a'a; rtrancl3p r a'a bs' a''\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis; b # bs = bsa @ bs'; \<And>a'. \<lbrakk>rtrancl3p r a bsa a'; rtrancl3p r a' bs' a''\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
apply(fastforce intro: rtrancl3p_step_converse simp add: Cons_eq_append_conv)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in Group) c_top_welldefTr4:"\<lbrakk>G \<triangleright> N; a \<in> carrier G; b \<in> carrier G;
      x \<in> N \<bullet> (a \<cdot> b)\<rbrakk> \<Longrightarrow> x \<in> c_top G N (N \<bullet> a) (N \<bullet> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<triangleright> N; a \<in> carrier G; b \<in> carrier G; x \<in> N \<bullet> (a \<cdot> b)\<rbrakk> \<Longrightarrow> x \<in> c_top G N (N \<bullet> a) (N \<bullet> b)
[PROOF STEP]
apply (frule nsg_sg[of "N"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<triangleright> N; a \<in> carrier G; b \<in> carrier G; x \<in> N \<bullet> (a \<cdot> b); G \<guillemotright> N \<rbrakk> \<Longrightarrow> x \<in> c_top G N (N \<bullet> a) (N \<bullet> b)
[PROOF STEP]
apply (simp add:c_top_def, simp add:rcs_in_set_rcs,
       simp add:rcs_def[of _ "N" "a \<cdot> b"], erule bexE,
       frule_tac h = h in sg_subset_elem[of "N"], assumption+,
       simp add:tassoc[THEN sym, of _ "a" "b"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. \<lbrakk>G \<triangleright> N; a \<in> carrier G; b \<in> carrier G; G \<guillemotright> N ; h \<in> N; h \<cdot> a \<cdot> b = x; h \<in> carrier G\<rbrakk> \<Longrightarrow> \<exists>xa\<in>N \<bullet> a. \<exists>y\<in>N \<bullet> b. xa \<cdot> y = x
[PROOF STEP]
apply (frule a_in_rcs[of "N" "b"], assumption,
       frule_tac h1 = h in rcs_fixed1[THEN sym, of "N" "a"], assumption+,
       frule_tac a = h and b = a in mult_closed, assumption+,
       frule_tac a = "h \<cdot> a" in a_in_rcs[of "N"], assumption+, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. \<lbrakk>G \<triangleright> N; a \<in> carrier G; b \<in> carrier G; G \<guillemotright> N ; h \<in> N; h \<cdot> a \<cdot> b = x; h \<in> carrier G; b \<in> N \<bullet> b; N \<bullet> (h \<cdot> a) = N \<bullet> a; h \<cdot> a \<in> carrier G; h \<cdot> a \<in> N \<bullet> a\<rbrakk> \<Longrightarrow> \<exists>xa\<in>N \<bullet> a. \<exists>y\<in>N \<bullet> b. xa \<cdot> y = x
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fds_nth_const_not_Suc_0 [simp]: "n \<noteq> 1 \<Longrightarrow> fds_nth (fds_const c) n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> fds_nth (fds_const c) n = (0::'a)
[PROOF STEP]
by (simp add: fds_nth_const)


[STATEMENT]
lemma cindexE_linear_comp:
  assumes "c\<noteq>0"
  shows "cindexE lb ub (f o (\<lambda>x. c*x+b)) = (if c>0
    then cindexE (c*lb+b) (c*ub+b) f
    else - cindexE (c*ub+b) (c*lb+b) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
define cright where "cright = (\<lambda>lb ub f. (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub.
                        jumpF f (at_right x)))"
[PROOF STATE]
proof (state)
this:
cright = (\<lambda>lb ub f. \<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub. jumpF f (at_right x))

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
define cleft where "cleft = (\<lambda>lb ub f. (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub.
                        jumpF f (at_left x)))"
[PROOF STATE]
proof (state)
this:
cleft = (\<lambda>lb ub f. \<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub. jumpF f (at_left x))

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have cindexE_unfold:"cindexE lb ub f = cright lb ub f - cleft lb ub f"
    for lb ub f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE lb ub f = cright lb ub f - cleft lb ub f
[PROOF STEP]
unfolding cindexE_def cright_def cleft_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub. jumpF f (at_right x)) - (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub. jumpF f (at_left x)) = (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub. jumpF f (at_right x)) - (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub. jumpF f (at_left x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE ?lb ?ub ?f = cright ?lb ?ub ?f - cleft ?lb ?ub ?f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have ?thesis when "c<0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have "cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f
[PROOF STEP]
unfolding cright_def cleft_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x)) = (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b. jumpF f (at_left x))
[PROOF STEP]
apply (intro sum.reindex_cong[of "\<lambda>x. (x-b)/c"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
 2. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
 3. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
[PROOF STEP]
by (simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
 2. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
c < 0

goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b}
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
c < 0

goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * ub + b < x \<and> x \<le> c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add: field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have "cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c*ub+b) (c*lb + b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f
[PROOF STEP]
unfolding cright_def cleft_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x)) = (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b. jumpF f (at_right x))
[PROOF STEP]
apply (intro sum.reindex_cong[of "\<lambda>x. (x-b)/c"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
 2. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
 3. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
[PROOF STEP]
by (simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
 2. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
c < 0

goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b}
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
c < 0

goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * ub + b \<le> x \<and> x < c * lb + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add: field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
unfolding cindexE_unfold
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f

goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) - cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cright (c * lb + b) (c * ub + b) f - cleft (c * lb + b) (c * ub + b) f else - (cright (c * ub + b) (c * lb + b) f - cleft (c * ub + b) (c * lb + b) f))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * ub + b) (c * lb + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * ub + b) (c * lb + b) f
c < 0

goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) - cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cright (c * lb + b) (c * ub + b) f - cleft (c * lb + b) (c * ub + b) f else - (cright (c * ub + b) (c * lb + b) f - cleft (c * ub + b) (c * lb + b) f))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c < 0 \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c < 0 \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have ?thesis when "c>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have "cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f
[PROOF STEP]
unfolding cright_def cleft_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x)) = (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b. jumpF f (at_right x))
[PROOF STEP]
apply (intro sum.reindex_cong[of "\<lambda>x. (x-b)/c"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
 2. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
 3. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
[PROOF STEP]
by (simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
 2. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right x) \<noteq> 0 \<and> lb \<le> x \<and> x < ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b}
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_right x) \<noteq> 0 \<and> c * lb + b \<le> x \<and> x < c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_right ((x - b) / c)) = jumpF f (at_right x)
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add: field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
have "cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c*lb+b) (c*ub + b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f
[PROOF STEP]
unfolding cright_def cleft_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x)) = (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b. jumpF f (at_left x))
[PROOF STEP]
apply (intro sum.reindex_cong[of "\<lambda>x. (x-b)/c"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
 2. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
 3. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. (x - b) / c) {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
[PROOF STEP]
by (simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
 2. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. {x. jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left x) \<noteq> 0 \<and> lb < x \<and> x \<le> ub} = (\<lambda>x. (x - b) / c) ` {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b}
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. x \<in> {x. jumpF f (at_left x) \<noteq> 0 \<and> c * lb + b < x \<and> x \<le> c * ub + b} \<Longrightarrow> jumpF (f \<circ> (\<lambda>x. c * x + b)) (at_left ((x - b) / c)) = jumpF f (at_left x)
[PROOF STEP]
by (subst jumpF_linear_comp[OF \<open>c\<noteq>0\<close>],auto simp add: field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
unfolding cindexE_unfold
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f

goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) - cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cright (c * lb + b) (c * ub + b) f - cleft (c * lb + b) (c * ub + b) f else - (cright (c * ub + b) (c * lb + b) f - cleft (c * ub + b) (c * lb + b) f))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
cright lb ub (f \<circ> (\<lambda>x. c * x + b)) = cright (c * lb + b) (c * ub + b) f
cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = cleft (c * lb + b) (c * ub + b) f
0 < c

goal (1 subgoal):
 1. cright lb ub (f \<circ> (\<lambda>x. c * x + b)) - cleft lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cright (c * lb + b) (c * ub + b) f - cleft (c * lb + b) (c * ub + b) f else - (cright (c * ub + b) (c * lb + b) f - cleft (c * ub + b) (c * lb + b) f))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < c \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c < 0 \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
0 < c \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c < 0 \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
0 < c \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
using \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
c < 0 \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
0 < c \<Longrightarrow> cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
c \<noteq> 0

goal (1 subgoal):
 1. cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE lb ub (f \<circ> (\<lambda>x. c * x + b)) = (if 0 < c then cindexE (c * lb + b) (c * ub + b) f else - cindexE (c * ub + b) (c * lb + b) f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bst_delete: "bst t \<Longrightarrow> bst(delete x t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bst t \<Longrightarrow> bst (delete x t)
[PROOF STEP]
using splay.invar_delete[of t x]
[PROOF STATE]
proof (prove)
using this:
splay.invar t \<Longrightarrow> splay.invar (delete x t)

goal (1 subgoal):
 1. bst t \<Longrightarrow> bst (delete x t)
[PROOF STEP]
by (simp add: bst_iff_sorted_wrt_less splay.invar_def)


[STATEMENT]
lemma aff_dim_dim_affine_diffs:
  fixes S :: "'a :: euclidean_space set"
  assumes "affine S" "a \<in> S"
    shows "aff_dim S = dim ((\<lambda>x. x - a) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
obtain B where aff: "affine hull B = affine hull S"
             and ind: "\<not> affine_dependent B"
             and card: "of_nat (card B) = aff_dim S + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>affine hull B = affine hull S; \<not> affine_dependent B; int (card B) = aff_dim S + 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using aff_dim_basis_exists
[PROOF STATE]
proof (prove)
using this:
\<exists>B. affine hull B = affine hull ?V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim ?V + 1

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>affine hull B = affine hull S; \<not> affine_dependent B; int (card B) = aff_dim S + 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
affine hull B = affine hull S
\<not> affine_dependent B
int (card B) = aff_dim S + 1

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
affine hull B = affine hull S
\<not> affine_dependent B
int (card B) = aff_dim S + 1
[PROOF STEP]
have "B \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
affine hull B = affine hull S
\<not> affine_dependent B
int (card B) = aff_dim S + 1

goal (1 subgoal):
 1. B \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
affine hull B = affine hull S
\<not> affine_dependent B
int (card B) = aff_dim S + 1
affine S
a \<in> S

goal (1 subgoal):
 1. B \<noteq> {}
[PROOF STEP]
by (metis affine_hull_eq_empty ex_in_conv)
[PROOF STATE]
proof (state)
this:
B \<noteq> {}

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B \<noteq> {}
[PROOF STEP]
obtain c where "c \<in> B"
[PROOF STATE]
proof (prove)
using this:
B \<noteq> {}

goal (1 subgoal):
 1. (\<And>c. c \<in> B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<in> B

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<in> B
[PROOF STEP]
have "c \<in> S"
[PROOF STATE]
proof (prove)
using this:
c \<in> B

goal (1 subgoal):
 1. c \<in> S
[PROOF STEP]
by (metis aff affine_hull_eq \<open>affine S\<close> hull_inc)
[PROOF STATE]
proof (state)
this:
c \<in> S

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have xy: "x - c = y - a \<longleftrightarrow> y = x + 1 *\<^sub>R (a - c)" for x y c and a::'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - c = y - a) = (y = x + 1 *\<^sub>R (a - c))
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
(?x - ?c = ?y - ?a) = (?y = ?x + 1 *\<^sub>R (?a - ?c))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have *: "(\<lambda>x. x - c) ` S = (\<lambda>x. x - a) ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x - c) ` S = (\<lambda>x. x - a) ` S
[PROOF STEP]
using assms \<open>c \<in> S\<close>
[PROOF STATE]
proof (prove)
using this:
affine S
a \<in> S
c \<in> S

goal (1 subgoal):
 1. (\<lambda>x. x - c) ` S = (\<lambda>x. x - a) ` S
[PROOF STEP]
by (auto simp: image_iff xy; metis mem_affine_3_minus pth_1)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x - c) ` S = (\<lambda>x. x - a) ` S

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have affS: "affine hull S = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull S = S
[PROOF STEP]
by (simp add: \<open>affine S\<close>)
[PROOF STATE]
proof (state)
this:
affine hull S = S

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have "aff_dim S = of_nat (card B) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim S = int (card B) - 1
[PROOF STEP]
using card
[PROOF STATE]
proof (prove)
using this:
int (card B) = aff_dim S + 1

goal (1 subgoal):
 1. aff_dim S = int (card B) - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
aff_dim S = int (card B) - 1

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
aff_dim S = int (card B) - 1

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have "... = dim ((\<lambda>x. x - c) ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (card B) - 1 = int (dim ((\<lambda>x. x - c) ` B))
[PROOF STEP]
using affine_independent_card_dim_diffs [OF ind \<open>c \<in> B\<close>]
[PROOF STATE]
proof (prove)
using this:
card B = dim ((\<lambda>x. x - c) ` B) + 1

goal (1 subgoal):
 1. int (card B) - 1 = int (dim ((\<lambda>x. x - c) ` B))
[PROOF STEP]
by (simp add: affine_independent_card_dim_diffs [OF ind \<open>c \<in> B\<close>])
[PROOF STATE]
proof (state)
this:
int (card B) - 1 = int (dim ((\<lambda>x. x - c) ` B))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int (card B) - 1 = int (dim ((\<lambda>x. x - c) ` B))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have "... = dim ((\<lambda>x. x - c) ` (affine hull B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (dim ((\<lambda>x. x - c) ` B)) = int (dim ((\<lambda>x. x - c) ` (affine hull B)))
[PROOF STEP]
by (simp add: diffs_affine_hull_span \<open>c \<in> B\<close>)
[PROOF STATE]
proof (state)
this:
int (dim ((\<lambda>x. x - c) ` B)) = int (dim ((\<lambda>x. x - c) ` (affine hull B)))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int (dim ((\<lambda>x. x - c) ` B)) = int (dim ((\<lambda>x. x - c) ` (affine hull B)))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
have "... = dim ((\<lambda>x. x - a) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (dim ((\<lambda>x. x - c) ` (affine hull B))) = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
by (simp add: affS aff *)
[PROOF STATE]
proof (state)
this:
int (dim ((\<lambda>x. x - c) ` (affine hull B))) = int (dim ((\<lambda>x. x - a) ` S))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
aff_dim S = int (dim ((\<lambda>x. x - a) ` S))

goal (1 subgoal):
 1. aff_dim S = int (dim ((\<lambda>x. x - a) ` S))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
aff_dim S = int (dim ((\<lambda>x. x - a) ` S))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Max_torder_above_iff:
  assumes B: "finite B" "B \<noteq> {}" "B \<subseteq> A"
  shows "r x (Max_torder r B) \<longleftrightarrow> (\<exists>a\<in>B. r x a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r x (Max_torder r B) = (\<exists>a\<in>B. r x a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r x (Max_torder r B) = (\<exists>a\<in>B. r x a)
[PROOF STEP]
interpret Max_torder: semilattice_set "max_torder r"
  rewrites
    "semilattice_set.F (max_torder r) = Max_torder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semilattice_set (max_torder r) &&& semilattice_set.F (max_torder r) = Max_torder r
[PROOF STEP]
by (fact semilattice_set Max_torder_def [symmetric])+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r x (Max_torder r B) = (\<exists>a\<in>B. r x a)
[PROOF STEP]
from B
[PROOF STATE]
proof (chain)
picking this:
finite B
B \<noteq> {}
B \<subseteq> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite B
B \<noteq> {}
B \<subseteq> A

goal (1 subgoal):
 1. r x (Max_torder r B) = (\<exists>a\<in>B. r x a)
[PROOF STEP]
by (induct rule: finite_ne_induct) (simp_all add: max_torder_ge_conv_disj [OF tot] Max_torder_in_Domain)
[PROOF STATE]
proof (state)
this:
r x (Max_torder r B) = (\<exists>a\<in>B. r x a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convergent_prod_offset:
  assumes "convergent_prod (\<lambda>n. f (n + m))"
  shows   "convergent_prod f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent_prod f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convergent_prod f
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
convergent_prod (\<lambda>n. f (n + m))
[PROOF STEP]
obtain M L where "(\<lambda>n. \<Prod>k\<le>n. f (k + (M + m))) \<longlonglongrightarrow> L" "L \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
convergent_prod (\<lambda>n. f (n + m))

goal (1 subgoal):
 1. (\<And>M L. \<lbrakk>(\<lambda>n. \<Prod>k\<le>n. f (k + (M + m))) \<longlonglongrightarrow> L; L \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: prod_defs add.assoc)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>k\<le>n. f (k + (M + m))) \<longlonglongrightarrow> L
L \<noteq> (0::'a)

goal (1 subgoal):
 1. convergent_prod f
[PROOF STEP]
thus "convergent_prod f"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Prod>k\<le>n. f (k + (M + m))) \<longlonglongrightarrow> L
L \<noteq> (0::'a)

goal (1 subgoal):
 1. convergent_prod f
[PROOF STEP]
unfolding prod_defs
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Prod>k\<le>n. f (k + (M + m))) \<longlonglongrightarrow> L
L \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>M p. (\<lambda>n. \<Prod>i\<le>n. f (i + M)) \<longlonglongrightarrow> p \<and> p \<noteq> (0::'a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
convergent_prod f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma r_witness: assumes x: "x \<in> X"
  shows "\<exists> j. x $ j > 0 \<and> r x = (A *v x) $ j / x $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
from x[unfolded X_def]
[PROOF STATE]
proof (chain)
picking this:
x \<in> {x. le_vec 0 x \<and> x \<noteq> 0}
[PROOF STEP]
have x: "le_vec 0 x" "x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. le_vec 0 x \<and> x \<noteq> 0}

goal (1 subgoal):
 1. le_vec 0 x &&& x \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
le_vec 0 x
x \<noteq> 0

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
let ?A = "{ (A *v x) $ j / x $ j | j. x $ j \<noteq> 0 }"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
from x(2)
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> 0
[PROOF STEP]
obtain j where "x $ j \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. (\<And>j. x $h j \<noteq> 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis vec_eq_iff zero_index)
[PROOF STATE]
proof (state)
this:
x $h j \<noteq> 0

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
hence empty: "?A \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
x $h j \<noteq> 0

goal (1 subgoal):
 1. {(A *v x) $h j / x $h j |j. x $h j \<noteq> 0} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{(A *v x) $h j / x $h j |j. x $h j \<noteq> 0} \<noteq> {}

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
from Min_in[OF _ this, folded r_def]
[PROOF STATE]
proof (chain)
picking this:
finite {(A *v x) $h j / x $h j |j. x $h j \<noteq> 0} \<Longrightarrow> r x \<in> {(A *v x) $h j / x $h j |j. x $h j \<noteq> 0}
[PROOF STEP]
obtain j where "x $ j \<noteq> 0" and rx: "r x = (A *v x) $ j / x $ j"
[PROOF STATE]
proof (prove)
using this:
finite {(A *v x) $h j / x $h j |j. x $h j \<noteq> 0} \<Longrightarrow> r x \<in> {(A *v x) $h j / x $h j |j. x $h j \<noteq> 0}

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>x $h j \<noteq> 0; r x = (A *v x) $h j / x $h j\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x $h j \<noteq> 0
r x = (A *v x) $h j / x $h j

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
le_vec 0 x
x \<noteq> 0
x $h j \<noteq> 0
r x = (A *v x) $h j / x $h j
[PROOF STEP]
have "x $ j > 0"
[PROOF STATE]
proof (prove)
using this:
le_vec 0 x
x \<noteq> 0
x $h j \<noteq> 0
r x = (A *v x) $h j / x $h j

goal (1 subgoal):
 1. 0 < x $h j
[PROOF STEP]
by (auto simp: dual_order.not_eq_order_implies_strict)
[PROOF STATE]
proof (state)
this:
0 < x $h j

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
with rx
[PROOF STATE]
proof (chain)
picking this:
r x = (A *v x) $h j / x $h j
0 < x $h j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r x = (A *v x) $h j / x $h j
0 < x $h j

goal (1 subgoal):
 1. \<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>j. 0 < x $h j \<and> r x = (A *v x) $h j / x $h j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_to_lp_vec_to_lpoly_row [simp]:
  assumes "i < dim_row A"
  shows "(matrix_to_lpolies A)!i = vec_to_lpoly (row A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_lpolies A ! i = vec_to_lpoly (row A i)
[PROOF STEP]
by (simp add: assms)


[STATEMENT]
lemma seq_filter_pre_increasing:
  assumes "\<forall>n::nat. \<exists>m. m > n \<and> P (s m)"
  shows "seq_filter s P n < seq_filter s P (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seq_filter s P n < seq_filter s P (Suc n)
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k)
[PROOF STEP]
proof(induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
have "\<exists>k. P (s k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. P (s k)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>n. \<exists>m>n. P (s m)

goal (1 subgoal):
 1. \<exists>k. P (s k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k. P (s k)

goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>k. P (s k)
[PROOF STEP]
have "\<exists>k::nat. (LEAST k::nat. (P (s k))) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>k. P (s k)

goal (1 subgoal):
 1. \<exists>k. 0 \<le> (LEAST k. P (s k))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k. 0 \<le> (LEAST k. P (s k))

goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
obtain k where "(LEAST k::nat. (P (s k))) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. (LEAST k. P (s k)) = k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(LEAST k. P (s k)) = k

goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
have "\<exists>l. l = (LEAST l::nat. (P (s l) \<and> l > k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. l = (LEAST l. P (s l) \<and> k < l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>l. l = (LEAST l. P (s l) \<and> k < l)

goal (2 subgoals):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
 2. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<exists>l. l = (LEAST l. P (s l) \<and> k < l)

goal (1 subgoal):
 1. seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)
[PROOF STEP]
by (metis (no_types, lifting) LeastI assms)
[PROOF STATE]
proof (state)
this:
seq_filter s P 0 < (LEAST k. P (s k) \<and> seq_filter s P 0 < k)

goal (1 subgoal):
 1. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k)

goal (1 subgoal):
 1. \<And>n. seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k) \<Longrightarrow> seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
seq_filter s P n < (LEAST k. P (s k) \<and> seq_filter s P n < k)

goal (1 subgoal):
 1. seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)
[PROOF STEP]
by (metis (no_types, lifting) LeastI assms)
[PROOF STATE]
proof (state)
this:
seq_filter s P (Suc n) < (LEAST k. P (s k) \<and> seq_filter s P (Suc n) < k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_renaming_left_id_subst_right_id_subst:
  "is_renaming r \<Longrightarrow> s \<odot> r = id_subst \<Longrightarrow> r \<odot> s = id_subst"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_renaming r; s \<odot> r = id_subst\<rbrakk> \<Longrightarrow> r \<odot> s = id_subst
[PROOF STEP]
by (metis comp_subst_assoc comp_subst_id_subst is_renaming_def)


[STATEMENT]
lemma assoc'_o_assoc[simp]: \<open>assoc' o assoc = id\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. assoc' \<circ> assoc = id
[PROOF STEP]
apply (rule tensor_extensionality3')
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. register (assoc' \<circ> assoc)
 2. register id
 3. \<And>f g h. (assoc' \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = id ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)
[PROOF STEP]
by auto


[STATEMENT]
lemma gauss_jordan_i[transfer_rule]:
  "(mat_rel R ===> mat_rel R) (gauss_jordan_single_i ops) gauss_jordan_single"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mat_rel R ===> mat_rel R) (gauss_jordan_single_i ops) gauss_jordan_single
[PROOF STEP]
proof (intro rel_funI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. mat_rel R x y \<Longrightarrow> mat_rel R (gauss_jordan_single_i ops x) (gauss_jordan_single y)
[PROOF STEP]
fix A A'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. mat_rel R x y \<Longrightarrow> mat_rel R (gauss_jordan_single_i ops x) (gauss_jordan_single y)
[PROOF STEP]
assume A: "mat_rel R A A'"
[PROOF STATE]
proof (state)
this:
mat_rel R A A'

goal (1 subgoal):
 1. \<And>x y. mat_rel R x y \<Longrightarrow> mat_rel R (gauss_jordan_single_i ops x) (gauss_jordan_single y)
[PROOF STEP]
show "mat_rel R (gauss_jordan_single_i ops A) (gauss_jordan_single A')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_rel R (gauss_jordan_single_i ops A) (gauss_jordan_single A')
[PROOF STEP]
unfolding gauss_jordan_single_def gauss_jordan_single_i_def gauss_jordan_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_rel R (gauss_jordan_main_i ops (dim_row A) (dim_col A) A 0 0) (fst (gauss_jordan_main A' (0\<^sub>m (dim_row A') 0) 0 0))
[PROOF STEP]
by (rule gauss_jordan_main_i[OF _ _ A], insert A, auto simp: mat_rel_def)
[PROOF STATE]
proof (state)
this:
mat_rel R (gauss_jordan_single_i ops A) (gauss_jordan_single A')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma countable_Fow:
  fixes A :: "'a set"
  assumes "countable A"
  shows "countable (Fow A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (Fow A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. countable (Fow A)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
countable A
[PROOF STEP]
obtain to_nat_list :: "'a list \<Rightarrow> nat" where "inj_on to_nat_list (lists A)"
[PROOF STATE]
proof (prove)
using this:
countable A

goal (1 subgoal):
 1. (\<And>to_nat_list. inj_on to_nat_list (lists A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on to_nat_list (lists A)

goal (1 subgoal):
 1. countable (Fow A)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on to_nat_list (lists A)

goal (1 subgoal):
 1. countable (Fow A)
[PROOF STEP]
apply (simp add: countable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on to_nat_list (lists A) \<Longrightarrow> \<exists>f. inj_on f (Fow A)
[PROOF STEP]
apply (rule_tac x="to_nat_list \<circ> flist_arb" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on to_nat_list (lists A) \<Longrightarrow> inj_on (to_nat_list \<circ> flist_arb) (Fow A)
[PROOF STEP]
apply (rule comp_inj_on)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on to_nat_list (lists A) \<Longrightarrow> inj_on flist_arb (Fow A)
 2. inj_on to_nat_list (lists A) \<Longrightarrow> inj_on to_nat_list (flist_arb ` Fow A)
[PROOF STEP]
apply (metis flist_arb_inv inj_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on to_nat_list (lists A) \<Longrightarrow> inj_on to_nat_list (flist_arb ` Fow A)
[PROOF STEP]
apply (simp add: flist_arb_lists subset_inj_on)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
countable (Fow A)

goal:
No subgoals!
[PROOF STEP]
qed