[STATEMENT]
lemma all_zero_imp_Gauss_Jordan_column_not_zero_in_row_0:
  fixes A::"'a::{field}^'columns::{mod_type}^'rows::{mod_type}" and k::nat
  defines ia:"ia\<equiv>(if \<forall>m. is_zero_row_upt_k m k A then 0 else to_nat (GREATEST n. \<not> is_zero_row_upt_k n k A) + 1)"
  defines B:"B\<equiv>(snd (Gauss_Jordan_column_k (ia,A) k))"
  assumes all_zero: "\<forall>n. is_zero_row_upt_k n k A"
  and not_zero_i: "\<not> is_zero_row_upt_k i (Suc k) B"
  and Amk_zero: "A $ m $ from_nat k \<noteq> 0"
  shows "i=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = (0::'rows)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> (0::'rows) \<Longrightarrow> False
[PROOF STEP]
assume i_not_0: "i \<noteq> 0"
[PROOF STATE]
proof (state)
this:
i \<noteq> (0::'rows)

goal (1 subgoal):
 1. i \<noteq> (0::'rows) \<Longrightarrow> False
[PROOF STEP]
have ia2: "ia = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ia = 0
[PROOF STEP]
using ia all_zero
[PROOF STATE]
proof (prove)
using this:
ia \<equiv> if \<forall>m. is_zero_row_upt_k m k A then 0 else mod_type_class.to_nat (GREATEST n. \<not> is_zero_row_upt_k n k A) + 1
\<forall>n. is_zero_row_upt_k n k A

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

goal (1 subgoal):
 1. i \<noteq> (0::'rows) \<Longrightarrow> False
[PROOF STEP]
have B_eq_Gauss: "B = Gauss_Jordan_in_ij A 0 (from_nat k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B = Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)
[PROOF STEP]
unfolding B Gauss_Jordan_column_k_def Let_def fst_conv snd_conv ia2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (if (\<forall>m\<ge>mod_type_class.from_nat 0. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> 0 = nrows A then (0, A) else (0 + 1, Gauss_Jordan_in_ij A (mod_type_class.from_nat 0) (mod_type_class.from_nat k))) = Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)
[PROOF STEP]
using all_zero Amk_zero least_mod_type
[PROOF STATE]
proof (prove)
using this:
\<forall>n. is_zero_row_upt_k n k A
A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)
(0::?'a) \<le> ?n

goal (1 subgoal):
 1. snd (if (\<forall>m\<ge>mod_type_class.from_nat 0. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> 0 = nrows A then (0, A) else (0 + 1, Gauss_Jordan_in_ij A (mod_type_class.from_nat 0) (mod_type_class.from_nat k))) = Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)
[PROOF STEP]
unfolding from_nat_0 nrows_def
[PROOF STATE]
proof (prove)
using this:
\<forall>n. is_zero_row_upt_k n k A
A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)
(0::?'a) \<le> ?n

goal (1 subgoal):
 1. snd (if (\<forall>m\<ge>0::'rows. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> 0 = CARD('rows) then (0, A) else (0 + 1, Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))) = Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B = Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)

goal (1 subgoal):
 1. i \<noteq> (0::'rows) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B = Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k)

goal (1 subgoal):
 1. i \<noteq> (0::'rows) \<Longrightarrow> False
[PROOF STEP]
have "...$ i $ (from_nat k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ i $ mod_type_class.from_nat k = (0::'a)
[PROOF STEP]
proof (rule Gauss_Jordan_in_ij_0)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> (0::'rows) \<le> n
 2. i \<noteq> (0::'rows)
[PROOF STEP]
show "\<exists>n. A $ n $ from_nat k \<noteq> 0 \<and> 0 \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> (0::'rows) \<le> n
[PROOF STEP]
using Amk_zero least_mod_type
[PROOF STATE]
proof (prove)
using this:
A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)
(0::?'a) \<le> ?n

goal (1 subgoal):
 1. \<exists>n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> (0::'rows) \<le> n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> (0::'rows) \<le> n

goal (1 subgoal):
 1. i \<noteq> (0::'rows)
[PROOF STEP]
show "i \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> (0::'rows)
[PROOF STEP]
using i_not_0
[PROOF STATE]
proof (prove)
using this:
i \<noteq> (0::'rows)

goal (1 subgoal):
 1. i \<noteq> (0::'rows)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
i \<noteq> (0::'rows)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ i $ mod_type_class.from_nat k = (0::'a)

goal (1 subgoal):
 1. i \<noteq> (0::'rows) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
B $ i $ mod_type_class.from_nat k = (0::'a)
[PROOF STEP]
have "B $ i $ from_nat k = 0"
[PROOF STATE]
proof (prove)
using this:
B $ i $ mod_type_class.from_nat k = (0::'a)

goal (1 subgoal):
 1. B $ i $ mod_type_class.from_nat k = (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
B $ i $ mod_type_class.from_nat k = (0::'a)

goal (1 subgoal):
 1. i \<noteq> (0::'rows) \<Longrightarrow> False
[PROOF STEP]
hence "is_zero_row_upt_k i (Suc k) B"
[PROOF STATE]
proof (prove)
using this:
B $ i $ mod_type_class.from_nat k = (0::'a)

goal (1 subgoal):
 1. is_zero_row_upt_k i (Suc k) B
[PROOF STEP]
unfolding B_eq_Gauss
[PROOF STATE]
proof (prove)
using this:
Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ i $ mod_type_class.from_nat k = (0::'a)

goal (1 subgoal):
 1. is_zero_row_upt_k i (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))
[PROOF STEP]
using Gauss_Jordan_in_ij_preserves_previous_elements'[OF all_zero _ Amk_zero]
[PROOF STATE]
proof (prove)
using this:
Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ i $ mod_type_class.from_nat k = (0::'a)
mod_type_class.to_nat ?j < k \<Longrightarrow> Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k) $ ?i $ ?j = A $ ?i $ ?j

goal (1 subgoal):
 1. is_zero_row_upt_k i (Suc k) (Gauss_Jordan_in_ij A (0::'rows) (mod_type_class.from_nat k))
[PROOF STEP]
by (metis all_zero is_zero_row_upt_k_def less_SucE to_nat_from_nat)
[PROOF STATE]
proof (state)
this:
is_zero_row_upt_k i (Suc k) B

goal (1 subgoal):
 1. i \<noteq> (0::'rows) \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
is_zero_row_upt_k i (Suc k) B

goal (1 subgoal):
 1. False
[PROOF STEP]
using not_zero_i
[PROOF STATE]
proof (prove)
using this:
is_zero_row_upt_k i (Suc k) B
\<not> is_zero_row_upt_k i (Suc k) B

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prefix_takeWhile:
  assumes "prefix xs ys"
  shows   "prefix (takeWhile P xs) (takeWhile P ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix (takeWhile P xs) (takeWhile P ys)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prefix (takeWhile P xs) (takeWhile P ys)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
prefix xs ys
[PROOF STEP]
obtain zs where ys: "ys = xs @ zs"
[PROOF STATE]
proof (prove)
using this:
prefix xs ys

goal (1 subgoal):
 1. (\<And>zs. ys = xs @ zs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: prefix_def)
[PROOF STATE]
proof (state)
this:
ys = xs @ zs

goal (1 subgoal):
 1. prefix (takeWhile P xs) (takeWhile P ys)
[PROOF STEP]
have "prefix (takeWhile P xs) (takeWhile P (xs @ zs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix (takeWhile P xs) (takeWhile P (xs @ zs))
[PROOF STEP]
by (induction xs) auto
[PROOF STATE]
proof (state)
this:
prefix (takeWhile P xs) (takeWhile P (xs @ zs))

goal (1 subgoal):
 1. prefix (takeWhile P xs) (takeWhile P ys)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
prefix (takeWhile P xs) (takeWhile P (xs @ zs))

goal (1 subgoal):
 1. prefix (takeWhile P xs) (takeWhile P ys)
[PROOF STEP]
by (simp add: ys)
[PROOF STATE]
proof (state)
this:
prefix (takeWhile P xs) (takeWhile P ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_prime_eqI':
  assumes "prime p" "card {q. prime q \<and> q \<le> p} = Suc n"
  shows   "nth_prime n = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_prime n = p
[PROOF STEP]
proof (rule nth_prime_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. prime p
 2. card {q. prime q \<and> q < p} = n
[PROOF STEP]
have "{q. prime q \<and> q \<le> p} = insert p {q. prime q \<and> q < p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {q. prime q \<and> q \<le> p} = insert p {q. prime q \<and> q < p}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p
card {q. prime q \<and> q \<le> p} = Suc n

goal (1 subgoal):
 1. {q. prime q \<and> q \<le> p} = insert p {q. prime q \<and> q < p}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{q. prime q \<and> q \<le> p} = insert p {q. prime q \<and> q < p}

goal (2 subgoals):
 1. prime p
 2. card {q. prime q \<and> q < p} = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{q. prime q \<and> q \<le> p} = insert p {q. prime q \<and> q < p}

goal (2 subgoals):
 1. prime p
 2. card {q. prime q \<and> q < p} = n
[PROOF STEP]
have "card \<dots> = Suc (card {q. prime q \<and> q < p})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert p {q. prime q \<and> q < p}) = Suc (card {q. prime q \<and> q < p})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (insert p {q. prime q \<and> q < p}) = Suc (card {q. prime q \<and> q < p})

goal (2 subgoals):
 1. prime p
 2. card {q. prime q \<and> q < p} = n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {q. prime q \<and> q \<le> p} = Suc (card {q. prime q \<and> q < p})
[PROOF STEP]
show "card {q. prime q \<and> q < p} = n"
[PROOF STATE]
proof (prove)
using this:
card {q. prime q \<and> q \<le> p} = Suc (card {q. prime q \<and> q < p})

goal (1 subgoal):
 1. card {q. prime q \<and> q < p} = n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
card {q. prime q \<and> q \<le> p} = Suc (card {q. prime q \<and> q < p})
prime p
card {q. prime q \<and> q \<le> p} = Suc n

goal (1 subgoal):
 1. card {q. prime q \<and> q < p} = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {q. prime q \<and> q < p} = n

goal (1 subgoal):
 1. prime p
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma lb_impl_job_sum:
  assumes "lb T A j"
  shows "(\<Sum>x \<in> {1..m}. T x) = (\<Sum>x \<in> {1..j}. t x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum T {1..m} = sum t {1..j}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum T {1..m} = sum t {1..j}
[PROOF STEP]
note lbrules = lbE[OF assms]
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{1..m}. \<forall>y\<in>{1..m}. x \<noteq> y \<longrightarrow> A x \<inter> A y = {}
\<Union> (A ` {1..m}) = {1..j}
\<forall>x\<in>{1..m}. sum t (A x) = T x

goal (1 subgoal):
 1. sum T {1..m} = sum t {1..j}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
lb T A j
[PROOF STEP]
have FINITE: "\<forall>x \<in> {1..m}. finite (A x)"
[PROOF STATE]
proof (prove)
using this:
lb T A j

goal (1 subgoal):
 1. \<forall>x\<in>{1..m}. finite (A x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{1..m}. finite (A x)

goal (1 subgoal):
 1. sum T {1..m} = sum t {1..j}
[PROOF STEP]
have "(\<Sum>x \<in> {1..m}. T x) = (\<Sum>x \<in> {1..m}. (\<Sum>y \<in> A x. t y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum T {1..m} = (\<Sum>x = 1..m. sum t (A x))
[PROOF STEP]
using lbrules(3)
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{1..m}. sum t (A x) = T x

goal (1 subgoal):
 1. sum T {1..m} = (\<Sum>x = 1..m. sum t (A x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum T {1..m} = (\<Sum>x = 1..m. sum t (A x))

goal (1 subgoal):
 1. sum T {1..m} = sum t {1..j}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum T {1..m} = (\<Sum>x = 1..m. sum t (A x))

goal (1 subgoal):
 1. sum T {1..m} = sum t {1..j}
[PROOF STEP]
have "... = (\<Sum>x \<in> {1..j}. t x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x = 1..m. sum t (A x)) = sum t {1..j}
[PROOF STEP]
using sum_sum_eq_sum_Un[OF lbrules(1) FINITE]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x = 1..m. sum t (A x)) = sum t (\<Union> (A ` {1..m}))

goal (1 subgoal):
 1. (\<Sum>x = 1..m. sum t (A x)) = sum t {1..j}
[PROOF STEP]
unfolding lbrules(2)
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x = 1..m. sum t (A x)) = sum t {1..j}

goal (1 subgoal):
 1. (\<Sum>x = 1..m. sum t (A x)) = sum t {1..j}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>x = 1..m. sum t (A x)) = sum t {1..j}

goal (1 subgoal):
 1. sum T {1..m} = sum t {1..j}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum T {1..m} = sum t {1..j}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum T {1..m} = sum t {1..j}

goal (1 subgoal):
 1. sum T {1..m} = sum t {1..j}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum T {1..m} = sum t {1..j}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lSup_LCons: "A \<noteq> {} \<Longrightarrow> lSup (LCons x ` A) = LCons x (lSup A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> lSup (LCons x ` A) = LCons x (lSup A)
[PROOF STEP]
by(rule llist.expand)(auto simp add: image_image lhd_lSup exI LCons_image_Int_not_lnull intro!: the_equality)


[STATEMENT]
lemma pdevs_val_pdevs_scaleR[simp]:
  fixes X::"real pdevs" and y::"'a::real_normed_vector"
  shows "pdevs_val e (pdevs_scaleR X y) = pdevs_val e X *\<^sub>R y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e (pdevs_scaleR X y) = pdevs_val e X *\<^sub>R y
[PROOF STEP]
by (auto simp: pdevs_val_sum scaleR_sum_left)


[STATEMENT]
lemma degree_div:
  assumes "a dvd b"
  shows   "degree (b div a) = degree b - degree a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (b div a) = degree b - degree a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a dvd b

goal (1 subgoal):
 1. degree (b div a) = degree b - degree a
[PROOF STEP]
by (cases "a = 0"; cases "b = 0") (auto elim!: dvdE simp: degree_mult_eq)


[STATEMENT]
lemma scaleR_collapse [simp]: "(1 - u) *\<^sub>R a + u *\<^sub>R a = a"
  for a :: "'a::real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - u) *\<^sub>R a + u *\<^sub>R a = a
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma lat_ideals: "X \<in> ideals = (X \<noteq> {} \<and> X \<in> downsets \<and> (\<forall>x \<in> X. \<forall> y \<in> X. x \<squnion> y \<in> X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. idealp X = (X \<noteq> {} \<and> downset_setp X \<and> (\<forall>x\<in>X. \<forall>y\<in>X. x \<squnion> y \<in> X))
[PROOF STEP]
unfolding ideals_def directed_alt downsets_def Fix_def downset_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X \<in> {X. X \<noteq> {} \<and> X \<in> {x. {y. Bex x ((\<le>) y)} = x} \<and> X \<noteq> {} \<and> (\<forall>x\<in>X. \<forall>y\<in>X. \<exists>z\<in>X. x \<le> z \<and> y \<le> z)}) = (X \<noteq> {} \<and> X \<in> {x. {y. Bex x ((\<le>) y)} = x} \<and> (\<forall>x\<in>X. \<forall>y\<in>X. x \<squnion> y \<in> X))
[PROOF STEP]
by (clarsimp, smt sup.cobounded1 sup.orderE sup.orderI sup_absorb2 sup_left_commute mem_Collect_eq)


[STATEMENT]
lemma ennexp_mono:
  "mono ennexp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono ennexp
[PROOF STEP]
using ennexp_strict_mono
[PROOF STATE]
proof (prove)
using this:
strict_mono ennexp

goal (1 subgoal):
 1. mono ennexp
[PROOF STEP]
by (simp add: strict_mono_mono)


[STATEMENT]
lemma resultant_impl_main_code: "resultant_impl_main G1 G2 =
  (if G2 = 0 then if degree G1 = 0 then 1 else 0
     else resultant_impl_start G1 G2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. resultant_impl_main G1 G2 = (if G2 = 0 then if degree G1 = 0 then 1::'a else (0::'a) else resultant_impl_start G1 G2)
[PROOF STEP]
unfolding resultant_impl_main_def
   resultant_impl_start_def subresultant_prs_impl
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if G2 = 0 then if degree G1 = 0 then 1::'a else (0::'a) else case subresultant_prs G1 G2 of (Gk, hk) \<Rightarrow> if degree Gk = 0 then hk else (0::'a)) = (if G2 = 0 then if degree G1 = 0 then 1::'a else (0::'a) else case subresultant_prs G1 G2 of (Gk, hk) \<Rightarrow> if degree Gk = 0 then hk else (0::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma wf_less_multiset: "wf {(M :: 'a multiset, N). M < N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(M, N). M < N}
[PROOF STEP]
unfolding less_multiset_def multp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(M, N). (M, N) \<in> mult {(x, y). x < y}}
[PROOF STEP]
by (auto intro: wf_mult wf)


[STATEMENT]
lemma set_Pi_pmf_subset: "finite A \<Longrightarrow> set_pmf (Pi_pmf A dflt p) \<subseteq> {f. \<forall>x. x \<notin> A \<longrightarrow> f x = dflt}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> set_pmf (Pi_pmf.Pi_pmf A dflt p) \<subseteq> {f. \<forall>x. x \<notin> A \<longrightarrow> f x = dflt}
[PROOF STEP]
by (auto simp: set_pmf_eq pmf_Pi)


[STATEMENT]
lemma to_list_p: "p = sum_list [term * (Var v) ^ i. (term,i)\<leftarrow>(to_list v p)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)
[PROOF STEP]
define d where "d = MPoly_Type.degree p v"
[PROOF STATE]
proof (state)
this:
d = MPoly_Type.degree p v

goal (1 subgoal):
 1. p = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)
[PROOF STEP]
have "(\<Sum>i\<le>MPoly_Type.degree p v. isolate_variable_sparse p v i * Var v ^ i) = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>MPoly_Type.degree p v. isolate_variable_sparse p v i * Var v ^ i) = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)
[PROOF STEP]
unfolding to_list.simps d_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>d. isolate_variable_sparse p v i * Var v ^ i) = (\<Sum>(term, i)\<leftarrow>map (\<lambda>x. (isolate_variable_sparse p v x, x)) [0..<d + 1]. term * Var v ^ i)
[PROOF STEP]
apply(induction d)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<Sum>i\<le>0. isolate_variable_sparse p v i * Var v ^ i) = (\<Sum>a\<leftarrow>map (\<lambda>x. (isolate_variable_sparse p v x, x)) [0..<0 + 1]. case a of (term, i) \<Rightarrow> term * Var v ^ i)
 2. \<And>d. (\<Sum>i\<le>d. isolate_variable_sparse p v i * Var v ^ i) = (\<Sum>a\<leftarrow>map (\<lambda>x. (isolate_variable_sparse p v x, x)) [0..<d + 1]. case a of (term, i) \<Rightarrow> term * Var v ^ i) \<Longrightarrow> (\<Sum>i\<le>Suc d. isolate_variable_sparse p v i * Var v ^ i) = (\<Sum>a\<leftarrow>map (\<lambda>x. (isolate_variable_sparse p v x, x)) [0..<Suc d + 1]. case a of (term, i) \<Rightarrow> term * Var v ^ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>MPoly_Type.degree p v. isolate_variable_sparse p v i * Var v ^ i) = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)

goal (1 subgoal):
 1. p = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>MPoly_Type.degree p v. isolate_variable_sparse p v i * Var v ^ i) = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>MPoly_Type.degree p v. isolate_variable_sparse p v i * Var v ^ i) = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)

goal (1 subgoal):
 1. p = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)
[PROOF STEP]
using sum_over_zero[of p v]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>MPoly_Type.degree p v. isolate_variable_sparse p v i * Var v ^ i) = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)
p = (\<Sum>i\<le>MPoly_Type.degree p v. isolate_variable_sparse p v i * Var v ^ i)

goal (1 subgoal):
 1. p = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = (\<Sum>(term, i)\<leftarrow>to_list v p. term * Var v ^ i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem isin_set_Linorder:
  assumes "sorted_less (leaves t)"
    and "Laligned t u"
  shows "isin t x = (x \<in> set (leaves t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isin t x = (x \<in> set (leaves t))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sorted_less (leaves t)
Laligned t u

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

goal (2 subgoals):
 1. \<And>ks x u. \<lbrakk>sorted_less (leaves (Leaf ks)); Laligned (Leaf ks) u\<rbrakk> \<Longrightarrow> isin (Leaf ks) x = (x \<in> set (leaves (Leaf ks)))
 2. \<And>ts t x u. \<lbrakk>\<And>xa y u. \<lbrakk>(xa, y) = split ts x; y = []; sorted_less (leaves t); Laligned t u\<rbrakk> \<Longrightarrow> isin t x = (x \<in> set (leaves t)); \<And>xa y x21 x22 xaa ya u. \<lbrakk>(xa, y) = split ts x; y = x21 # x22; (xaa, ya) = x21; sorted_less (leaves xaa); Laligned xaa u\<rbrakk> \<Longrightarrow> isin xaa x = (x \<in> set (leaves xaa)); sorted_less (leaves (Node ts t)); Laligned (Node ts t) u\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>(?xa, ?y) = split ts x; ?y = []; sorted_less (leaves t); Laligned t ?u\<rbrakk> \<Longrightarrow> isin t x = (x \<in> set (leaves t))
\<lbrakk>(?xa, ?y) = split ts x; ?y = ?x21.0 # ?x22.0; (?xaa, ?ya) = ?x21.0; sorted_less (leaves ?xaa); Laligned ?xaa ?u\<rbrakk> \<Longrightarrow> isin ?xaa x = (x \<in> set (leaves ?xaa))
sorted_less (leaves (Node ts t))
Laligned (Node ts t) u
[PROOF STEP]
obtain ls rs where list_split: "split ts x = (ls, rs)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?xa, ?y) = split ts x; ?y = []; sorted_less (leaves t); Laligned t ?u\<rbrakk> \<Longrightarrow> isin t x = (x \<in> set (leaves t))
\<lbrakk>(?xa, ?y) = split ts x; ?y = ?x21.0 # ?x22.0; (?xaa, ?ya) = ?x21.0; sorted_less (leaves ?xaa); Laligned ?xaa ?u\<rbrakk> \<Longrightarrow> isin ?xaa x = (x \<in> set (leaves ?xaa))
sorted_less (leaves (Node ts t))
Laligned (Node ts t) u

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

goal (2 subgoals):
 1. \<And>ks x u. \<lbrakk>sorted_less (leaves (Leaf ks)); Laligned (Leaf ks) u\<rbrakk> \<Longrightarrow> isin (Leaf ks) x = (x \<in> set (leaves (Leaf ks)))
 2. \<And>ts t x u. \<lbrakk>\<And>xa y u. \<lbrakk>(xa, y) = split ts x; y = []; sorted_less (leaves t); Laligned t u\<rbrakk> \<Longrightarrow> isin t x = (x \<in> set (leaves t)); \<And>xa y x21 x22 xaa ya u. \<lbrakk>(xa, y) = split ts x; y = x21 # x22; (xaa, ya) = x21; sorted_less (leaves xaa); Laligned xaa u\<rbrakk> \<Longrightarrow> isin xaa x = (x \<in> set (leaves xaa)); sorted_less (leaves (Node ts t)); Laligned (Node ts t) u\<rbrakk> \<Longrightarrow> isin (Node ts t) x = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
split ts x = (ls, rs)
[PROOF STEP]
have list_conc: "ts = ls @ rs"
[PROOF STATE]
proof (prove)
using this:
split ts x = (ls, rs)

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

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

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

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

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

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

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

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

goal (2 subgoals):
 1. rs = [] \<Longrightarrow> isin (Node ts t) x = (x \<in> set (leaves (Node ts t)))
 2. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
have "\<dots> = (x \<in> set (leaves (Node ts t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> set (leaves t)) = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
using isin_sorted_split
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Laligned (Node ?ts ?t) ?u; sorted_less (leaves (Node ?ts ?t)); split ?ts ?x = (?ls, ?rs)\<rbrakk> \<Longrightarrow> (?x \<in> set (leaves (Node ?ts ?t))) = (?x \<in> set (leaves_list ?rs @ leaves ?t))

goal (1 subgoal):
 1. (x \<in> set (leaves t)) = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
using "2.prems" list_split list_conc Nil
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Laligned (Node ?ts ?t) ?u; sorted_less (leaves (Node ?ts ?t)); split ?ts ?x = (?ls, ?rs)\<rbrakk> \<Longrightarrow> (?x \<in> set (leaves (Node ?ts ?t))) = (?x \<in> set (leaves_list ?rs @ leaves ?t))
sorted_less (leaves (Node ts t))
Laligned (Node ts t) u
split ts x = (ls, rs)
ts = ls @ rs
rs = []

goal (1 subgoal):
 1. (x \<in> set (leaves t)) = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<in> set (leaves t)) = (x \<in> set (leaves (Node ts t)))

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

goal (1 subgoal):
 1. isin (Node ts t) x = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = (x \<in> set (leaves (Node ts t)))

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

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

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

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

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

goal (1 subgoal):
 1. isin (Node ts t) x = isin sub x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = isin sub x

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

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

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

goal (1 subgoal):
 1. isin sub x = (x \<in> set (leaves sub))
[PROOF STEP]
by (metis Lalign_Llast Laligned_split_left)
[PROOF STATE]
proof (state)
this:
isin sub x = (x \<in> set (leaves sub))

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

goal (1 subgoal):
 1. \<And>a list. rs = a # list \<Longrightarrow> isin (Node ts t) x = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
have "\<dots> = (x \<in> set (leaves (Node ts t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> set (leaves sub)) = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
using isin_sorted_split
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Laligned (Node ?ts ?t) ?u; sorted_less (leaves (Node ?ts ?t)); split ?ts ?x = (?ls, ?rs)\<rbrakk> \<Longrightarrow> (?x \<in> set (leaves (Node ?ts ?t))) = (?x \<in> set (leaves_list ?rs @ leaves ?t))

goal (1 subgoal):
 1. (x \<in> set (leaves sub)) = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
using isin_sorted_split_right "2.prems" list_split Cons a_split
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Laligned (Node ?ts ?t) ?u; sorted_less (leaves (Node ?ts ?t)); split ?ts ?x = (?ls, ?rs)\<rbrakk> \<Longrightarrow> (?x \<in> set (leaves (Node ?ts ?t))) = (?x \<in> set (leaves_list ?rs @ leaves ?t))
\<lbrakk>split ?ts ?x = (?ls, (?sub, ?sep) # ?rs); sorted_less (leaves (Node ?ts ?t)); Laligned (Node ?ts ?t) ?u\<rbrakk> \<Longrightarrow> (?x \<in> set (leaves_list ((?sub, ?sep) # ?rs) @ leaves ?t)) = (?x \<in> set (leaves ?sub))
sorted_less (leaves (Node ts t))
Laligned (Node ts t) u
split ts x = (ls, rs)
rs = a # list
a = (sub, sep)

goal (1 subgoal):
 1. (x \<in> set (leaves sub)) = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<in> set (leaves sub)) = (x \<in> set (leaves (Node ts t)))

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

goal (1 subgoal):
 1. isin (Node ts t) x = (x \<in> set (leaves (Node ts t)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = (x \<in> set (leaves (Node ts t)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
isin (Node ts t) x = (x \<in> set (leaves (Node ts t)))

goal (1 subgoal):
 1. \<And>ks x u. \<lbrakk>sorted_less (leaves (Leaf ks)); Laligned (Leaf ks) u\<rbrakk> \<Longrightarrow> isin (Leaf ks) x = (x \<in> set (leaves (Leaf ks)))
[PROOF STEP]
qed (auto simp add: insert_list_req)


[STATEMENT]
lemma word_unat_mask_lt:
  "m \<le> size w \<Longrightarrow> unat ((w::'a::len word) AND mask m) < 2 ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> size w \<Longrightarrow> unat (w AND mask m) < 2 ^ m
[PROOF STEP]
by (rule word_unat_and_lt) (simp add: unat_mask word_size)


[STATEMENT]
lemma (in Ring) nsDistr:  "x \<in> carrier R
        \<Longrightarrow> (nscal R x n) \<plusminus> (nscal R x m) = nscal R x (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier R \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus>  m \<times>\<^bsub>R\<^esub> x =  (n + m) \<times>\<^bsub>R\<^esub> x
[PROOF STEP]
apply (cut_tac ring_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus>  m \<times>\<^bsub>R\<^esub> x =  (n + m) \<times>\<^bsub>R\<^esub> x
[PROOF STEP]
apply (induct_tac m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus>  0 \<times>\<^bsub>R\<^esub> x =  (n + 0) \<times>\<^bsub>R\<^esub> x
 2. \<And>na. \<lbrakk>x \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  na \<times>\<^bsub>R\<^esub> x =  (n + na) \<times>\<^bsub>R\<^esub> x\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus>  Suc na \<times>\<^bsub>R\<^esub> x =  (n + Suc na) \<times>\<^bsub>R\<^esub> x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus> \<zero> =  n \<times>\<^bsub>R\<^esub> x
 2. \<And>na. \<lbrakk>x \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  na \<times>\<^bsub>R\<^esub> x =  (n + na) \<times>\<^bsub>R\<^esub> x\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus>  Suc na \<times>\<^bsub>R\<^esub> x =  (n + Suc na) \<times>\<^bsub>R\<^esub> x
[PROOF STEP]
apply (frule nsClose[of "x" "n"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<in> carrier R\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus> \<zero> =  n \<times>\<^bsub>R\<^esub> x
 2. \<And>na. \<lbrakk>x \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  na \<times>\<^bsub>R\<^esub> x =  (n + na) \<times>\<^bsub>R\<^esub> x\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus>  Suc na \<times>\<^bsub>R\<^esub> x =  (n + Suc na) \<times>\<^bsub>R\<^esub> x
[PROOF STEP]
apply ( simp add:aGroup.ag_r_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. \<lbrakk>x \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  na \<times>\<^bsub>R\<^esub> x =  (n + na) \<times>\<^bsub>R\<^esub> x\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus>  Suc na \<times>\<^bsub>R\<^esub> x =  (n + Suc na) \<times>\<^bsub>R\<^esub> x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. \<lbrakk>x \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  na \<times>\<^bsub>R\<^esub> x =  (n + na) \<times>\<^bsub>R\<^esub> x\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus> ( na \<times>\<^bsub>R\<^esub> x \<plusminus> x) =  (n + na) \<times>\<^bsub>R\<^esub> x \<plusminus> x
[PROOF STEP]
apply (frule_tac x = x and n = n in nsClose,
         frule_tac x = x and n = na in nsClose)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. \<lbrakk>x \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  na \<times>\<^bsub>R\<^esub> x =  (n + na) \<times>\<^bsub>R\<^esub> x;  n \<times>\<^bsub>R\<^esub> x \<in> carrier R;  na \<times>\<^bsub>R\<^esub> x \<in> carrier R\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus> ( na \<times>\<^bsub>R\<^esub> x \<plusminus> x) =  (n + na) \<times>\<^bsub>R\<^esub> x \<plusminus> x
[PROOF STEP]
apply (subst aGroup.ag_pOp_assoc[THEN sym], assumption+, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma first_edge_in_edges: "tl xs \<noteq> Nil \<Longrightarrow> first_edge_of_walk xs \<in> edges_of_walk xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tl xs \<noteq> [] \<Longrightarrow> first_edge_of_walk xs \<in> edges_of_walk xs
[PROOF STEP]
unfolding edges_of_walk_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tl xs \<noteq> [] \<Longrightarrow> first_edge_of_walk xs \<in> {uu_. \<exists>v w xs_pre xs_post. uu_ = (v, w) \<and> xs = xs_pre @ v # w # xs_post}
[PROOF STEP]
by (induct rule: first_edge_of_walk.induct) auto


[STATEMENT]
lemma infsum_nonneg_is_SUPREMUM_real:
  fixes f :: "'a \<Rightarrow> real"
  assumes summable: "f summable_on A"
    and fnn: "\<And>x. x\<in>A \<Longrightarrow> f x \<ge> 0"
  shows "infsum f A = (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. (sum f F))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsum f A = Sup (sum f ` {F. finite F \<and> F \<subseteq> A})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infsum f A = Sup (sum f ` {F. finite F \<and> F \<subseteq> A})
[PROOF STEP]
have "ereal (infsum f A) = (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. (ereal (sum f F)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (infsum f A) = (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f summable_on A
?x \<in> A \<Longrightarrow> 0 \<le> f ?x

goal (1 subgoal):
 1. ereal (infsum f A) = (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F))
[PROOF STEP]
by (rule infsum_nonneg_is_SUPREMUM_ereal)
[PROOF STATE]
proof (state)
this:
ereal (infsum f A) = (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F))

goal (1 subgoal):
 1. infsum f A = Sup (sum f ` {F. finite F \<and> F \<subseteq> A})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (infsum f A) = (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F))

goal (1 subgoal):
 1. infsum f A = Sup (sum f ` {F. finite F \<and> F \<subseteq> A})
[PROOF STEP]
have "\<dots> = ereal (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. (sum f F))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F)) = ereal (Sup (sum f ` {F. finite F \<and> F \<subseteq> A}))
[PROOF STEP]
proof (subst ereal_SUP)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<bar>SUP a\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f a)\<bar> \<noteq> \<infinity>
 2. (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F)) = (SUP a\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f a))
[PROOF STEP]
show "\<bar>SUP a\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f a)\<bar> \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>SUP a\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f a)\<bar> \<noteq> \<infinity>
[PROOF STEP]
using calculation
[PROOF STATE]
proof (prove)
using this:
ereal (infsum f A) = (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F))

goal (1 subgoal):
 1. \<bar>SUP a\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f a)\<bar> \<noteq> \<infinity>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<bar>SUP a\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f a)\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F)) = (SUP a\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f a))
[PROOF STEP]
show "(SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F)) = (SUP a\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F)) = (SUP a\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F)) = (SUP a\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(SUP F\<in>{F. finite F \<and> F \<subseteq> A}. ereal (sum f F)) = ereal (Sup (sum f ` {F. finite F \<and> F \<subseteq> A}))

goal (1 subgoal):
 1. infsum f A = Sup (sum f ` {F. finite F \<and> F \<subseteq> A})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ereal (infsum f A) = ereal (Sup (sum f ` {F. finite F \<and> F \<subseteq> A}))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ereal (infsum f A) = ereal (Sup (sum f ` {F. finite F \<and> F \<subseteq> A}))

goal (1 subgoal):
 1. infsum f A = Sup (sum f ` {F. finite F \<and> F \<subseteq> A})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
infsum f A = Sup (sum f ` {F. finite F \<and> F \<subseteq> A})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hyperpow_zero_HNatInfinite [simp]: "N \<in> HNatInfinite \<Longrightarrow> (0::hypreal) pow N = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<in> HNatInfinite \<Longrightarrow> 0 pow N = 0
[PROOF STEP]
by (drule HNatInfinite_is_Suc, auto)


[STATEMENT]
lemma rank_bound:
  fixes A :: "real^'n^'m"
  shows "rank A \<le> min CARD('m) (CARD('n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A \<le> min CARD('m) CARD('n)
[PROOF STEP]
by (metis (mono_tags, lifting) dim_subset_UNIV_cart min.bounded_iff
      column_rank_def row_rank_def)


[STATEMENT]
lemma solves_odeD:
  assumes "(y solves_ode f) T X"
  shows solves_ode_vderivD: "(y has_vderiv_on (\<lambda>t. f t (y t))) T"
    and solves_ode_domainD: "\<And>t. t \<in> T \<Longrightarrow> y t \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y has_vderiv_on (\<lambda>t. f t (y t))) T &&& (\<And>t. t \<in> T \<Longrightarrow> y t \<in> X)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(y solves_ode f) T X

goal (1 subgoal):
 1. (y has_vderiv_on (\<lambda>t. f t (y t))) T &&& (\<And>t. t \<in> T \<Longrightarrow> y t \<in> X)
[PROOF STEP]
by (auto simp: solves_ode_def)


[STATEMENT]
lemma integrable_norm[simp, intro]:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes [measurable]: "integrable M f" shows "integrable M (\<lambda>x. norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. norm (f x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
integrable M f

goal (1 subgoal):
 1. integrable M (\<lambda>x. norm (f x))
[PROOF STEP]
by (rule integrable_bound) auto


[STATEMENT]
lemma einterpret_plus[simp]:
  shows "(einterpret (map (\<lambda>i. fa1 i + fa2 i) [0..<DIM('a)]) vs::'a) =
    einterpret (map fa1 [0..<DIM('a::executable_euclidean_space)]) vs + einterpret (map fa2 [0..<DIM('a)]) vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. einterpret (map (\<lambda>i. fa1 i + fa2 i) [0..<DIM('a)]) vs = einterpret (map fa1 [0..<DIM('a)]) vs + einterpret (map fa2 [0..<DIM('a)]) vs
[PROOF STEP]
by (auto intro!: euclidean_eqI[where 'a='a] simp: algebra_simps eucl_of_list_inner)


[STATEMENT]
theorem pr_gr_1: "c_is_sub_fun (pr_gr x) univ_for_pr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_is_sub_fun (pr_gr x) univ_for_pr
[PROOF STEP]
apply(induct x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c_is_sub_fun (pr_gr 0) univ_for_pr
 2. \<And>x. c_is_sub_fun (pr_gr x) univ_for_pr \<Longrightarrow> c_is_sub_fun (pr_gr (Suc x)) univ_for_pr
[PROOF STEP]
apply(simp add: pr_gr_at_0 c_is_sub_fun_def c_assoc_have_key_df)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. c_is_sub_fun (pr_gr x) univ_for_pr \<Longrightarrow> c_is_sub_fun (pr_gr (Suc x)) univ_for_pr
[PROOF STEP]
apply(simp add: pr_gr_at_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. c_is_sub_fun (pr_gr x) univ_for_pr \<Longrightarrow> c_is_sub_fun (g_step (pr_gr x) (c_fst x)) univ_for_pr
[PROOF STEP]
apply(simp add: g_step_lm_7)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma is_path2_remove_cycle:
  assumes "is_path2 (as @ a # bs @ a # cs)"
  shows "is_path2 (as @ a # cs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_path2 (as @ a # cs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_path2 (as @ a # cs)
[PROOF STEP]
have "weight (as @ a # bs @ a # cs) =
    weight (as @ [a]) + weight (a # bs @ [a]) + weight (a # cs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.weight (as @ a # bs @ a # cs) = local.weight (as @ [a]) + local.weight (a # bs @ [a]) + local.weight (a # cs)
[PROOF STEP]
by (metis Bellman_Ford.weight_append append_Cons append_assoc)
[PROOF STATE]
proof (state)
this:
local.weight (as @ a # bs @ a # cs) = local.weight (as @ [a]) + local.weight (a # bs @ [a]) + local.weight (a # cs)

goal (1 subgoal):
 1. is_path2 (as @ a # cs)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
is_path2 (as @ a # bs @ a # cs)
local.weight (as @ a # bs @ a # cs) = local.weight (as @ [a]) + local.weight (a # bs @ [a]) + local.weight (a # cs)
[PROOF STEP]
have "weight (as @ [a]) < \<infinity>" "weight (a # cs) < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
is_path2 (as @ a # bs @ a # cs)
local.weight (as @ a # bs @ a # cs) = local.weight (as @ [a]) + local.weight (a # bs @ [a]) + local.weight (a # cs)

goal (1 subgoal):
 1. local.weight (as @ [a]) < \<infinity> &&& local.weight (a # cs) < \<infinity>
[PROOF STEP]
unfolding is_path2_def
[PROOF STATE]
proof (prove)
using this:
local.weight (as @ a # bs @ a # cs) < \<infinity>
local.weight (as @ a # bs @ a # cs) = local.weight (as @ [a]) + local.weight (a # bs @ [a]) + local.weight (a # cs)

goal (1 subgoal):
 1. local.weight (as @ [a]) < \<infinity> &&& local.weight (a # cs) < \<infinity>
[PROOF STEP]
by (simp, metis Pinf_add_right antisym less_extended_simps(4) not_less add.commute)+
[PROOF STATE]
proof (state)
this:
local.weight (as @ [a]) < \<infinity>
local.weight (a # cs) < \<infinity>

goal (1 subgoal):
 1. is_path2 (as @ a # cs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
local.weight (as @ [a]) < \<infinity>
local.weight (a # cs) < \<infinity>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.weight (as @ [a]) < \<infinity>
local.weight (a # cs) < \<infinity>

goal (1 subgoal):
 1. is_path2 (as @ a # cs)
[PROOF STEP]
unfolding is_path2_def
[PROOF STATE]
proof (prove)
using this:
local.weight (as @ [a]) < \<infinity>
local.weight (a # cs) < \<infinity>

goal (1 subgoal):
 1. local.weight (as @ a # cs) < \<infinity>
[PROOF STEP]
by (subst weight_append) (rule add_lt_infI)
[PROOF STATE]
proof (state)
this:
is_path2 (as @ a # cs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<And>s. (\<forall>l. I (l(x:=Suc (l x))) s) = (\<forall>l. (\<exists>n. l x = Suc n) \<longrightarrow> I l s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. (\<forall>l. I (l(x := Suc (l x))) s) = (\<forall>l. (\<exists>n. l x = Suc n) \<longrightarrow> I l s)
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s l n. \<lbrakk>\<forall>l. I (l(x := Suc (l x))) s; l x = Suc n\<rbrakk> \<Longrightarrow> I l s
[PROOF STEP]
proof (goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s l n. \<lbrakk>\<forall>l. I (l(x := Suc (l x))) s; l x = Suc n\<rbrakk> \<Longrightarrow> I l s
[PROOF STEP]
case (1 s l n)
[PROOF STATE]
proof (state)
this:
\<forall>l. I (l(x := Suc (l x))) s
l x = Suc n

goal (1 subgoal):
 1. \<And>s l n. \<lbrakk>\<forall>l. I (l(x := Suc (l x))) s; l x = Suc n\<rbrakk> \<Longrightarrow> I l s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>l. I (l(x := Suc (l x))) s
l x = Suc n
[PROOF STEP]
have "\<And>l. I (l(x := Suc (l x))) s"
[PROOF STATE]
proof (prove)
using this:
\<forall>l. I (l(x := Suc (l x))) s
l x = Suc n

goal (1 subgoal):
 1. \<And>l. I (l(x := Suc (l x))) s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
I (?l(x := Suc (?l x))) s

goal (1 subgoal):
 1. \<And>s l n. \<lbrakk>\<forall>l. I (l(x := Suc (l x))) s; l x = Suc n\<rbrakk> \<Longrightarrow> I l s
[PROOF STEP]
from this[where l="l(x:=n)"]
[PROOF STATE]
proof (chain)
picking this:
I (l(x := n, x := Suc ((l(x := n)) x))) s
[PROOF STEP]
have "I ((l(x:=n))(x := Suc ((l(x:=n)) x))) s"
[PROOF STATE]
proof (prove)
using this:
I (l(x := n, x := Suc ((l(x := n)) x))) s

goal (1 subgoal):
 1. I (l(x := n, x := Suc ((l(x := n)) x))) s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
I (l(x := n, x := Suc ((l(x := n)) x))) s

goal (1 subgoal):
 1. \<And>s l n. \<lbrakk>\<forall>l. I (l(x := Suc (l x))) s; l x = Suc n\<rbrakk> \<Longrightarrow> I l s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
I (l(x := n, x := Suc ((l(x := n)) x))) s
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
I (l(x := n, x := Suc ((l(x := n)) x))) s

goal (1 subgoal):
 1. I l s
[PROOF STEP]
using 1(2)
[PROOF STATE]
proof (prove)
using this:
I (l(x := n, x := Suc ((l(x := n)) x))) s
l x = Suc n

goal (1 subgoal):
 1. I l s
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I (l(x := Suc n)) s; l x = Suc n\<rbrakk> \<Longrightarrow> I l s
[PROOF STEP]
by (metis fun_upd_triv)
[PROOF STATE]
proof (state)
this:
I l s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem terminatess_iff_not_inf:
  "\<Gamma>\<turnstile>cs,css\<Down>s = (\<not> inf \<Gamma> cs css s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile>cs,css \<Down> s = (\<not> AlternativeSmallStep.inf \<Gamma> cs css s)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Gamma>\<turnstile>cs,css \<Down> s \<Longrightarrow> \<not> AlternativeSmallStep.inf \<Gamma> cs css s
 2. \<not> AlternativeSmallStep.inf \<Gamma> cs css s \<Longrightarrow> \<Gamma>\<turnstile>cs,css \<Down> s
[PROOF STEP]
apply  (erule terminatess_impl_not_inf)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> AlternativeSmallStep.inf \<Gamma> cs css s \<Longrightarrow> \<Gamma>\<turnstile>cs,css \<Down> s
[PROOF STEP]
apply (erule not_inf_impl_terminatess)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma divides_primepow_nat:
  fixes p :: nat
  assumes p: "prime p"
  shows "d dvd p ^ k \<longleftrightarrow> (\<exists>i\<le>k. d = p ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (d dvd p ^ k) = (\<exists>i\<le>k. d = p ^ i)
[PROOF STEP]
using assms divides_primepow [of p d k]
[PROOF STATE]
proof (prove)
using this:
prime p
\<lbrakk>prime p; d dvd p ^ k; \<And>m. \<lbrakk>m \<le> k; normalize d = p ^ m\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (d dvd p ^ k) = (\<exists>i\<le>k. d = p ^ i)
[PROOF STEP]
by (auto intro: le_imp_power_dvd)


[STATEMENT]
lemma necessary_condition_one:
  shows "\<r> * (\<k> - 1) = \<Lambda> * (\<v> - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<r> * (\<k> - 1) = \<Lambda> * (\<v> - 1)
[PROOF STEP]
using necess_cond_1_rhs necess_cond_1_lhs design_points_nempty rep_number
[PROOF STATE]
proof (prove)
using this:
?x \<in> \<V> \<Longrightarrow> size {#p \<in># mset_set (\<V> - {?x}) \<times># filter_mset ((\<in>) ?x) \<B>. fst p \<in> snd p#} = \<Lambda> * (\<v> - 1)
?x \<in> \<V> \<Longrightarrow> size {#p \<in># mset_set (\<V> - {?x}) \<times># filter_mset ((\<in>) ?x) \<B>. fst p \<in> snd p#} = \<B> rep ?x * (\<k> - 1)
\<V> \<noteq> {}
?x \<in> \<V> \<Longrightarrow> \<B> rep ?x = \<r>

goal (1 subgoal):
 1. \<r> * (\<k> - 1) = \<Lambda> * (\<v> - 1)
[PROOF STEP]
by auto


[STATEMENT]
lemma homeomorphic_maps_eq:
     "\<lbrakk>homeomorphic_maps X Y f g;
       \<And>x. x \<in> topspace X \<Longrightarrow> f x = f' x; \<And>y. y \<in> topspace Y \<Longrightarrow> g y = g' y\<rbrakk>
      \<Longrightarrow> homeomorphic_maps X Y f' g'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>homeomorphic_maps X Y f g; \<And>x. x \<in> topspace X \<Longrightarrow> f x = f' x; \<And>y. y \<in> topspace Y \<Longrightarrow> g y = g' y\<rbrakk> \<Longrightarrow> homeomorphic_maps X Y f' g'
[PROOF STEP]
unfolding homeomorphic_maps_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X Y f \<and> continuous_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y); \<And>x. x \<in> topspace X \<Longrightarrow> f x = f' x; \<And>y. y \<in> topspace Y \<Longrightarrow> g y = g' y\<rbrakk> \<Longrightarrow> continuous_map X Y f' \<and> continuous_map Y X g' \<and> (\<forall>x\<in>topspace X. g' (f' x) = x) \<and> (\<forall>y\<in>topspace Y. f' (g' y) = y)
[PROOF STEP]
by (metis continuous_map_eq continuous_map_eq_image_closure_subset_gen image_subset_iff)


[STATEMENT]
lemma funpow_suffix: "(f ^^ Suc k) a = (f ^^ k) a \<Longrightarrow> ((f ^^ (j + k)) a, (f ^^ k) a) \<in> leq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ Suc k) a = (f ^^ k) a \<Longrightarrow> ((f ^^ (j + k)) a, (f ^^ k) a) \<in> leq
[PROOF STEP]
using funpow_Field_leq
[PROOF STATE]
proof (prove)
using this:
(f ^^ ?k) a \<in> Field leq

goal (1 subgoal):
 1. (f ^^ Suc k) a = (f ^^ k) a \<Longrightarrow> ((f ^^ (j + k)) a, (f ^^ k) a) \<in> leq
[PROOF STEP]
by (induct j) (simp_all del: funpow.simps add: funpow_Suc_right funpow_add leq_refl)


[STATEMENT]
lemma trancl_mono_proof[mono]:
  "(\<And>a b. x a b \<longrightarrow> y a b) \<Longrightarrow> tranclp x a b \<longrightarrow> tranclp y a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. x a b \<longrightarrow> y a b) \<Longrightarrow> x\<^sup>+\<^sup>+ a b \<longrightarrow> y\<^sup>+\<^sup>+ a b
[PROOF STEP]
apply (rule impI, rotate_tac, induct rule: tranclp.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>x a b; \<And>a b. x a b \<longrightarrow> y a b\<rbrakk> \<Longrightarrow> y\<^sup>+\<^sup>+ a b
 2. \<And>a b c. \<lbrakk>x\<^sup>+\<^sup>+ a b; (\<And>a b. x a b \<longrightarrow> y a b) \<Longrightarrow> y\<^sup>+\<^sup>+ a b; x b c; \<And>a b. x a b \<longrightarrow> y a b\<rbrakk> \<Longrightarrow> y\<^sup>+\<^sup>+ a c
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>x a b; \<And>a b. x a b \<longrightarrow> y a b\<rbrakk> \<Longrightarrow> y\<^sup>+\<^sup>+ a b
 2. \<And>a b c. \<lbrakk>x\<^sup>+\<^sup>+ a b; y\<^sup>+\<^sup>+ a b; x b c; \<And>a b. x a b \<longrightarrow> y a b\<rbrakk> \<Longrightarrow> y\<^sup>+\<^sup>+ a c
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>x\<^sup>+\<^sup>+ a b; y\<^sup>+\<^sup>+ a b; x b c; \<And>a b. x a b \<longrightarrow> y a b\<rbrakk> \<Longrightarrow> y\<^sup>+\<^sup>+ a c
[PROOF STEP]
by fastforce


[STATEMENT]
lemma closed_segment_translation_zero: "z \<in> {z + a--z + b} \<longleftrightarrow> 0 \<in> {a -- b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<in> {z + a--z + b}) = ((0::'a) \<in> {a--b})
[PROOF STEP]
by (metis add.right_neutral closed_segment_translation_eq)


[STATEMENT]
lemma rot_diamond_eq_diamond_gen:
  assumes "0 \<le> x" "x \<le> 1" "0 \<le> y" "y \<le> 1"
  shows "rot_diamond_cube (x, y) = diamond_cube_gen (rot_x y x, rot_y y x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rot_diamond_cube (x, y) = diamond_cube_gen (rot_x y x, (y - 1 / 2) / (2 * diamond_y_gen (x_coord (rot_x y x))) + 1 / 2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fst (rot_diamond_cube (x, y)) = fst (diamond_cube_gen (rot_x y x, (y - 1 / 2) / (2 * diamond_y_gen (x_coord (rot_x y x))) + 1 / 2))
 2. snd (rot_diamond_cube (x, y)) = snd (diamond_cube_gen (rot_x y x, (y - 1 / 2) / (2 * diamond_y_gen (x_coord (rot_x y x))) + 1 / 2))
[PROOF STEP]
show "fst (rot_diamond_cube (x, y)) = fst (diamond_cube_gen (rot_x y x, rot_y y x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (rot_diamond_cube (x, y)) = fst (diamond_cube_gen (rot_x y x, (y - 1 / 2) / (2 * diamond_y_gen (x_coord (rot_x y x))) + 1 / 2))
[PROOF STEP]
apply(simp only: rot_diamond_cube_def diamond_eq_characterisations_fun)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ((prod.swap \<circ> diamond_cube_gen \<circ> prod.swap) (x, y)) = fst (diamond_cube_gen (rot_x y x, (y - 1 / 2) / (2 * diamond_y_gen (x_coord (rot_x y x))) + 1 / 2))
[PROOF STEP]
by(auto simp add:  diamond_cube_gen_def x_coord_def diamond_y_gen_def algebra_simps divide_simps)
[PROOF STATE]
proof (state)
this:
fst (rot_diamond_cube (x, y)) = fst (diamond_cube_gen (rot_x y x, (y - 1 / 2) / (2 * diamond_y_gen (x_coord (rot_x y x))) + 1 / 2))

goal (1 subgoal):
 1. snd (rot_diamond_cube (x, y)) = snd (diamond_cube_gen (rot_x y x, (y - 1 / 2) / (2 * diamond_y_gen (x_coord (rot_x y x))) + 1 / 2))
[PROOF STEP]
show "snd (rot_diamond_cube (x, y)) = snd (diamond_cube_gen (rot_x y x, rot_y y x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (rot_diamond_cube (x, y)) = snd (diamond_cube_gen (rot_x y x, (y - 1 / 2) / (2 * diamond_y_gen (x_coord (rot_x y x))) + 1 / 2))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. snd (rot_diamond_cube (x, y)) = snd (diamond_cube_gen (rot_x y x, (y - 1 / 2) / (2 * diamond_y_gen (x_coord (rot_x y x))) + 1 / 2))
[PROOF STEP]
apply(auto simp add: diamond_cube_gen_def rot_diamond_cube_def diamond_eq_characterisations_fun)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>0 \<le> x; x \<le> 1; 0 \<le> y; y * 2 \<le> 1; diamond_y_gen (x_coord ((2 * x - 1) * y + 1 / 2)) = 0; x_coord y \<noteq> 0\<rbrakk> \<Longrightarrow> d = 0
 2. \<lbrakk>0 \<le> x; x \<le> 1; 0 \<le> y; y * 2 \<le> 1; diamond_y_gen (x_coord ((2 * x - 1) * y + 1 / 2)) \<noteq> 0; x_coord y * 2 \<noteq> 2 * y - 1\<rbrakk> \<Longrightarrow> d = 0
 3. \<lbrakk>0 \<le> x; x \<le> 1; y \<le> 1; \<not> y * 2 \<le> 1; diamond_y_gen (x_coord (2 * x - 2 * y * x + y - 1 / 2)) = 0; x_coord y \<noteq> 0\<rbrakk> \<Longrightarrow> d = 0
 4. \<lbrakk>0 \<le> x; x \<le> 1; y \<le> 1; \<not> y * 2 \<le> 1; diamond_y_gen (x_coord (2 * x - 2 * y * x + y - 1 / 2)) \<noteq> 0; x_coord y * 2 \<noteq> 2 * y - 1\<rbrakk> \<Longrightarrow> d = 0
[PROOF STEP]
apply(auto simp add: x_coord_def diamond_y_gen_def algebra_simps divide_simps abs_if split: if_split_asm)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>y * 2 \<noteq> 1; 0 \<le> x; x \<le> 1; 0 \<le> y; y * 2 \<le> 1; 4 + x * (y * 16) = y * 8\<rbrakk> \<Longrightarrow> d = 0
 2. \<lbrakk>y * 2 \<noteq> 1; 0 \<le> x; x \<le> 1; 0 \<le> y; y * 2 \<le> 1; x * (y * 16) = 4 + y * 8\<rbrakk> \<Longrightarrow> d = 0
 3. \<lbrakk>0 \<le> x; x \<le> 1; y \<le> 1; \<not> y * 2 \<le> 1; y * 8 + x * 16 = 4 + x * (y * 16)\<rbrakk> \<Longrightarrow> d = 0
 4. \<lbrakk>0 \<le> x; x \<le> 1; y \<le> 1; \<not> y * 2 \<le> 1; y * 8 + x * 16 = 12 + x * (y * 16)\<rbrakk> \<Longrightarrow> d = 0
[PROOF STEP]
apply sos+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
snd (rot_diamond_cube (x, y)) = snd (diamond_cube_gen (rot_x y x, (y - 1 / 2) / (2 * diamond_y_gen (x_coord (rot_x y x))) + 1 / 2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_of_list_coeffs_nth':
assumes i: "i \<in> {..degree h}" and h_not0: "h \<noteq> 0"
assumes "degree h < degree u"
shows "vec_of_list ((coeffs h) @ replicate (degree u - length (coeffs h)) 0) $ i = coeff h i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_list (coeffs h @ replicate (degree u - length (coeffs h)) (0::'b)) $ i = coeff h i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i \<in> {..degree h}
h \<noteq> 0
degree h < degree u

goal (1 subgoal):
 1. vec_of_list (coeffs h @ replicate (degree u - length (coeffs h)) (0::'b)) $ i = coeff h i
[PROOF STEP]
by (transfer', auto simp add: mk_vec_def coeffs_nth length_coeffs_degree nth_append)


[STATEMENT]
lemma Lim_dist_ubound:
  assumes "\<not>(trivial_limit net)"
    and "(f \<longlongrightarrow> l) net"
    and "eventually (\<lambda>x. dist a (f x) \<le> e) net"
  shows "dist a l \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist a l \<le> e
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
net \<noteq> bot
(f \<longlongrightarrow> l) net
\<forall>\<^sub>F x in net. dist a (f x) \<le> e

goal (1 subgoal):
 1. dist a l \<le> e
[PROOF STEP]
by (fast intro: tendsto_le tendsto_intros)


[STATEMENT]
lemma bind_cong_All:
  assumes "\<forall>x \<in> space M. f x = g x"
  shows "bind M f = bind M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<bind> f = M \<bind> g
[PROOF STEP]
proof (cases "space M = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. space M = {} \<Longrightarrow> M \<bind> f = M \<bind> g
 2. space M \<noteq> {} \<Longrightarrow> M \<bind> f = M \<bind> g
[PROOF STEP]
assume "space M \<noteq> {}"
[PROOF STATE]
proof (state)
this:
space M \<noteq> {}

goal (2 subgoals):
 1. space M = {} \<Longrightarrow> M \<bind> f = M \<bind> g
 2. space M \<noteq> {} \<Longrightarrow> M \<bind> f = M \<bind> g
[PROOF STEP]
hence "(SOME x. x \<in> space M) \<in> space M"
[PROOF STATE]
proof (prove)
using this:
space M \<noteq> {}

goal (1 subgoal):
 1. (SOME x. x \<in> space M) \<in> space M
[PROOF STEP]
by (rule_tac someI_ex) blast
[PROOF STATE]
proof (state)
this:
(SOME x. x \<in> space M) \<in> space M

goal (2 subgoals):
 1. space M = {} \<Longrightarrow> M \<bind> f = M \<bind> g
 2. space M \<noteq> {} \<Longrightarrow> M \<bind> f = M \<bind> g
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>space M. f x = g x
(SOME x. x \<in> space M) \<in> space M
[PROOF STEP]
have "f (SOME x. x \<in> space M) = g (SOME x. x \<in> space M)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>space M. f x = g x
(SOME x. x \<in> space M) \<in> space M

goal (1 subgoal):
 1. f (SOME x. x \<in> space M) = g (SOME x. x \<in> space M)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f (SOME x. x \<in> space M) = g (SOME x. x \<in> space M)

goal (2 subgoals):
 1. space M = {} \<Longrightarrow> M \<bind> f = M \<bind> g
 2. space M \<noteq> {} \<Longrightarrow> M \<bind> f = M \<bind> g
[PROOF STEP]
with \<open>space M \<noteq> {}\<close> and assms
[PROOF STATE]
proof (chain)
picking this:
space M \<noteq> {}
\<forall>x\<in>space M. f x = g x
f (SOME x. x \<in> space M) = g (SOME x. x \<in> space M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
space M \<noteq> {}
\<forall>x\<in>space M. f x = g x
f (SOME x. x \<in> space M) = g (SOME x. x \<in> space M)

goal (1 subgoal):
 1. M \<bind> f = M \<bind> g
[PROOF STEP]
by (simp add: bind_nonempty cong: distr_cong)
[PROOF STATE]
proof (state)
this:
M \<bind> f = M \<bind> g

goal (1 subgoal):
 1. space M = {} \<Longrightarrow> M \<bind> f = M \<bind> g
[PROOF STEP]
qed (simp add: bind_empty)


[STATEMENT]
lemma prod_monom_1_1:
  defines "P == (\<lambda> x n. (x[^]\<^bsub>(R)\<^esub> (CARD('a) ^ n) = x))"
  assumes m: "monom 1 1 \<in> carrier R"
  and eq: "P (monom 1 1) n"
  shows "P ((\<Prod>i = 0..<b::nat. monom 1 1) mod f) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P ((\<Prod>i = 0..<b. monom 1 1) mod f) n
[PROOF STEP]
proof (induct b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. P ((\<Prod>i = 0..<0. monom 1 1) mod f) n
 2. \<And>b. P ((\<Prod>i = 0..<b. monom 1 1) mod f) n \<Longrightarrow> P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. P ((\<Prod>i = 0..<0. monom 1 1) mod f) n
 2. \<And>b. P ((\<Prod>i = 0..<b. monom 1 1) mod f) n \<Longrightarrow> P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P ((\<Prod>i = 0..<0. monom 1 1) mod f) n
[PROOF STEP]
unfolding P_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Prod>i = 0..<0. monom 1 1) mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = (\<Prod>i = 0..<0. monom 1 1) mod f
[PROOF STEP]
by (simp add: power_mod)
[PROOF STATE]
proof (state)
this:
P ((\<Prod>i = 0..<0. monom 1 1) mod f) n

goal (1 subgoal):
 1. \<And>b. P ((\<Prod>i = 0..<b. monom 1 1) mod f) n \<Longrightarrow> P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. P ((\<Prod>i = 0..<b. monom 1 1) mod f) n \<Longrightarrow> P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n
[PROOF STEP]
case (Suc b)
[PROOF STATE]
proof (state)
this:
P ((\<Prod>i = 0..<b. monom 1 1) mod f) n

goal (1 subgoal):
 1. \<And>b. P ((\<Prod>i = 0..<b. monom 1 1) mod f) n \<Longrightarrow> P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n
[PROOF STEP]
let ?N = "(\<Prod>i = 0..<b. monom 1 1)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. P ((\<Prod>i = 0..<b. monom 1 1) mod f) n \<Longrightarrow> P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n
[PROOF STEP]
have eq2: "(\<Prod>i = 0..<Suc b. monom 1 1) mod f = monom 1 1 \<otimes>\<^bsub>(R)\<^esub> (\<Prod>i = 0..<b. monom 1 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<Suc b. monom 1 1) mod f = monom 1 1 \<otimes>\<^bsub>R\<^esub> (\<Prod>i = 0..<b. monom 1 1)
[PROOF STEP]
by (metis field_R.m_comm field_R.nat_pow_Suc mod_in_carrier mod_mod_trivial
        pow_irr prod_pow times_mod_expand)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<Suc b. monom 1 1) mod f = monom 1 1 \<otimes>\<^bsub>R\<^esub> (\<Prod>i = 0..<b. monom 1 1)

goal (1 subgoal):
 1. \<And>b. P ((\<Prod>i = 0..<b. monom 1 1) mod f) n \<Longrightarrow> P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<Suc b. monom 1 1) mod f = monom 1 1 \<otimes>\<^bsub>R\<^esub> (\<Prod>i = 0..<b. monom 1 1)

goal (1 subgoal):
 1. \<And>b. P ((\<Prod>i = 0..<b. monom 1 1) mod f) n \<Longrightarrow> P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n
[PROOF STEP]
have "... = (monom 1 1 mod f) \<otimes>\<^bsub>(R)\<^esub> ((\<Prod>i = 0..<b. monom 1 1) mod f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom 1 1 \<otimes>\<^bsub>R\<^esub> (\<Prod>i = 0..<b. monom 1 1) = monom 1 1 mod f \<otimes>\<^bsub>R\<^esub> ((\<Prod>i = 0..<b. monom 1 1) mod f)
[PROOF STEP]
by (rule times_mod_expand)
[PROOF STATE]
proof (state)
this:
monom 1 1 \<otimes>\<^bsub>R\<^esub> (\<Prod>i = 0..<b. monom 1 1) = monom 1 1 mod f \<otimes>\<^bsub>R\<^esub> ((\<Prod>i = 0..<b. monom 1 1) mod f)

goal (1 subgoal):
 1. \<And>b. P ((\<Prod>i = 0..<b. monom 1 1) mod f) n \<Longrightarrow> P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>i = 0..<Suc b. monom 1 1) mod f = monom 1 1 mod f \<otimes>\<^bsub>R\<^esub> ((\<Prod>i = 0..<b. monom 1 1) mod f)
[PROOF STEP]
have eq2: "(\<Prod>i = 0..<Suc b. monom 1 1) mod f
    = (monom 1 1 mod f) \<otimes>\<^bsub>(R)\<^esub> ((\<Prod>i = 0..<b. monom 1 1) mod f)"
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i = 0..<Suc b. monom 1 1) mod f = monom 1 1 mod f \<otimes>\<^bsub>R\<^esub> ((\<Prod>i = 0..<b. monom 1 1) mod f)

goal (1 subgoal):
 1. (\<Prod>i = 0..<Suc b. monom 1 1) mod f = monom 1 1 mod f \<otimes>\<^bsub>R\<^esub> ((\<Prod>i = 0..<b. monom 1 1) mod f)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<Suc b. monom 1 1) mod f = monom 1 1 mod f \<otimes>\<^bsub>R\<^esub> ((\<Prod>i = 0..<b. monom 1 1) mod f)

goal (1 subgoal):
 1. \<And>b. P ((\<Prod>i = 0..<b. monom 1 1) mod f) n \<Longrightarrow> P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n
[PROOF STEP]
unfolding eq2 P_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (monom 1 1 mod f \<otimes>\<^bsub>R\<^esub> ((\<Prod>i = 0..<b. monom 1 1) mod f)) [^]\<^bsub>R\<^esub> CARD('a) ^ n = monom 1 1 mod f \<otimes>\<^bsub>R\<^esub> ((\<Prod>i = 0..<b. monom 1 1) mod f)
[PROOF STEP]
proof (rule mult_closed_power)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. monom 1 1 mod f \<in> carrier R
 2. (\<Prod>i = 0..<b. monom 1 1) mod f \<in> carrier R
 3. (monom 1 1 mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = monom 1 1 mod f
 4. ((\<Prod>i = 0..<b. monom 1 1) mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = (\<Prod>i = 0..<b. monom 1 1) mod f
[PROOF STEP]
show "(monom 1 1 mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = monom 1 1 mod f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (monom 1 1 mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = monom 1 1 mod f
[PROOF STEP]
using P_def element_in_carrier eq m mod_poly_less
[PROOF STATE]
proof (prove)
using this:
P \<equiv> \<lambda>x n. x [^]\<^bsub>R\<^esub> CARD('a) ^ n = x
(?a \<in> carrier R) = (degree ?a < degree f)
P (monom 1 1) n
monom 1 1 \<in> carrier R
degree ?x < degree ?y \<Longrightarrow> ?x mod ?y = ?x

goal (1 subgoal):
 1. (monom 1 1 mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = monom 1 1 mod f
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(monom 1 1 mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = monom 1 1 mod f

goal (3 subgoals):
 1. monom 1 1 mod f \<in> carrier R
 2. (\<Prod>i = 0..<b. monom 1 1) mod f \<in> carrier R
 3. ((\<Prod>i = 0..<b. monom 1 1) mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = (\<Prod>i = 0..<b. monom 1 1) mod f
[PROOF STEP]
show "((\<Prod>i = 0..<b. monom 1 1) mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = (\<Prod>i = 0..<b. monom 1 1) mod f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Prod>i = 0..<b. monom 1 1) mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = (\<Prod>i = 0..<b. monom 1 1) mod f
[PROOF STEP]
using P_def Suc.hyps
[PROOF STATE]
proof (prove)
using this:
P \<equiv> \<lambda>x n. x [^]\<^bsub>R\<^esub> CARD('a) ^ n = x
P ((\<Prod>i = 0..<b. monom 1 1) mod f) n

goal (1 subgoal):
 1. ((\<Prod>i = 0..<b. monom 1 1) mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = (\<Prod>i = 0..<b. monom 1 1) mod f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
((\<Prod>i = 0..<b. monom 1 1) mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ n = (\<Prod>i = 0..<b. monom 1 1) mod f

goal (2 subgoals):
 1. monom 1 1 mod f \<in> carrier R
 2. (\<Prod>i = 0..<b. monom 1 1) mod f \<in> carrier R
[PROOF STEP]
qed (auto)
[PROOF STATE]
proof (state)
this:
P ((\<Prod>i = 0..<Suc b. monom 1 1) mod f) n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma val_ring_constant_ac_sets_are_univ_semialgebraic:
  assumes "n > 0"
  shows "are_univ_semialgebraic (val_ring_constant_ac_sets n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. are_univ_semialgebraic (val_ring_constant_ac_sets n)
[PROOF STEP]
proof(rule are_univ_semialgebraicI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> val_ring_constant_ac_sets n \<Longrightarrow> is_univ_semialgebraic x
[PROOF STEP]
have 0: "\<not> coprime 0 p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> coprime 0 p
[PROOF STEP]
using coprime_0_right_iff[of p] coprime_commute[of p 0] coprime_int_iff[of "nat p" 0]
        nat_dvd_1_iff_1 prime_gt_1_nat zdvd1_eq
[PROOF STATE]
proof (prove)
using this:
coprime p 0 = is_unit p
coprime p 0 = coprime 0 p
coprime (int (nat p)) (int 0) = coprime (nat p) 0
is_unit ?m = (?m = 1)
normalization_semidom_class.prime ?p \<Longrightarrow> 1 < ?p
is_unit ?x = (\<bar>?x\<bar> = 1)

goal (1 subgoal):
 1. \<not> coprime 0 p
[PROOF STEP]
by (metis not_prime_unit prime)
[PROOF STATE]
proof (state)
this:
\<not> coprime 0 p

goal (1 subgoal):
 1. \<And>x. x \<in> val_ring_constant_ac_sets n \<Longrightarrow> is_univ_semialgebraic x
[PROOF STEP]
have "(0::int) \<notin>(Units (Zp_res_ring n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> Units (residue_ring (p ^ n))
[PROOF STEP]
apply(rule ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 0 \<notin> Units (residue_ring (p ^ n)) \<Longrightarrow> False
[PROOF STEP]
using 0 assms residues.cring[of "p ^ n"]
[PROOF STATE]
proof (prove)
using this:
\<not> coprime 0 p
0 < n
residues (p ^ n) \<Longrightarrow> cring (residue_ring (p ^ n))

goal (1 subgoal):
 1. \<not> 0 \<notin> Units (residue_ring (p ^ n)) \<Longrightarrow> False
[PROOF STEP]
unfolding residues_def
[PROOF STATE]
proof (prove)
using this:
\<not> coprime 0 p
0 < n
1 < p ^ n \<Longrightarrow> cring (residue_ring (p ^ n))

goal (1 subgoal):
 1. \<not> 0 \<notin> Units (residue_ring (p ^ n)) \<Longrightarrow> False
[PROOF STEP]
by (smt less_one not_gr_zero power_le_imp_le_exp power_less_imp_less_exp residue_UnitsE)
[PROOF STATE]
proof (state)
this:
0 \<notin> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. \<And>x. x \<in> val_ring_constant_ac_sets n \<Longrightarrow> is_univ_semialgebraic x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> val_ring_constant_ac_sets n \<Longrightarrow> is_univ_semialgebraic x
[PROOF STEP]
assume A: "x \<in> val_ring_constant_ac_sets n"
[PROOF STATE]
proof (state)
this:
x \<in> val_ring_constant_ac_sets n

goal (1 subgoal):
 1. \<And>x. x \<in> val_ring_constant_ac_sets n \<Longrightarrow> is_univ_semialgebraic x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> val_ring_constant_ac_sets n
[PROOF STEP]
obtain k where k_def: "x = val_ring_constant_ac_set n k \<and> k \<in> Units (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
using this:
x \<in> val_ring_constant_ac_sets n

goal (1 subgoal):
 1. (\<And>k. x = val_ring_constant_ac_set n k \<and> k \<in> Units (residue_ring (p ^ n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis image_iff val_ring_constant_ac_sets_def)
[PROOF STATE]
proof (state)
this:
x = val_ring_constant_ac_set n k \<and> k \<in> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. \<And>x. x \<in> val_ring_constant_ac_sets n \<Longrightarrow> is_univ_semialgebraic x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = val_ring_constant_ac_set n k \<and> k \<in> Units (residue_ring (p ^ n))
[PROOF STEP]
show "is_univ_semialgebraic x"
[PROOF STATE]
proof (prove)
using this:
x = val_ring_constant_ac_set n k \<and> k \<in> Units (residue_ring (p ^ n))

goal (1 subgoal):
 1. is_univ_semialgebraic x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x = val_ring_constant_ac_set n k \<and> k \<in> Units (residue_ring (p ^ n))
0 < n

goal (1 subgoal):
 1. is_univ_semialgebraic x
[PROOF STEP]
by (metis \<open>0 \<notin> Units (Zp_res_ring n)\<close> val_ring_constant_ac_set_is_univ_semialgebraic)
[PROOF STATE]
proof (state)
this:
is_univ_semialgebraic x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem gt_wf: "wfP (\<lambda>s t. t >\<^sub>t s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wfP (\<lambda>s t. t >\<^sub>t s)
[PROOF STEP]
unfolding basic_gt_iff_gt[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wfP (\<lambda>s t. local.kbo_std.gt t s)
[PROOF STEP]
by (rule kbo_std.gt_wf[simplified])


[STATEMENT]
lemma scalar_prod: "scalar_prod v1 v2 = sum_list (map (\<lambda>(x,y). x * y) (zip v1 v2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scalar_prod v1 v2 = sum_list (map2 (*) v1 v2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. scalar_prod v1 v2 = sum_list (map2 (*) v1 v2)
[PROOF STEP]
obtain z where z: "zip v1 v2 = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. zip v1 v2 = z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
zip v1 v2 = z

goal (1 subgoal):
 1. scalar_prod v1 v2 = sum_list (map2 (*) v1 v2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scalar_prod v1 v2 = sum_list (map2 (*) v1 v2)
[PROOF STEP]
unfolding scalar_prodI_def z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (\<lambda>(x, y). (+) (x * y)) z (0::'a) = (\<Sum>(x, y)\<leftarrow>z. x * y)
[PROOF STEP]
by (induct z, auto)
[PROOF STATE]
proof (state)
this:
scalar_prod v1 v2 = sum_list (map2 (*) v1 v2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mau_inverse: "inverse (real_of_u r) = real_of_u (mau_inverse r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (real_of_u r) = real_of_u (mau_inverse r)
[PROOF STEP]
using ma_inverse
[PROOF STATE]
proof (prove)
using this:
inverse (real_of ?r) = real_of (ma_inverse ?r)

goal (1 subgoal):
 1. inverse (real_of_u r) = real_of_u (mau_inverse r)
[PROOF STEP]
by (transfer, auto)


[STATEMENT]
lemma integrable_component:
  "f integrable_on A \<Longrightarrow> (\<lambda>x. f x \<bullet> (y :: 'b :: euclidean_space)) integrable_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f integrable_on A \<Longrightarrow> (\<lambda>x. f x \<bullet> y) integrable_on A
[PROOF STEP]
by (drule integrable_linear[OF _ bounded_linear_inner_left[of y]]) (simp add: o_def)


[STATEMENT]
lemma fprodrg_ring:"\<forall>k \<le> n. Ring (B k) \<Longrightarrow> Ring (fprodrg n B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k\<le>n. Ring (B k) \<Longrightarrow> Ring (fprodrg n B)
[PROOF STEP]
apply (simp add:fprodrg_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k\<le>n. Ring (B k) \<Longrightarrow> Ring \<lparr>carrier = ac_fProd_Rg n B, pop = prod_pOp {i. i \<le> n} B, mop = prod_mOp {i. i \<le> n} B, zero = prod_zero {i. i \<le> n} B, tp = prod_tOp {i. i \<le> n} B, un = prod_one {i. i \<le> n} B\<rparr>
[PROOF STEP]
apply (frule ac_fProd_Prod)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>k\<le>n. Ring (B k); ac_fProd_Rg n B = carr_prodag {j. j \<le> n} B\<rbrakk> \<Longrightarrow> Ring \<lparr>carrier = ac_fProd_Rg n B, pop = prod_pOp {i. i \<le> n} B, mop = prod_mOp {i. i \<le> n} B, zero = prod_zero {i. i \<le> n} B, tp = prod_tOp {i. i \<le> n} B, un = prod_one {i. i \<le> n} B\<rparr>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>k\<le>n. Ring (B k); ac_fProd_Rg n B = carr_prodag {j. j \<le> n} B\<rbrakk> \<Longrightarrow> Ring \<lparr>carrier = carr_prodag {j. j \<le> n} B, pop = prod_pOp {i. i \<le> n} B, mop = prod_mOp {i. i \<le> n} B, zero = prod_zero {i. i \<le> n} B, tp = prod_tOp {i. i \<le> n} B, un = prod_one {i. i \<le> n} B\<rparr>
[PROOF STEP]
apply (fold prodrg_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>k\<le>n. Ring (B k); ac_fProd_Rg n B = carr_prodag {j. j \<le> n} B\<rbrakk> \<Longrightarrow> Ring (r\<Pi>\<^bsub>{j. j \<le> n}\<^esub> B)
[PROOF STEP]
apply (simp add:prodrg_ring)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prime_int_altdef:
  "prime p = (1 < p \<and> (\<forall>m::int. m \<ge> 0 \<longrightarrow> m dvd p \<longrightarrow>
    m = 1 \<or> m = p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime p = (1 < p \<and> (\<forall>m\<ge>0. m dvd p \<longrightarrow> m = 1 \<or> m = p))
[PROOF STEP]
unfolding prime_int_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 < p \<and> (\<forall>m. 0 \<le> m \<and> m dvd p \<longrightarrow> m = 1 \<or> m = p)) = (1 < p \<and> (\<forall>m\<ge>0. m dvd p \<longrightarrow> m = 1 \<or> m = p))
[PROOF STEP]
by blast


[STATEMENT]
lemma row_add[simp]:
  "A \<in> carrier_mat nr nc \<Longrightarrow> B \<in> carrier_mat nr nc \<Longrightarrow> i < nr
  \<Longrightarrow> row (A + B) i = row A i + row B i"
  "i < dim_row A \<Longrightarrow> dim_row B = dim_row A \<Longrightarrow> dim_col B = dim_col A \<Longrightarrow> row (A + B) i = row A i + row B i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>A \<in> carrier_mat nr nc; B \<in> carrier_mat nr nc; i < nr\<rbrakk> \<Longrightarrow> row (A + B) i = row A i + row B i) &&& (\<lbrakk>i < dim_row A; dim_row B = dim_row A; dim_col B = dim_col A\<rbrakk> \<Longrightarrow> row (A + B) i = row A i + row B i)
[PROOF STEP]
by (rule eq_vecI, auto)


[STATEMENT]
lemma locally_compact_closedin_open:
    fixes S :: "'a :: metric_space set"
    assumes "locally compact S"
    obtains T where "open T" "closedin (top_of_set T) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>T. \<lbrakk>open T; closedin (top_of_set T) S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis locally_compact_open_Int_closure [OF assms] closed_closure closedin_closed_Int)


[STATEMENT]
lemma sum_mult_scalar_distrib_left: "r \<odot> (sum f A) = (\<Sum>a\<in>A. r \<odot> f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<odot> sum f A = (\<Sum>a\<in>A. r \<odot> f a)
[PROOF STEP]
by (induct A rule: infinite_finite_induct, simp_all add: algebra_simps)


[STATEMENT]
lemma inv\<^sub>2E:
  assumes "inv\<^sub>2 T A j"
  shows "lb T A j" "j \<le> n"
        "lb T' A' j \<Longrightarrow> makespan T \<le> 3 / 2 * makespan T'"
        "\<forall>x > j. T x = 0" "j \<le> m \<Longrightarrow> makespan T = Max\<^sub>0 (t ` {1..j})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lb T A j &&& j \<le> n) &&& (lb T' A' j \<Longrightarrow> real (makespan T) \<le> 3 / 2 * real (makespan T')) &&& \<forall>x>j. T x = 0 &&& (j \<le> m \<Longrightarrow> makespan T = Max\<^sub>0 (t ` {1..j}))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inv\<^sub>2 T A j

goal (1 subgoal):
 1. (lb T A j &&& j \<le> n) &&& (lb T' A' j \<Longrightarrow> real (makespan T) \<le> 3 / 2 * real (makespan T')) &&& \<forall>x>j. T x = 0 &&& (j \<le> m \<Longrightarrow> makespan T = Max\<^sub>0 (t ` {1..j}))
[PROOF STEP]
unfolding inv\<^sub>2_def
[PROOF STATE]
proof (prove)
using this:
lb T A j \<and> j \<le> n \<and> (\<forall>T' A'. lb T' A' j \<longrightarrow> real (makespan T) \<le> 3 / 2 * real (makespan T')) \<and> (\<forall>x>j. T x = 0) \<and> (j \<le> m \<longrightarrow> makespan T = Max\<^sub>0 (t ` {1..j}))

goal (1 subgoal):
 1. (lb T A j &&& j \<le> n) &&& (lb T' A' j \<Longrightarrow> real (makespan T) \<le> 3 / 2 * real (makespan T')) &&& \<forall>x>j. T x = 0 &&& (j \<le> m \<Longrightarrow> makespan T = Max\<^sub>0 (t ` {1..j}))
[PROOF STEP]
by blast+


[STATEMENT]
lemma evnodd_Un: "evnodd (A \<union> B) b = evnodd A b \<union> evnodd B b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. evnodd (A \<union> B) b = evnodd A b \<union> evnodd B b
[PROOF STEP]
unfolding evnodd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<union> B) \<inter> {(i, j). (i + j) mod 2 = b} = A \<inter> {(i, j). (i + j) mod 2 = b} \<union> B \<inter> {(i, j). (i + j) mod 2 = b}
[PROOF STEP]
by blast


[STATEMENT]
lemma eSuc_Max:
  assumes "finite A" "A \<noteq> ({}::eint set)"
  shows " (Max A) + 1 = Max ((+)1 ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max A + 1 = Max ((+) 1 ` A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
A \<noteq> {}

goal (1 subgoal):
 1. Max A + 1 = Max ((+) 1 ` A)
[PROOF STEP]
proof induction
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {} \<noteq> {} \<Longrightarrow> Max {} + 1 = Max ((+) 1 ` {})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<Longrightarrow> Max F + 1 = Max ((+) 1 ` F); insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> Max (insert x F) + 1 = Max ((+) 1 ` insert x F)
[PROOF STEP]
case (insert x A)
[PROOF STATE]
proof (state)
this:
finite A
x \<notin> A
A \<noteq> {} \<Longrightarrow> Max A + 1 = Max ((+) 1 ` A)
insert x A \<noteq> {}

goal (2 subgoals):
 1. {} \<noteq> {} \<Longrightarrow> Max {} + 1 = Max ((+) 1 ` {})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<Longrightarrow> Max F + 1 = Max ((+) 1 ` F); insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> Max (insert x F) + 1 = Max ((+) 1 ` insert x F)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
A \<noteq> {} \<Longrightarrow> Max A + 1 = Max ((+) 1 ` A)
insert x A \<noteq> {}

goal (1 subgoal):
 1. Max (insert x A) + 1 = Max ((+) 1 ` insert x A)
[PROOF STEP]
using Max_insert[of A x] Max_singleton[of x] add.commute[of 1] eSuc_max finite_imageI
          image_insert image_is_empty
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
A \<noteq> {} \<Longrightarrow> Max A + 1 = Max ((+) 1 ` A)
insert x A \<noteq> {}
\<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> Max (insert x A) = max x (Max A)
Max {x} = x
(1::?'a1) + ?b = ?b + (1::?'a1)
max ?x ?y + 1 = max (?x + 1) (?y + 1)
finite ?F \<Longrightarrow> finite (?h ` ?F)
?f ` insert ?a ?B = insert (?f ?a) (?f ` ?B)
(?f ` ?A = {}) = (?A = {})

goal (1 subgoal):
 1. Max (insert x A) + 1 = Max ((+) 1 ` insert x A)
[PROOF STEP]
by (simp add: add.commute hom_Max_commute)
[PROOF STATE]
proof (state)
this:
Max (insert x A) + 1 = Max ((+) 1 ` insert x A)

goal (1 subgoal):
 1. {} \<noteq> {} \<Longrightarrow> Max {} + 1 = Max ((+) 1 ` {})
[PROOF STEP]
qed simp


[STATEMENT]
lemma (in group) carrier_subgroup_generated_by_singleton:
  assumes "x \<in> carrier G"
  shows "carrier(subgroup_generated G {x}) = (range (\<lambda>n::int. x [^] n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (subgroup_generated G {x}) = range (([^]) x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. carrier (subgroup_generated G {x}) \<subseteq> range (([^]) x)
 2. range (([^]) x) \<subseteq> carrier (subgroup_generated G {x})
[PROOF STEP]
show "carrier (subgroup_generated G {x}) \<subseteq> range (\<lambda>n::int. x [^] n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (subgroup_generated G {x}) \<subseteq> range (([^]) x)
[PROOF STEP]
proof (rule subgroup_generated_minimal)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. subgroup (range (([^]) x)) G
 2. {x} \<subseteq> range (([^]) x)
[PROOF STEP]
show "subgroup (range (\<lambda>n::int. x [^] n)) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (range (([^]) x)) G
[PROOF STEP]
using assms subgroup_of_powers
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
?x \<in> carrier G \<Longrightarrow> subgroup (range (([^]) ?x)) G

goal (1 subgoal):
 1. subgroup (range (([^]) x)) G
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
subgroup (range (([^]) x)) G

goal (1 subgoal):
 1. {x} \<subseteq> range (([^]) x)
[PROOF STEP]
show "{x} \<subseteq> range (\<lambda>n::int. x [^] n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x} \<subseteq> range (([^]) x)
[PROOF STEP]
by clarify (metis assms int_pow_1 range_eqI)
[PROOF STATE]
proof (state)
this:
{x} \<subseteq> range (([^]) x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
carrier (subgroup_generated G {x}) \<subseteq> range (([^]) x)

goal (1 subgoal):
 1. range (([^]) x) \<subseteq> carrier (subgroup_generated G {x})
[PROOF STEP]
have x: "x \<in> carrier (subgroup_generated G {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier (subgroup_generated G {x})
[PROOF STEP]
using assms subgroup_generated_subset_carrier_subset
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
?S \<subseteq> carrier G \<Longrightarrow> ?S \<subseteq> carrier (subgroup_generated G ?S)

goal (1 subgoal):
 1. x \<in> carrier (subgroup_generated G {x})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier (subgroup_generated G {x})

goal (1 subgoal):
 1. range (([^]) x) \<subseteq> carrier (subgroup_generated G {x})
[PROOF STEP]
show "range (\<lambda>n::int. x [^] n) \<subseteq> carrier (subgroup_generated G {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range (([^]) x) \<subseteq> carrier (subgroup_generated G {x})
[PROOF STEP]
proof clarify
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa n. n \<in> UNIV \<Longrightarrow> x [^] n \<in> carrier (subgroup_generated G {x})
[PROOF STEP]
fix n :: "int"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa n. n \<in> UNIV \<Longrightarrow> x [^] n \<in> carrier (subgroup_generated G {x})
[PROOF STEP]
show "x [^] n \<in> carrier (subgroup_generated G {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^] n \<in> carrier (subgroup_generated G {x})
[PROOF STEP]
by (simp add: x subgroup_int_pow_closed subgroup_subgroup_generated)
[PROOF STATE]
proof (state)
this:
x [^] n \<in> carrier (subgroup_generated G {x})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
range (([^]) x) \<subseteq> carrier (subgroup_generated G {x})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_coordinatewise_iff:
  fixes f :: "('a \<Rightarrow> real) \<Rightarrow> 'b \<Rightarrow> real"
  shows "continuous_on (A \<inter> S) f \<longleftrightarrow> (\<forall>i. continuous_on (A \<inter> S) (\<lambda>x. f x i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (A \<inter> S) f = (\<forall>i. continuous_on (A \<inter> S) (\<lambda>x. f x i))
[PROOF STEP]
by (auto simp: continuous_on_product_then_coordinatewise continuous_on_coordinatewise_then_product)


[STATEMENT]
lemma bounded_sesquilinear_diff:
  \<open>bounded_sesquilinear (\<lambda> x y. A x y - B x y)\<close> if \<open>bounded_sesquilinear A\<close> and \<open>bounded_sesquilinear B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_sesquilinear (\<lambda>x y. A x y - B x y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded_sesquilinear (\<lambda>x y. A x y - B x y)
[PROOF STEP]
have \<open>bounded_sesquilinear (\<lambda> x y. - B x y)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_sesquilinear (\<lambda>x y. - B x y)
[PROOF STEP]
using that(2)
[PROOF STATE]
proof (prove)
using this:
bounded_sesquilinear B

goal (1 subgoal):
 1. bounded_sesquilinear (\<lambda>x y. - B x y)
[PROOF STEP]
by (rule bounded_sesquilinear_uminus)
[PROOF STATE]
proof (state)
this:
bounded_sesquilinear (\<lambda>x y. - B x y)

goal (1 subgoal):
 1. bounded_sesquilinear (\<lambda>x y. A x y - B x y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded_sesquilinear (\<lambda>x y. - B x y)
[PROOF STEP]
have \<open>bounded_sesquilinear (\<lambda> x y. A x y + (- B x y))\<close>
[PROOF STATE]
proof (prove)
using this:
bounded_sesquilinear (\<lambda>x y. - B x y)

goal (1 subgoal):
 1. bounded_sesquilinear (\<lambda>x y. A x y + - B x y)
[PROOF STEP]
using that(1)
[PROOF STATE]
proof (prove)
using this:
bounded_sesquilinear (\<lambda>x y. - B x y)
bounded_sesquilinear A

goal (1 subgoal):
 1. bounded_sesquilinear (\<lambda>x y. A x y + - B x y)
[PROOF STEP]
by (rule bounded_sesquilinear_add[rotated])
[PROOF STATE]
proof (state)
this:
bounded_sesquilinear (\<lambda>x y. A x y + - B x y)

goal (1 subgoal):
 1. bounded_sesquilinear (\<lambda>x y. A x y - B x y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded_sesquilinear (\<lambda>x y. A x y + - B x y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bounded_sesquilinear (\<lambda>x y. A x y + - B x y)

goal (1 subgoal):
 1. bounded_sesquilinear (\<lambda>x y. A x y - B x y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bounded_sesquilinear (\<lambda>x y. A x y - B x y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ran_map_upd_Some:
  "\<lbrakk> m x = Some y; inj_on m (dom m); z \<notin> ran m \<rbrakk> \<Longrightarrow> ran(m(x := Some z)) = ran m - {y} \<union> {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m x = Some y; inj_on m (dom m); z \<notin> ran m\<rbrakk> \<Longrightarrow> ran (m(x \<mapsto> z)) = ran m - {y} \<union> {z}
[PROOF STEP]
by(force simp add: ran_def domI inj_onD)


[STATEMENT]
lemma (in aGroup) ag_eq_sol1:"\<lbrakk>a \<in> carrier A; x\<in> carrier A; b\<in> carrier A;
                               a \<plusminus> x = b\<rbrakk> \<Longrightarrow> x = (-\<^sub>a a) \<plusminus> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; x \<in> carrier A; b \<in> carrier A; a \<plusminus> x = b\<rbrakk> \<Longrightarrow> x = -\<^sub>a a \<plusminus> b
[PROOF STEP]
apply (frule ag_mOp_closed[of "a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; x \<in> carrier A; b \<in> carrier A; a \<plusminus> x = b; -\<^sub>a a \<in> carrier A\<rbrakk> \<Longrightarrow> x = -\<^sub>a a \<plusminus> b
[PROOF STEP]
apply (frule aassoc[of "-\<^sub>a a" "a" "x"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; x \<in> carrier A; b \<in> carrier A; a \<plusminus> x = b; -\<^sub>a a \<in> carrier A; -\<^sub>a a \<plusminus> a \<plusminus> x = -\<^sub>a a \<plusminus> (a \<plusminus> x)\<rbrakk> \<Longrightarrow> x = -\<^sub>a a \<plusminus> b
[PROOF STEP]
apply (simp add:l_m l_zero)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma convergent_realpow: "0 \<le> x \<Longrightarrow> x \<le> 1 \<Longrightarrow> convergent (\<lambda>n. x ^ n)"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> convergent ((^) x)
[PROOF STEP]
by (blast intro!: Bseq_monoseq_convergent Bseq_realpow monoseq_realpow)