[STATEMENT]
lemma agtt_lang_GTT_trancl_eps_free_conv:
  assumes "is_gtt_eps_free \<G>"
  shows "agtt_lang (GTT_trancl_eps_free \<G>) = agtt_lang (GTT_trancl \<G>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. agtt_lang (GTT_trancl_eps_free \<G>) = agtt_lang (GTT_trancl \<G>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. agtt_lang (GTT_trancl_eps_free \<G>) = agtt_lang (GTT_trancl \<G>)
[PROOF STEP]
have "(eps (fst (GTT_trancl \<G>)))|\<^sup>+| = eps (fst (GTT_trancl \<G>))"
    "(eps (snd (GTT_trancl \<G>)))|\<^sup>+| = eps (snd (GTT_trancl \<G>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eps (fst (GTT_trancl \<G>)))|\<^sup>+| = eps (fst (GTT_trancl \<G>)) &&& (eps (snd (GTT_trancl \<G>)))|\<^sup>+| = eps (snd (GTT_trancl \<G>))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_gtt_eps_free \<G>

goal (1 subgoal):
 1. (eps (fst (GTT_trancl \<G>)))|\<^sup>+| = eps (fst (GTT_trancl \<G>)) &&& (eps (snd (GTT_trancl \<G>)))|\<^sup>+| = eps (snd (GTT_trancl \<G>))
[PROOF STEP]
by (auto simp: GTT_trancl_def Let_def is_gtt_eps_free_def \<Delta>_trancl_inv)
[PROOF STATE]
proof (state)
this:
(eps (fst (GTT_trancl \<G>)))|\<^sup>+| = eps (fst (GTT_trancl \<G>))
(eps (snd (GTT_trancl \<G>)))|\<^sup>+| = eps (snd (GTT_trancl \<G>))

goal (1 subgoal):
 1. agtt_lang (GTT_trancl_eps_free \<G>) = agtt_lang (GTT_trancl \<G>)
[PROOF STEP]
from ftrancl_eps_free_ta_derI[OF this(1)] ftrancl_eps_free_ta_derI[OF this(2)]
[PROOF STATE]
proof (chain)
picking this:
ta_der (ftrancl_eps_free_closures (fst (GTT_trancl \<G>))) (term_of_gterm ?t) = ta_der (fst (GTT_trancl \<G>)) (term_of_gterm ?t)
ta_der (ftrancl_eps_free_closures (snd (GTT_trancl \<G>))) (term_of_gterm ?t) = ta_der (snd (GTT_trancl \<G>)) (term_of_gterm ?t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ta_der (ftrancl_eps_free_closures (fst (GTT_trancl \<G>))) (term_of_gterm ?t) = ta_der (fst (GTT_trancl \<G>)) (term_of_gterm ?t)
ta_der (ftrancl_eps_free_closures (snd (GTT_trancl \<G>))) (term_of_gterm ?t) = ta_der (snd (GTT_trancl \<G>)) (term_of_gterm ?t)

goal (1 subgoal):
 1. agtt_lang (GTT_trancl_eps_free \<G>) = agtt_lang (GTT_trancl \<G>)
[PROOF STEP]
by (auto simp: case_prod_beta GTT_trancl_eps_free_def intro!: agtt_lang_derI)
[PROOF STATE]
proof (state)
this:
agtt_lang (GTT_trancl_eps_free \<G>) = agtt_lang (GTT_trancl \<G>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma openin_Int_open:
   "\<lbrakk>openin (top_of_set U) S; open T\<rbrakk>
        \<Longrightarrow> openin (top_of_set U) (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>openin (top_of_set U) S; open T\<rbrakk> \<Longrightarrow> openin (top_of_set U) (S \<inter> T)
[PROOF STEP]
by (metis open_Int Int_assoc openin_open)


[STATEMENT]
lemma euclidean_size_gcd_less2:
  assumes "b \<noteq> 0" and "\<not> b dvd a"
  shows "euclidean_size (gcd a b) < euclidean_size b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euclidean_size (gcd a b) < euclidean_size b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b \<noteq> (0::'a)
\<not> b dvd a

goal (1 subgoal):
 1. euclidean_size (gcd a b) < euclidean_size b
[PROOF STEP]
by (subst gcd.commute, rule euclidean_size_gcd_less1)


[STATEMENT]
lemma (in prob_space) variance_affine:
  fixes f::"real \<Rightarrow> real"
  assumes [arith]: "b \<noteq> 0"
  assumes D[intro]: "distributed M lborel X f"
  assumes [simp]: "prob_space (density lborel f)"
  assumes I[simp]: "integrable M X"
  assumes I2[simp]: "integrable M (\<lambda>x. (X x)\<^sup>2)"
  shows "variance (\<lambda>x. a + b * X x) = b\<^sup>2 * variance X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. (a + b * X x - expectation (\<lambda>x. a + b * X x))\<^sup>2) = b\<^sup>2 * expectation (\<lambda>x. (X x - expectation X)\<^sup>2)
[PROOF STEP]
by (subst variance_eq)
     (auto simp: power2_sum power_mult_distrib prob_space variance_eq right_diff_distrib)


[STATEMENT]
lemma partitioningIps_equi: "map wordinterval_to_set (partitioningIps ss ts)
       = (partitioning1 (map wordinterval_to_set ss) (map wordinterval_to_set ts))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map wordinterval_to_set (partitioningIps ss ts) = partitioning1 (map wordinterval_to_set ss) (map wordinterval_to_set ts)
[PROOF STEP]
apply(induction ss arbitrary: ts)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ts. map wordinterval_to_set (partitioningIps [] ts) = partitioning1 (map wordinterval_to_set []) (map wordinterval_to_set ts)
 2. \<And>a ss ts. (\<And>ts. map wordinterval_to_set (partitioningIps ss ts) = partitioning1 (map wordinterval_to_set ss) (map wordinterval_to_set ts)) \<Longrightarrow> map wordinterval_to_set (partitioningIps (a # ss) ts) = partitioning1 (map wordinterval_to_set (a # ss)) (map wordinterval_to_set ts)
[PROOF STEP]
apply(simp; fail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ss ts. (\<And>ts. map wordinterval_to_set (partitioningIps ss ts) = partitioning1 (map wordinterval_to_set ss) (map wordinterval_to_set ts)) \<Longrightarrow> map wordinterval_to_set (partitioningIps (a # ss) ts) = partitioning1 (map wordinterval_to_set (a # ss)) (map wordinterval_to_set ts)
[PROOF STEP]
apply(simp add: partIps_equi)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma distinct_by_mergesort: "(length (mergesort_remdups xs) = length xs) \<longleftrightarrow> distinct xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length (mergesort_remdups xs) = length xs) = distinct xs
[PROOF STEP]
by (metis list_length_iff_distinct mergesort_remdups_correct)


[STATEMENT]
lemma prod_mono_ennreal:
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x \<le> (g x :: ennreal)"
  shows   "prod f A \<le> prod g A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod f A \<le> prod g A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> f ?x \<le> g ?x

goal (1 subgoal):
 1. prod f A \<le> prod g A
[PROOF STEP]
by (induction A rule: infinite_finite_induct) (auto intro!: mult_mono)


[STATEMENT]
lemma one_less_ceiling [simp]: "1 < \<lceil>x\<rceil> \<longleftrightarrow> 1 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 < \<lceil>x\<rceil>) = ((1::'a) < x)
[PROOF STEP]
by (simp add: less_ceiling_iff)


[STATEMENT]
lemma cosh_field_def: "cosh z = (exp z + exp (-z)) / (2 :: 'a :: {banach, real_normed_field})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cosh z = (exp z + exp (- z)) / (2::'a)
[PROOF STEP]
by (simp add: cosh_def scaleR_conv_of_real)


[STATEMENT]
lemma hnorm_inverse:
  "\<And>a::'a::{real_normed_div_algebra, division_ring} star. hnorm (inverse a) = inverse (hnorm a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. hnorm (inverse a) = inverse (hnorm a)
[PROOF STEP]
by transfer (rule norm_inverse)


[STATEMENT]
lemma echelon_form_upt_k_0: "echelon_form_upt_k A 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form_upt_k A 0
[PROOF STEP]
unfolding echelon_form_upt_k_def is_zero_row_upt_k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i. (\<forall>j. mod_type_class.to_nat j < 0 \<longrightarrow> A $ i $ j = (0::'a)) \<longrightarrow> \<not> (\<exists>j>i. \<not> (\<forall>ja. mod_type_class.to_nat ja < 0 \<longrightarrow> A $ j $ ja = (0::'a)))) \<and> (\<forall>i j. i < j \<and> \<not> (\<forall>j. mod_type_class.to_nat j < 0 \<longrightarrow> A $ i $ j = (0::'a)) \<and> \<not> (\<forall>ja. mod_type_class.to_nat ja < 0 \<longrightarrow> A $ j $ ja = (0::'a)) \<longrightarrow> (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ j $ n \<noteq> (0::'a)))
[PROOF STEP]
by auto


[STATEMENT]
lemma fst_Inf: "fst (Inf A) = (INF x\<in>A. fst x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Inf A) = Inf (fst ` A)
[PROOF STEP]
by (simp add: Inf_prod_def)


[STATEMENT]
lemma point_rep_mat_row_sum:  "i < \<v> \<Longrightarrow> sum_vec (row N i) = \<B> rep (\<V>s ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < \<v> \<Longrightarrow> sum_vec (row N i) = int (\<B> rep \<V>s ! i)
[PROOF STEP]
using count_vec_sum_ones_alt mat_rep_num_N_row mat_row_elems mat_rep_num_def
[PROOF STATE]
proof (prove)
using this:
set\<^sub>v ?v \<subseteq> {0::?'a, 1::?'a} \<Longrightarrow> of_nat (count_vec ?v (1::?'a)) = sum_vec ?v
?i < \<v> \<Longrightarrow> mat_rep_num N ?i = \<B> rep \<V>s ! ?i
?i < \<v> \<Longrightarrow> set\<^sub>v (row N ?i) \<subseteq> {0, 1}
mat_rep_num ?M ?i \<equiv> count_vec (row ?M ?i) (1::?'a)

goal (1 subgoal):
 1. i < \<v> \<Longrightarrow> sum_vec (row N i) = int (\<B> rep \<V>s ! i)
[PROOF STEP]
by metis


[STATEMENT]
lemma auto_split_lemma:
 "\<And>q ps res. auto_split A (delta A ps q) res ps xs =
              maxsplit (\<lambda>ys. fin A (delta A ys q)) res ps xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>q ps res. auto_split A (delta A ps q) res ps xs = maxsplit (\<lambda>ys. fin A (delta A ys q)) res ps xs
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>q ps res. auto_split A (delta A ps q) res ps [] = maxsplit (\<lambda>ys. fin A (delta A ys q)) res ps []
 2. \<And>a xs q ps res. (\<And>q ps res. auto_split A (delta A ps q) res ps xs = maxsplit (\<lambda>ys. fin A (delta A ys q)) res ps xs) \<Longrightarrow> auto_split A (delta A ps q) res ps (a # xs) = maxsplit (\<lambda>ys. fin A (delta A ys q)) res ps (a # xs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs q ps res. (\<And>q ps res. auto_split A (delta A ps q) res ps xs = maxsplit (\<lambda>ys. fin A (delta A ys q)) res ps xs) \<Longrightarrow> auto_split A (delta A ps q) res ps (a # xs) = maxsplit (\<lambda>ys. fin A (delta A ys q)) res ps (a # xs)
[PROOF STEP]
apply (simp add: delta_snoc[symmetric] del: delta_append)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_zip_with: "set (zip_with f xs ys) = (\<lambda>(x,y). f x y) ` set (zip xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (zip_with f xs ys) = (\<lambda>(x, y). f x y) ` set (zip xs ys)
[PROOF STEP]
by (induction f xs ys rule: zip_with.induct) simp_all


[STATEMENT]
lemma filter_single_mset: "filter_mset P {#x#} = (if P x then {#x#} else {#})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset P {#x#} = (if P x then {#x#} else {#})
[PROOF STEP]
by (rule multiset_eqI) simp


[STATEMENT]
lemma intersects_x_axis_positive_intersects_x_axis [simp]:
  assumes "intersects_x_axis_positive H"
  shows "intersects_x_axis H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. intersects_x_axis H
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. intersects_x_axis H
[PROOF STEP]
have "\<And> a aa. \<lbrakk> Re a \<noteq> 0; Re aa / Re a < - 1; \<not> (Re a)\<^sup>2 < (Re aa)\<^sup>2 \<rbrakk> \<Longrightarrow> aa = 0 \<and> a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>Re a \<noteq> 0; Re aa / Re a < - 1; \<not> (Re a)\<^sup>2 < (Re aa)\<^sup>2\<rbrakk> \<Longrightarrow> aa = 0 \<and> a = 0
[PROOF STEP]
by (smt less_divide_eq_1_pos one_less_power pos2 power2_minus power_divide zero_less_power2)
[PROOF STATE]
proof (state)
this:
\<lbrakk>Re ?a \<noteq> 0; Re ?aa / Re ?a < - 1; \<not> (Re ?a)\<^sup>2 < (Re ?aa)\<^sup>2\<rbrakk> \<Longrightarrow> ?aa = 0 \<and> ?a = 0

goal (1 subgoal):
 1. intersects_x_axis H
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Re ?a \<noteq> 0; Re ?aa / Re ?a < - 1; \<not> (Re ?a)\<^sup>2 < (Re ?aa)\<^sup>2\<rbrakk> \<Longrightarrow> ?aa = 0 \<and> ?a = 0

goal (1 subgoal):
 1. intersects_x_axis H
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Re ?a \<noteq> 0; Re ?aa / Re ?a < - 1; \<not> (Re ?a)\<^sup>2 < (Re ?aa)\<^sup>2\<rbrakk> \<Longrightarrow> ?aa = 0 \<and> ?a = 0
intersects_x_axis_positive H

goal (1 subgoal):
 1. intersects_x_axis H
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>H. \<lbrakk>\<And>a aa. \<lbrakk>Re a \<noteq> 0; Re aa / Re a < - 1; \<not> (Re a)\<^sup>2 < (Re aa)\<^sup>2\<rbrakk> \<Longrightarrow> aa = 0 \<and> a = 0; intersects_x_axis_positive_clmat H\<rbrakk> \<Longrightarrow> intersects_x_axis_clmat H
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>H. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; \<And>a aa. \<lbrakk>Re a \<noteq> 0; Re aa / Re a < - 1; \<not> (Re a)\<^sup>2 < (Re aa)\<^sup>2\<rbrakk> \<Longrightarrow> aa = 0 \<and> a = 0; intersects_x_axis_positive_cmat H\<rbrakk> \<Longrightarrow> intersects_x_axis_cmat H
[PROOF STEP]
apply (auto simp add: hermitean_def mat_adj_def mat_cnj_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
intersects_x_axis H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem DFT_inverse:
  assumes i_less: "i < n"
  shows  "IDFT n (DFT n a) i = of_nat n * a i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IDFT n (DFT n a) i = of_nat n * a i
[PROOF STEP]
using [[linarith_split_limit = 0]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IDFT n (DFT n a) i = of_nat n * a i
[PROOF STEP]
apply (unfold DFT_def IDFT_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..<n. (\<Sum>j = 0..<n. FFT.root n ^ (k * j) * a j) / FFT.root n ^ (i * k)) = of_nat n * a i
[PROOF STEP]
apply (simp add: sum_divide_distrib)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..<n. \<Sum>na = 0..<n. FFT.root n ^ (k * na) * a na / FFT.root n ^ (i * k)) = of_nat n * a i
[PROOF STEP]
apply (subst sum.swap)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. \<Sum>ia = 0..<n. FFT.root n ^ (ia * j) * a j / FFT.root n ^ (i * ia)) = of_nat n * a i
[PROOF STEP]
apply (simp only: times_divide_eq_left [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. \<Sum>ia = 0..<n. FFT.root n ^ (ia * j) / FFT.root n ^ (i * ia) * a j) = of_nat n * a i
[PROOF STEP]
apply (simp only: power_divides_special [OF root_nonzero])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. \<Sum>ia = 0..<n. (FFT.root n ^ j / FFT.root n ^ i) ^ ia * a j) = of_nat n * a i
[PROOF STEP]
apply (simp add: power_diff_rev_if root_nonzero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. \<Sum>ia = 0..<n. (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j)) ^ ia * a j) = of_nat n * a i
[PROOF STEP]
apply (simp add: sum_divide_distrib [THEN sym]
    sum_distrib_right [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
from i_less
[PROOF STATE]
proof (chain)
picking this:
i < n
[PROOF STEP]
have i_diff: "!!k. i - k < n"
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. \<And>k. i - k < n
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
i - ?k < n

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
have diff_i: "!!k. k < n ==> k - i < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. k < n \<Longrightarrow> k - i < n
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
?k < n \<Longrightarrow> ?k - i < n

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
let ?sum = "%i j n. sum ((^) (if i <= j then root n ^ (j - i)
                  else (1 / root n) ^ (i - j))) {0..<n} * a j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
let ?sum1 = "%i j n. sum ((^) (root n ^ (j - i))) {0..<n} * a j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
let ?sum2 = "%i j n. sum ((^) ((1 / root n) ^ (i - j))) {0..<n} * a j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
from i_less
[PROOF STATE]
proof (chain)
picking this:
i < n
[PROOF STEP]
have "(\<Sum>j = 0..<n. ?sum i j n) =
      (\<Sum>j = 0..<i. ?sum2 i j n) + (\<Sum>j = i..<n. ?sum1 i j n)"
      (is "?s = _")
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = (\<Sum>j = 0..<i. sum ((^) ((1 / FFT.root n) ^ (i - j))) {0..<n} * a j) + (\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)
[PROOF STEP]
by (simp add: root_summation_inv nat_dvd_not_less
        sum_add_split_nat_ivl [where f = "%j. ?sum i j n"])
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = (\<Sum>j = 0..<i. sum ((^) ((1 / FFT.root n) ^ (i - j))) {0..<n} * a j) + (\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = (\<Sum>j = 0..<i. sum ((^) ((1 / FFT.root n) ^ (i - j))) {0..<n} * a j) + (\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
from i_less i_diff
[PROOF STATE]
proof (chain)
picking this:
i < n
i - ?k < n
[PROOF STEP]
have "... = (\<Sum>j = i..<n. ?sum1 i j n)"
[PROOF STATE]
proof (prove)
using this:
i < n
i - ?k < n

goal (1 subgoal):
 1. (\<Sum>j = 0..<i. sum ((^) ((1 / FFT.root n) ^ (i - j))) {0..<n} * a j) + (\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = (\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)
[PROOF STEP]
by (simp add: root_summation_inv nat_dvd_not_less)
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<i. sum ((^) ((1 / FFT.root n) ^ (i - j))) {0..<n} * a j) + (\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = (\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<i. sum ((^) ((1 / FFT.root n) ^ (i - j))) {0..<n} * a j) + (\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = (\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
from i_less
[PROOF STATE]
proof (chain)
picking this:
i < n
[PROOF STEP]
have "... =
      (\<Sum>j\<in>{i} \<union> {i<..<n}. ?sum1 i j n)"
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. (\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = (\<Sum>j\<in>{i} \<union> {i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)
[PROOF STEP]
by (simp only: ivl_disj_un)
[PROOF STATE]
proof (state)
this:
(\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = (\<Sum>j\<in>{i} \<union> {i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j = i..<n. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = (\<Sum>j\<in>{i} \<union> {i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
have "... =
      (?sum1 i i n + (\<Sum>j\<in>{i<..<n}. ?sum1 i j n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>{i} \<union> {i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = sum ((^) (FFT.root n ^ (i - i))) {0..<n} * a i + (\<Sum>j\<in>{i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)
[PROOF STEP]
by (simp add: sum.union_disjoint ivl_disj_int)
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>{i} \<union> {i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = sum ((^) (FFT.root n ^ (i - i))) {0..<n} * a i + (\<Sum>j\<in>{i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>{i} \<union> {i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = sum ((^) (FFT.root n ^ (i - i))) {0..<n} * a i + (\<Sum>j\<in>{i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
from i_less diff_i
[PROOF STATE]
proof (chain)
picking this:
i < n
?k < n \<Longrightarrow> ?k - i < n
[PROOF STEP]
have "... = ?sum1 i i n"
[PROOF STATE]
proof (prove)
using this:
i < n
?k < n \<Longrightarrow> ?k - i < n

goal (1 subgoal):
 1. sum ((^) (FFT.root n ^ (i - i))) {0..<n} * a i + (\<Sum>j\<in>{i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = sum ((^) (FFT.root n ^ (i - i))) {0..<n} * a i
[PROOF STEP]
by (simp add: root_summation nat_dvd_not_less)
[PROOF STATE]
proof (state)
this:
sum ((^) (FFT.root n ^ (i - i))) {0..<n} * a i + (\<Sum>j\<in>{i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = sum ((^) (FFT.root n ^ (i - i))) {0..<n} * a i

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((^) (FFT.root n ^ (i - i))) {0..<n} * a i + (\<Sum>j\<in>{i<..<n}. sum ((^) (FFT.root n ^ (j - i))) {0..<n} * a j) = sum ((^) (FFT.root n ^ (i - i))) {0..<n} * a i

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
from i_less
[PROOF STATE]
proof (chain)
picking this:
i < n
[PROOF STEP]
have "... = of_nat n * a i" (is "_ = ?t")
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. sum ((^) (FFT.root n ^ (i - i))) {0..<n} * a i = of_nat n * a i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum ((^) (FFT.root n ^ (i - i))) {0..<n} * a i = of_nat n * a i

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
show "?s = ?t"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<n. sum ((^) (if i \<le> j then FFT.root n ^ (j - i) else (1 / FFT.root n) ^ (i - j))) {0..<n} * a j) = of_nat n * a i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_list_incr [simp]: "length (list_incr i x) = length x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (list_incr i x) = length x
[PROOF STEP]
by (auto simp: list_incr_def)


[STATEMENT]
lemma prime_hd_non_zero:
  fixes p::nat assumes a: "prime p" and b: "prime q" shows "hd (nat_to_bv (p*q)) ~= \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (nat_to_bv (p * q)) \<noteq> \<zero>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hd (nat_to_bv (p * q)) \<noteq> \<zero>
[PROOF STEP]
have "0 < p*q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < p * q
[PROOF STEP]
by (metis a b mult_is_0 neq0_conv not_prime_0)
[PROOF STATE]
proof (state)
this:
0 < p * q

goal (1 subgoal):
 1. hd (nat_to_bv (p * q)) \<noteq> \<zero>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < p * q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < p * q

goal (1 subgoal):
 1. hd (nat_to_bv (p * q)) \<noteq> \<zero>
[PROOF STEP]
using hd_one[of "p*q"] and nat_to_bv_def
[PROOF STATE]
proof (prove)
using this:
0 < p * q
0 < p * q \<Longrightarrow> hd (nat_to_bv_helper (p * q) []) = \<one>
nat_to_bv ?n = nat_to_bv_helper ?n []

goal (1 subgoal):
 1. hd (nat_to_bv (p * q)) \<noteq> \<zero>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hd (nat_to_bv (p * q)) \<noteq> \<zero>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma preal_mult_commute: "(x::preal) * y = y * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * y = y * x
[PROOF STEP]
unfolding preal_mult_def mult_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_preal {w. \<exists>x\<in>Rep_preal x. \<exists>y\<in>Rep_preal y. w = x * y} = Abs_preal {w. \<exists>xa\<in>Rep_preal y. \<exists>y\<in>Rep_preal x. w = xa * y}
[PROOF STEP]
by (metis (no_types, opaque_lifting) mult.commute)


[STATEMENT]
lemma (in prob_space) indep_set_sigma_sets:
  assumes "indep_set A B"
  assumes A: "Int_stable A" and B: "Int_stable B"
  shows "indep_set (sigma_sets (space M) A) (sigma_sets (space M) B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_set (sigma_sets (space M) A) (sigma_sets (space M) B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. indep_set (sigma_sets (space M) A) (sigma_sets (space M) B)
[PROOF STEP]
have "indep_sets (\<lambda>i. sigma_sets (space M) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_sets (\<lambda>i. sigma_sets (space M) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) UNIV
[PROOF STEP]
proof (rule indep_sets_sigma)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. indep_sets (\<lambda>i. case i of True \<Rightarrow> A | False \<Rightarrow> B) UNIV
 2. \<And>i. i \<in> UNIV \<Longrightarrow> Int_stable (case i of True \<Rightarrow> A | False \<Rightarrow> B)
[PROOF STEP]
show "indep_sets (case_bool A B) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_sets (case_bool A B) UNIV
[PROOF STEP]
by (rule \<open>indep_set A B\<close>[unfolded indep_set_def])
[PROOF STATE]
proof (state)
this:
indep_sets (case_bool A B) UNIV

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> Int_stable (case i of True \<Rightarrow> A | False \<Rightarrow> B)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> Int_stable (case i of True \<Rightarrow> A | False \<Rightarrow> B)
[PROOF STEP]
show "Int_stable (case i of True \<Rightarrow> A | False \<Rightarrow> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Int_stable (case i of True \<Rightarrow> A | False \<Rightarrow> B)
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
Int_stable A
Int_stable B

goal (1 subgoal):
 1. Int_stable (case i of True \<Rightarrow> A | False \<Rightarrow> B)
[PROOF STEP]
by (cases i) auto
[PROOF STATE]
proof (state)
this:
Int_stable (case i of True \<Rightarrow> A | False \<Rightarrow> B)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
indep_sets (\<lambda>i. sigma_sets (space M) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) UNIV

goal (1 subgoal):
 1. indep_set (sigma_sets (space M) A) (sigma_sets (space M) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
indep_sets (\<lambda>i. sigma_sets (space M) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
indep_sets (\<lambda>i. sigma_sets (space M) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) UNIV

goal (1 subgoal):
 1. indep_set (sigma_sets (space M) A) (sigma_sets (space M) B)
[PROOF STEP]
unfolding indep_set_def
[PROOF STATE]
proof (prove)
using this:
indep_sets (\<lambda>i. sigma_sets (space M) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) UNIV

goal (1 subgoal):
 1. indep_sets (case_bool (sigma_sets (space M) A) (sigma_sets (space M) B)) UNIV
[PROOF STEP]
by (rule indep_sets_mono_sets) (auto split: bool.split)
[PROOF STATE]
proof (state)
this:
indep_set (sigma_sets (space M) A) (sigma_sets (space M) B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tens_assoc:
 "\<forall>a xs ys.(brickmat a \<otimes> (blockmat xs \<otimes> blockmat ys)
                   = (brickmat a \<otimes> blockmat xs) \<otimes> blockmat ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a xs ys. brickmat a \<otimes> (blockmat xs \<otimes> blockmat ys) = brickmat a \<otimes> blockmat xs \<otimes> blockmat ys
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>a xs ys. brickmat a \<otimes> (blockmat xs \<otimes> blockmat ys) = brickmat a \<otimes> blockmat xs \<otimes> blockmat ys
[PROOF STEP]
have "\<forall>a.(mat
               (rat_poly.row_length (brickmat a))
               (length (brickmat a))
                         (brickmat a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a. mat (rat_poly.row_length (brickmat a)) (length (brickmat a)) (brickmat a)
[PROOF STEP]
using brickmat.simps
[PROOF STATE]
proof (prove)
using this:
brickmat vert = [[1, 0], [0, 1]]
brickmat cup = [[0], [A], [rat_poly_inv B], [0]]
brickmat cap = [[0, rat_poly_inv A, B, 0]]
brickmat over = [[A, 0, 0, 0], [0, 0, B, 0], [0, B, A - rat_poly_times (rat_poly_times B B) B, 0], [0, 0, 0, A]]
brickmat brick.under = [[B, 0, 0, 0], [0, B - rat_poly_times (rat_poly_times A A) A, A, 0], [0, A, 0, 0], [0, 0, 0, B]]

goal (1 subgoal):
 1. \<forall>a. mat (rat_poly.row_length (brickmat a)) (length (brickmat a)) (brickmat a)
[PROOF STEP]
unfolding mat_def rat_poly.row_length_def Ball_def vec_def
[PROOF STATE]
proof (prove)
using this:
brickmat vert = [[1, 0], [0, 1]]
brickmat cup = [[0], [A], [rat_poly_inv B], [0]]
brickmat cap = [[0, rat_poly_inv A, B, 0]]
brickmat over = [[A, 0, 0, 0], [0, 0, B, 0], [0, B, A - rat_poly_times (rat_poly_times B B) B, 0], [0, 0, 0, A]]
brickmat brick.under = [[B, 0, 0, 0], [0, B - rat_poly_times (rat_poly_times A A) A, A, 0], [0, A, 0, 0], [0, 0, 0, B]]

goal (1 subgoal):
 1. \<forall>a. length (brickmat a) = length (brickmat a) \<and> (\<forall>x. x \<in> set (brickmat a) \<longrightarrow> length x = (if brickmat a = [] then 0 else length (hd (brickmat a))))
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a x. \<lbrakk>brickmat a \<noteq> []; x \<in> set (brickmat a)\<rbrakk> \<Longrightarrow> length x = length (hd (brickmat a))
[PROOF STEP]
by (case_tac a) (auto)
[PROOF STATE]
proof (state)
this:
\<forall>a. mat (rat_poly.row_length (brickmat a)) (length (brickmat a)) (brickmat a)

goal (1 subgoal):
 1. \<forall>a xs ys. brickmat a \<otimes> (blockmat xs \<otimes> blockmat ys) = brickmat a \<otimes> blockmat xs \<otimes> blockmat ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>a. mat (rat_poly.row_length (brickmat a)) (length (brickmat a)) (brickmat a)

goal (1 subgoal):
 1. \<forall>a xs ys. brickmat a \<otimes> (blockmat xs \<otimes> blockmat ys) = brickmat a \<otimes> blockmat xs \<otimes> blockmat ys
[PROOF STEP]
have "\<forall>xs. (mat
                           (rat_poly.row_length (blockmat xs))
                           (length (blockmat xs))
                                       (blockmat xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xs. mat (rat_poly.row_length (blockmat xs)) (length (blockmat xs)) (blockmat xs)
[PROOF STEP]
using matrix_blockmat
[PROOF STATE]
proof (prove)
using this:
mat (rat_poly.row_length (blockmat ?ls)) (length (blockmat ?ls)) (blockmat ?ls)

goal (1 subgoal):
 1. \<forall>xs. mat (rat_poly.row_length (blockmat xs)) (length (blockmat xs)) (blockmat xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>xs. mat (rat_poly.row_length (blockmat xs)) (length (blockmat xs)) (blockmat xs)

goal (1 subgoal):
 1. \<forall>a xs ys. brickmat a \<otimes> (blockmat xs \<otimes> blockmat ys) = brickmat a \<otimes> blockmat xs \<otimes> blockmat ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>xs. mat (rat_poly.row_length (blockmat xs)) (length (blockmat xs)) (blockmat xs)

goal (1 subgoal):
 1. \<forall>a xs ys. brickmat a \<otimes> (blockmat xs \<otimes> blockmat ys) = brickmat a \<otimes> blockmat xs \<otimes> blockmat ys
[PROOF STEP]
have "\<forall>ys. mat
                          (rat_poly.row_length (blockmat ys))
                          (length (blockmat ys))
                                        (blockmat ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>ys. mat (rat_poly.row_length (blockmat ys)) (length (blockmat ys)) (blockmat ys)
[PROOF STEP]
using matrix_blockmat
[PROOF STATE]
proof (prove)
using this:
mat (rat_poly.row_length (blockmat ?ls)) (length (blockmat ?ls)) (blockmat ?ls)

goal (1 subgoal):
 1. \<forall>ys. mat (rat_poly.row_length (blockmat ys)) (length (blockmat ys)) (blockmat ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>ys. mat (rat_poly.row_length (blockmat ys)) (length (blockmat ys)) (blockmat ys)

goal (1 subgoal):
 1. \<forall>a xs ys. brickmat a \<otimes> (blockmat xs \<otimes> blockmat ys) = brickmat a \<otimes> blockmat xs \<otimes> blockmat ys
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>a. mat (rat_poly.row_length (brickmat a)) (length (brickmat a)) (brickmat a)
\<forall>xs. mat (rat_poly.row_length (blockmat xs)) (length (blockmat xs)) (blockmat xs)
\<forall>ys. mat (rat_poly.row_length (blockmat ys)) (length (blockmat ys)) (blockmat ys)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>a. mat (rat_poly.row_length (brickmat a)) (length (brickmat a)) (brickmat a)
\<forall>xs. mat (rat_poly.row_length (blockmat xs)) (length (blockmat xs)) (blockmat xs)
\<forall>ys. mat (rat_poly.row_length (blockmat ys)) (length (blockmat ys)) (blockmat ys)

goal (1 subgoal):
 1. \<forall>a xs ys. brickmat a \<otimes> (blockmat xs \<otimes> blockmat ys) = brickmat a \<otimes> blockmat xs \<otimes> blockmat ys
[PROOF STEP]
using rat_poly.associativity
[PROOF STATE]
proof (prove)
using this:
\<forall>a. mat (rat_poly.row_length (brickmat a)) (length (brickmat a)) (brickmat a)
\<forall>xs. mat (rat_poly.row_length (blockmat xs)) (length (blockmat xs)) (blockmat xs)
\<forall>ys. mat (rat_poly.row_length (blockmat ys)) (length (blockmat ys)) (blockmat ys)
mat (rat_poly.row_length ?M1.0) (length ?M1.0) ?M1.0 \<and> mat (rat_poly.row_length ?M2.0) (length ?M2.0) ?M2.0 \<and> mat (rat_poly.row_length ?M3.0) (length ?M3.0) ?M3.0 \<Longrightarrow> ?M1.0 \<otimes> (?M2.0 \<otimes> ?M3.0) = ?M1.0 \<otimes> ?M2.0 \<otimes> ?M3.0

goal (1 subgoal):
 1. \<forall>a xs ys. brickmat a \<otimes> (blockmat xs \<otimes> blockmat ys) = brickmat a \<otimes> blockmat xs \<otimes> blockmat ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>a xs ys. brickmat a \<otimes> (blockmat xs \<otimes> blockmat ys) = brickmat a \<otimes> blockmat xs \<otimes> blockmat ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_Rep_perm: "bij (Rep_perm p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij (Rep_perm p)
[PROOF STEP]
using Rep_perm [of p]
[PROOF STATE]
proof (prove)
using this:
Rep_perm p \<in> perm

goal (1 subgoal):
 1. bij (Rep_perm p)
[PROOF STEP]
unfolding perm_def
[PROOF STATE]
proof (prove)
using this:
Rep_perm p \<in> {f. bij f \<and> finite {a. f a \<noteq> a} \<and> (\<forall>a. sort_of (f a) = sort_of a)}

goal (1 subgoal):
 1. bij (Rep_perm p)
[PROOF STEP]
by simp


[STATEMENT]
lemma "smaller_interp a b \<longleftrightarrow> a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smaller_interp a b = (a \<le> b)
[PROOF STEP]
by (simp add: le_fun_def smaller_interp_def)


[STATEMENT]
lemma lemma_NBseq_def: "(\<exists>K > 0. \<forall>n. norm (X n) \<le> K) \<longleftrightarrow> (\<exists>N. \<forall>n. norm (X n) \<le> real(Suc N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>K>0. \<forall>n. norm (X n) \<le> K) = (\<exists>N. \<forall>n. norm (X n) \<le> real (Suc N))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
fix K :: real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
from reals_Archimedean2
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. ?x < of_nat n
[PROOF STEP]
obtain n :: nat where "K < real n"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. ?x < of_nat n

goal (1 subgoal):
 1. (\<And>n. K < real n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
K < real n

goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K < real n
[PROOF STEP]
have "K \<le> real (Suc n)"
[PROOF STATE]
proof (prove)
using this:
K < real n

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

goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
K \<le> real (Suc n)

goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
assume "\<forall>m. norm (X m) \<le> K"
[PROOF STATE]
proof (state)
this:
\<forall>m. norm (X m) \<le> K

goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
K \<le> real (Suc n)
\<forall>m. norm (X m) \<le> K
[PROOF STEP]
have "\<forall>m. norm (X m) \<le> real (Suc n)"
[PROOF STATE]
proof (prove)
using this:
K \<le> real (Suc n)
\<forall>m. norm (X m) \<le> K

goal (1 subgoal):
 1. \<forall>m. norm (X m) \<le> real (Suc n)
[PROOF STEP]
by (blast intro: order_trans)
[PROOF STATE]
proof (state)
this:
\<forall>m. norm (X m) \<le> real (Suc n)

goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>m. norm (X m) \<le> real (Suc n)
[PROOF STEP]
show "\<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)"
[PROOF STATE]
proof (prove)
using this:
\<forall>m. norm (X m) \<le> real (Suc n)

goal (1 subgoal):
 1. \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)

goal (1 subgoal):
 1. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
show "\<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
using of_nat_0_less_iff
[PROOF STATE]
proof (prove)
using this:
((0::?'a) < of_nat ?n) = (0 < ?n)

goal (1 subgoal):
 1. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>n. norm (X n) \<le> real (Suc ?N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem isRevNth_less_length:
assumes "reach s" and "isRevNth s cid uid pid n"
shows "n < length (reviewsPaper (paper s pid))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < length (reviewsPaper (paper s pid))
[PROOF STEP]
using isRevNth_less_length1 assms
[PROOF STATE]
proof (prove)
using this:
reach ?s \<Longrightarrow> isRevNth_less_length ?s
reach s
isRevNth s cid uid pid n

goal (1 subgoal):
 1. n < length (reviewsPaper (paper s pid))
[PROOF STEP]
unfolding isRevNth_less_length_def
[PROOF STATE]
proof (prove)
using this:
reach ?s \<Longrightarrow> \<forall>confID uID papID n. isRevNth ?s confID uID papID n \<longrightarrow> n < length (reviewsPaper (paper ?s papID))
reach s
isRevNth s cid uid pid n

goal (1 subgoal):
 1. n < length (reviewsPaper (paper s pid))
[PROOF STEP]
by blast


[STATEMENT]
lemma excess_nz_iff_gz: "\<lbrakk> u\<in>V; u\<noteq>s \<rbrakk> \<Longrightarrow> excess f u \<noteq> 0 \<longleftrightarrow> excess f u > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<in> V; u \<noteq> s\<rbrakk> \<Longrightarrow> (excess f u \<noteq> (0::'a)) = ((0::'a) < excess f u)
[PROOF STEP]
using excess_non_negative'
[PROOF STATE]
proof (prove)
using this:
\<forall>v\<in>V - {s}. (0::'a) \<le> excess f v

goal (1 subgoal):
 1. \<lbrakk>u \<in> V; u \<noteq> s\<rbrakk> \<Longrightarrow> (excess f u \<noteq> (0::'a)) = ((0::'a) < excess f u)
[PROOF STEP]
by force


[STATEMENT]
lemma matrix_add_0_left [simp]:
  "0 + A = (A::('a::monoid_add,'m,'n) matrix)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 + A = A
[PROOF STEP]
by (cases A, simp add: zero_matrix_def)


[STATEMENT]
lemma (in group) id_hom_singleton: "id \<in> hom (singleton_group \<one>) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id \<in> hom (singleton_group \<one>) G
[PROOF STEP]
by (simp add: hom_def singleton_group_def)


[STATEMENT]
lemma countable_enum_cases:
  assumes "countable S"
  obtains (finite) f :: "'a \<Rightarrow> nat" where "finite S" "bij_betw f S {..<card S}"
        | (infinite) f :: "'a \<Rightarrow> nat" where "infinite S" "bij_betw f S UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>f. \<lbrakk>finite S; bij_betw f S {..<card S}\<rbrakk> \<Longrightarrow> thesis; \<And>f. \<lbrakk>infinite S; bij_betw f S UNIV\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using ex_bij_betw_finite_nat[of S] countableE_infinite \<open>countable S\<close>
[PROOF STATE]
proof (prove)
using this:
finite S \<Longrightarrow> \<exists>h. bij_betw h S {0..<card S}
\<lbrakk>countable ?S; infinite ?S; \<And>e. bij_betw e ?S UNIV \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
countable S

goal (1 subgoal):
 1. \<lbrakk>\<And>f. \<lbrakk>finite S; bij_betw f S {..<card S}\<rbrakk> \<Longrightarrow> thesis; \<And>f. \<lbrakk>infinite S; bij_betw f S UNIV\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (cases "finite S") (auto simp add: atLeast0LessThan)


[STATEMENT]
lemma vert_adj_inc_edge_iff: "vert_adj v1 v2 \<longleftrightarrow> incident v1 {v1, v2} \<and> incident v2 {v1, v2} \<and> {v1, v2} \<in> E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vert_adj v1 v2 = (incident v1 {v1, v2} \<and> incident v2 {v1, v2} \<and> {v1, v2} \<in> E)
[PROOF STEP]
unfolding vert_adj_def incident_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({v1, v2} \<in> E) = (v1 \<in> {v1, v2} \<and> v2 \<in> {v1, v2} \<and> {v1, v2} \<in> E)
[PROOF STEP]
by auto


[STATEMENT]
lemma list_rel_id[relator_props]: "\<lbrakk>R=Id\<rbrakk> \<Longrightarrow> \<langle>R\<rangle>list_rel = Id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R = Id \<Longrightarrow> \<langle>R\<rangle>list_rel = Id
[PROOF STEP]
by (auto simp add: list_rel_def list_all2_eq[symmetric])


[STATEMENT]
lemma homeomorphic_spheres':
  fixes a ::"'a::euclidean_space" and b ::"'b::euclidean_space"
  assumes "0 < \<delta>" and dimeq: "DIM('a) = DIM('b)"
  shows "(sphere a \<delta>) homeomorphic (sphere b \<delta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere a \<delta> homeomorphic sphere b \<delta>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sphere a \<delta> homeomorphic sphere b \<delta>
[PROOF STEP]
obtain f :: "'a\<Rightarrow>'b" and g where "linear f" "linear g"
     and fg: "\<And>x. norm(f x) = norm x" "\<And>y. norm(g y) = norm y" "\<And>x. g(f x) = x" "\<And>y. f(g y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>linear f; linear g; \<And>x. norm (f x) = norm x; \<And>y. norm (g y) = norm y; \<And>x. g (f x) = x; \<And>y. f (g y) = y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast intro: isomorphisms_UNIV_UNIV [OF dimeq])
[PROOF STATE]
proof (state)
this:
linear f
linear g
norm (f ?x) = norm ?x
norm (g ?y) = norm ?y
g (f ?x) = ?x
f (g ?y) = ?y

goal (1 subgoal):
 1. sphere a \<delta> homeomorphic sphere b \<delta>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
linear f
linear g
norm (f ?x) = norm ?x
norm (g ?y) = norm ?y
g (f ?x) = ?x
f (g ?y) = ?y
[PROOF STEP]
have "continuous_on UNIV f" "continuous_on UNIV g"
[PROOF STATE]
proof (prove)
using this:
linear f
linear g
norm (f ?x) = norm ?x
norm (g ?y) = norm ?y
g (f ?x) = ?x
f (g ?y) = ?y

goal (1 subgoal):
 1. continuous_on UNIV f &&& continuous_on UNIV g
[PROOF STEP]
using linear_continuous_on linear_linear
[PROOF STATE]
proof (prove)
using this:
linear f
linear g
norm (f ?x) = norm ?x
norm (g ?y) = norm ?y
g (f ?x) = ?x
f (g ?y) = ?y
bounded_linear ?f \<Longrightarrow> continuous_on ?s ?f
bounded_linear ?f = linear ?f

goal (1 subgoal):
 1. continuous_on UNIV f &&& continuous_on UNIV g
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
continuous_on UNIV f
continuous_on UNIV g

goal (1 subgoal):
 1. sphere a \<delta> homeomorphic sphere b \<delta>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on UNIV f
continuous_on UNIV g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on UNIV f
continuous_on UNIV g

goal (1 subgoal):
 1. sphere a \<delta> homeomorphic sphere b \<delta>
[PROOF STEP]
unfolding homeomorphic_minimal
[PROOF STATE]
proof (prove)
using this:
continuous_on UNIV f
continuous_on UNIV g

goal (1 subgoal):
 1. \<exists>f g. (\<forall>x\<in>sphere a \<delta>. f x \<in> sphere b \<delta> \<and> g (f x) = x) \<and> (\<forall>y\<in>sphere b \<delta>. g y \<in> sphere a \<delta> \<and> f (g y) = y) \<and> continuous_on (sphere a \<delta>) f \<and> continuous_on (sphere b \<delta>) g
[PROOF STEP]
apply(rule_tac x="\<lambda>x. b + f(x - a)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on UNIV f; continuous_on UNIV g\<rbrakk> \<Longrightarrow> \<exists>g. (\<forall>x\<in>sphere a \<delta>. b + f (x - a) \<in> sphere b \<delta> \<and> g (b + f (x - a)) = x) \<and> (\<forall>y\<in>sphere b \<delta>. g y \<in> sphere a \<delta> \<and> b + f (g y - a) = y) \<and> continuous_on (sphere a \<delta>) (\<lambda>x. b + f (x - a)) \<and> continuous_on (sphere b \<delta>) g
[PROOF STEP]
apply(rule_tac x="\<lambda>x. a + g(x - b)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on UNIV f; continuous_on UNIV g\<rbrakk> \<Longrightarrow> (\<forall>x\<in>sphere a \<delta>. b + f (x - a) \<in> sphere b \<delta> \<and> a + g (b + f (x - a) - b) = x) \<and> (\<forall>y\<in>sphere b \<delta>. a + g (y - b) \<in> sphere a \<delta> \<and> b + f (a + g (y - b) - a) = y) \<and> continuous_on (sphere a \<delta>) (\<lambda>x. b + f (x - a)) \<and> continuous_on (sphere b \<delta>) (\<lambda>x. a + g (x - b))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < \<delta>
DIM('a) = DIM('b)

goal (1 subgoal):
 1. \<lbrakk>continuous_on UNIV f; continuous_on UNIV g\<rbrakk> \<Longrightarrow> (\<forall>x\<in>sphere a \<delta>. b + f (x - a) \<in> sphere b \<delta> \<and> a + g (b + f (x - a) - b) = x) \<and> (\<forall>y\<in>sphere b \<delta>. a + g (y - b) \<in> sphere a \<delta> \<and> b + f (a + g (y - b) - a) = y) \<and> continuous_on (sphere a \<delta>) (\<lambda>x. b + f (x - a)) \<and> continuous_on (sphere b \<delta>) (\<lambda>x. a + g (x - b))
[PROOF STEP]
apply (force intro: continuous_intros
                  continuous_on_compose2 [of _ f] continuous_on_compose2 [of _ g] simp: dist_commute dist_norm fg)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
sphere a \<delta> homeomorphic sphere b \<delta>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  if_polynomial_0_rank:
assumes "polynomial_f w \<noteq> 0"
shows "r ^ N_half \<le> cprank (A w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r ^ N_half \<le> cprank (A w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r ^ N_half \<le> cprank (A w)
[PROOF STEP]
have "r ^ N_half = dim_row (submatrix (matricize {n. even n} (A w)) rows_with_1 rows_with_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r ^ N_half = dim_row (submatrix (ten2mat (A w)) rows_with_1 rows_with_1)
[PROOF STEP]
by (metis (full_types) Aw'_def card_rows_with_1 dim_submatrix(1) dims_A dims_Aw dims_matricize(1) set_le_in)
[PROOF STATE]
proof (state)
this:
r ^ N_half = dim_row (submatrix (ten2mat (A w)) rows_with_1 rows_with_1)

goal (1 subgoal):
 1. r ^ N_half \<le> cprank (A w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
r ^ N_half = dim_row (submatrix (ten2mat (A w)) rows_with_1 rows_with_1)

goal (1 subgoal):
 1. r ^ N_half \<le> cprank (A w)
[PROOF STEP]
have "... \<le> mrank (matricize {n. even n} (A w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (submatrix (ten2mat (A w)) rows_with_1 rows_with_1) \<le> mrank (ten2mat (A w))
[PROOF STEP]
using assms vec_space.rank_gt_minor[OF carrier_matI[OF dims_A'_pow, unfolded weight_space_dim_def]]
[PROOF STATE]
proof (prove)
using this:
polynomial_f w \<noteq> 0
det (submatrix (A' ?ws2) ?I ?J) \<noteq> 0 \<Longrightarrow> card {j. j < last rs ^ N_half \<and> j \<in> ?J} \<le> vec_space.rank (last rs ^ N_half) (A' ?ws2)

goal (1 subgoal):
 1. dim_row (submatrix (ten2mat (A w)) rows_with_1 rows_with_1) \<le> mrank (ten2mat (A w))
[PROOF STEP]
by (metis (full_types) A'_def dim_submatrix(1) dims_A'_pow(1) polynomial_f_def)
[PROOF STATE]
proof (state)
this:
dim_row (submatrix (ten2mat (A w)) rows_with_1 rows_with_1) \<le> mrank (ten2mat (A w))

goal (1 subgoal):
 1. r ^ N_half \<le> cprank (A w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dim_row (submatrix (ten2mat (A w)) rows_with_1 rows_with_1) \<le> mrank (ten2mat (A w))

goal (1 subgoal):
 1. r ^ N_half \<le> cprank (A w)
[PROOF STEP]
have "... \<le> cprank (A w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mrank (ten2mat (A w)) \<le> cprank (A w)
[PROOF STEP]
using matrix_rank_le_cp_rank
[PROOF STATE]
proof (prove)
using this:
mrank (matricize ?I ?A) \<le> cprank ?A

goal (1 subgoal):
 1. mrank (ten2mat (A w)) \<le> cprank (A w)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
mrank (ten2mat (A w)) \<le> cprank (A w)

goal (1 subgoal):
 1. r ^ N_half \<le> cprank (A w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
r ^ N_half \<le> cprank (A w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r ^ N_half \<le> cprank (A w)

goal (1 subgoal):
 1. r ^ N_half \<le> cprank (A w)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
r ^ N_half \<le> cprank (A w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compos_aI_inj:"\<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A;
                      compos A g f = aI\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> injec\<^bsub>A,B\<^esub> f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> injec\<^bsub>A,B\<^esub> f
[PROOF STEP]
apply (simp add:injec_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> ker\<^bsub>A,B\<^esub> f = {\<zero>\<^bsub>A\<^esub>}
[PROOF STEP]
apply (simp add:ker_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> {a \<in> carrier A. f a = \<zero>\<^bsub>B\<^esub>} = {\<zero>\<^bsub>A\<^esub>}
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> {a \<in> carrier A. f a = \<zero>\<^bsub>B\<^esub>} \<subseteq> {\<zero>\<^bsub>A\<^esub>}
 2. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>A\<^esub>} \<subseteq> {a \<in> carrier A. f a = \<zero>\<^bsub>B\<^esub>}
[PROOF STEP]
apply (rule subsetI, simp, erule conjE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>; x \<in> carrier A; f x = \<zero>\<^bsub>B\<^esub>\<rbrakk> \<Longrightarrow> x = \<zero>\<^bsub>A\<^esub>
 2. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>A\<^esub>} \<subseteq> {a \<in> carrier A. f a = \<zero>\<^bsub>B\<^esub>}
[PROOF STEP]
apply (subgoal_tac "compos A g f x = aI\<^bsub>A\<^esub> x",
        thin_tac "compos A g f = aI\<^bsub>A\<^esub>")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; x \<in> carrier A; f x = \<zero>\<^bsub>B\<^esub>; compos A g f x = aI\<^bsub>A\<^esub> x\<rbrakk> \<Longrightarrow> x = \<zero>\<^bsub>A\<^esub>
 2. \<And>x. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>; x \<in> carrier A; f x = \<zero>\<^bsub>B\<^esub>\<rbrakk> \<Longrightarrow> compos A g f x = aI\<^bsub>A\<^esub> x
 3. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>A\<^esub>} \<subseteq> {a \<in> carrier A. f a = \<zero>\<^bsub>B\<^esub>}
[PROOF STEP]
apply (simp add:compos_def compose_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; x \<in> carrier A; f x = \<zero>\<^bsub>B\<^esub>; g \<zero>\<^bsub>B\<^esub> = aI\<^bsub>A\<^esub> x\<rbrakk> \<Longrightarrow> x = \<zero>\<^bsub>A\<^esub>
 2. \<And>x. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>; x \<in> carrier A; f x = \<zero>\<^bsub>B\<^esub>\<rbrakk> \<Longrightarrow> compos A g f x = aI\<^bsub>A\<^esub> x
 3. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>A\<^esub>} \<subseteq> {a \<in> carrier A. f a = \<zero>\<^bsub>B\<^esub>}
[PROOF STEP]
apply (simp add:aHom_0_0 ag_idmap_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>; x \<in> carrier A; f x = \<zero>\<^bsub>B\<^esub>\<rbrakk> \<Longrightarrow> compos A g f x = aI\<^bsub>A\<^esub> x
 2. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>A\<^esub>} \<subseteq> {a \<in> carrier A. f a = \<zero>\<^bsub>B\<^esub>}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>A\<^esub>} \<subseteq> {a \<in> carrier A. f a = \<zero>\<^bsub>B\<^esub>}
[PROOF STEP]
apply (rule subsetI, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>aGroup A; aGroup B; f \<in> aHom A B; g \<in> aHom B A; compos A g f = aI\<^bsub>A\<^esub>; x = \<zero>\<^bsub>A\<^esub>\<rbrakk> \<Longrightarrow> \<zero>\<^bsub>A\<^esub> \<in> carrier A \<and> f \<zero>\<^bsub>A\<^esub> = \<zero>\<^bsub>B\<^esub>
[PROOF STEP]
apply (simp add:aGroup.ag_inc_zero aHom_0_0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma basis_wf_insert_ln:
  assumes "basis_wf [b]"
  shows   "basis_wf [\<lambda>x. ln (b x)]" (is ?thesis1)
          "basis_wf [b, \<lambda>x. ln (b x)]" (is ?thesis2)
          "is_expansion (MS (MSLCons (1::real,1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]" (is ?thesis3)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_wf [\<lambda>x. ln (b x)] &&& basis_wf [b, \<lambda>x. ln (b x)] &&& is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. basis_wf [\<lambda>x. ln (b x)]
 2. basis_wf [b, \<lambda>x. ln (b x)]
 3. is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
have "ln \<in> o(\<lambda>x. x :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln \<in> o(\<lambda>x. x)
[PROOF STEP]
using ln_x_over_x_tendsto_0
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. ln x / x) \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. ln \<in> o(\<lambda>x. x)
[PROOF STEP]
by (intro smalloI_tendsto) auto
[PROOF STATE]
proof (state)
this:
ln \<in> o(\<lambda>x. x)

goal (3 subgoals):
 1. basis_wf [\<lambda>x. ln (b x)]
 2. basis_wf [b, \<lambda>x. ln (b x)]
 3. is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
basis_wf [b]
ln \<in> o(\<lambda>x. x)
[PROOF STEP]
show ?thesis1 ?thesis2
[PROOF STATE]
proof (prove)
using this:
basis_wf [b]
ln \<in> o(\<lambda>x. x)

goal (1 subgoal):
 1. basis_wf [\<lambda>x. ln (b x)] &&& basis_wf [b, \<lambda>x. ln (b x)]
[PROOF STEP]
by (auto simp: basis_wf_Cons
          intro!: landau_o.small.compose[of _ _ _ "\<lambda>x. ln (b x)"] filterlim_compose[OF ln_at_top])
[PROOF STATE]
proof (state)
this:
basis_wf [\<lambda>x. ln (b x)]
basis_wf [b, \<lambda>x. ln (b x)]

goal (1 subgoal):
 1. is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
basis_wf [b]
[PROOF STEP]
have b_limit: "filterlim b at_top at_top"
[PROOF STATE]
proof (prove)
using this:
basis_wf [b]

goal (1 subgoal):
 1. filterlim b at_top at_top
[PROOF STEP]
by (simp add: basis_wf_Cons)
[PROOF STATE]
proof (state)
this:
filterlim b at_top at_top

goal (1 subgoal):
 1. is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
hence ev: "eventually (\<lambda>x. b x > 1) at_top"
[PROOF STATE]
proof (prove)
using this:
filterlim b at_top at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 < b x
[PROOF STEP]
by (simp add: filterlim_at_top_dense)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 1 < b x

goal (1 subgoal):
 1. is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
have "(\<lambda>x::real. x) \<in> \<Theta>(\<lambda>x. x powr 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x) \<in> \<Theta>(\<lambda>x. x powr 1)
[PROOF STEP]
by (intro bigthetaI_cong eventually_mono[OF eventually_gt_at_top[of 0]]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x) \<in> \<Theta>(\<lambda>x. x powr 1)

goal (1 subgoal):
 1. is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x) \<in> \<Theta>(\<lambda>x. x powr 1)

goal (1 subgoal):
 1. is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
have "(\<lambda>x::real. x powr 1) \<in> o(\<lambda>a. a powr e)" if "e > 1" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x powr 1) \<in> o(\<lambda>a. a powr e)
[PROOF STEP]
by (subst powr_smallo_iff) (auto simp: that filterlim_ident)
[PROOF STATE]
proof (state)
this:
1 < ?e \<Longrightarrow> (\<lambda>x. x powr 1) \<in> o(\<lambda>a. a powr ?e)

goal (1 subgoal):
 1. is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 < ?e1 \<Longrightarrow> (\<lambda>x. x) \<in> o(\<lambda>a. a powr ?e1)
[PROOF STEP]
show ?thesis3
[PROOF STATE]
proof (prove)
using this:
1 < ?e1 \<Longrightarrow> (\<lambda>x. x) \<in> o(\<lambda>a. a powr ?e1)

goal (1 subgoal):
 1. is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
using assms ev
[PROOF STATE]
proof (prove)
using this:
1 < ?e1 \<Longrightarrow> (\<lambda>x. x) \<in> o(\<lambda>a. a powr ?e1)
basis_wf [b]
\<forall>\<^sub>F x in at_top. 1 < b x

goal (1 subgoal):
 1. is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
by (auto intro!: is_expansion_aux.intros landau_o.small.compose[of _ at_top _ "\<lambda>x. ln (b x)"]
                     filterlim_compose[OF ln_at_top b_limit] is_expansion_real.intros
             elim!: eventually_mono)
[PROOF STATE]
proof (state)
this:
is_expansion (MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cnf_form_of_cnf: "cnf (form_of_cnf S) = set (map set S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnf (form_of_cnf S) = set (map set S)
[PROOF STEP]
unfolding form_of_cnf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnf \<^bold>\<And>map disj_of_clause S = set (map set S)
[PROOF STEP]
by (simp add: cnf_BigAnd cnf_disj) blast


[STATEMENT]
lemma (in Corps) vp_mem_val_poss:"\<lbrakk> valuation K v; x \<in> carrier K\<rbrakk> \<Longrightarrow>
                                   (x \<in> vp K v) = (0 < (v x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier K\<rbrakk> \<Longrightarrow> (x \<in> vp K v) = (0 < v x)
[PROOF STEP]
by (simp add:vp_def, simp add:Vr_def Sr_def less_ant_def)


[STATEMENT]
lemma Cons_mem_set_subseqs_Cons:
  "y#ys \<in> set (subseqs (x#xs)) \<longleftrightarrow> (y = x \<and> ys \<in> set (subseqs xs)) \<or> y#ys \<in> set (subseqs xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y # ys \<in> set (subseqs (x # xs))) = (y = x \<and> ys \<in> set (subseqs xs) \<or> y # ys \<in> set (subseqs xs))
[PROOF STEP]
by auto


[STATEMENT]
lemma homogeneous_set_IntI: "homogeneous_set A \<Longrightarrow> homogeneous_set B \<Longrightarrow> homogeneous_set (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>homogeneous_set A; homogeneous_set B\<rbrakk> \<Longrightarrow> homogeneous_set (A \<inter> B)
[PROOF STEP]
by (simp add: homogeneous_set_def)


[STATEMENT]
lemma rel_frontier_frontier:
  fixes S :: "'n::euclidean_space set"
  shows "affine hull S = UNIV \<Longrightarrow> rel_frontier S = frontier S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull S = UNIV \<Longrightarrow> rel_frontier S = frontier S
[PROOF STEP]
by (simp add: frontier_def rel_frontier_def rel_interior_interior)


[STATEMENT]
lemma triangularizable_0n:
assumes A: "A \<in> carrier_mat 0 n"
shows "\<exists>U. U \<in> carrier_mat n n \<and> invertible_mat U \<and> lower_triangular (A * U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>U. U \<in> carrier_mat n n \<and> invertible_mat U \<and> lower_triangular (A * U)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat 0 n

goal (1 subgoal):
 1. \<exists>U. U \<in> carrier_mat n n \<and> invertible_mat U \<and> lower_triangular (A * U)
[PROOF STEP]
unfolding lower_triangular_def carrier_mat_def invertible_mat_def inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
A \<in> {m. dim_row m = 0 \<and> dim_col m = n}

goal (1 subgoal):
 1. \<exists>U. U \<in> {m. dim_row m = n \<and> dim_col m = n} \<and> (square_mat U \<and> (\<exists>B. U * B = 1\<^sub>m (dim_row U) \<and> B * U = 1\<^sub>m (dim_row B))) \<and> (\<forall>i j. i < j \<and> i < dim_row (A * U) \<and> j < dim_col (A * U) \<longrightarrow> (A * U) $$ (i, j) = (0::'b))
[PROOF STEP]
by auto (metis index_one_mat(2) index_one_mat(3) right_mult_one_mat')


[STATEMENT]
lemma convex_linear_image_eq [simp]:
    fixes f :: "'a::real_vector \<Rightarrow> 'b::real_vector"
    shows "\<lbrakk>linear f; inj f\<rbrakk> \<Longrightarrow> convex (f ` s) \<longleftrightarrow> convex s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>linear f; inj f\<rbrakk> \<Longrightarrow> convex (f ` s) = convex s
[PROOF STEP]
by (metis (no_types) convex_linear_image convex_linear_vimage inj_vimage_image_eq)


[STATEMENT]
lemma \<pi>_\<theta>_bigo: "(\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(\<lambda>x. x / ln x ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(\<lambda>x. x / (ln x)\<^sup>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(\<lambda>x. x / (ln x)\<^sup>2)
[PROOF STEP]
define ub where "ub = (\<lambda>x. 2 / ln 2 * sqrt x + 8 * ln 2 * x / ln x ^ 2)"
[PROOF STATE]
proof (state)
this:
ub = (\<lambda>x. 2 / ln 2 * sqrt x + 8 * ln 2 * x / (ln x)\<^sup>2)

goal (1 subgoal):
 1. (\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(\<lambda>x. x / (ln x)\<^sup>2)
[PROOF STEP]
have "(\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(ub)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(ub)
[PROOF STEP]
proof (intro le_imp_bigo_real[of 1] eventually_mono[OF eventually_ge_at_top])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 \<le> 1
 2. \<And>x. ?c4 \<le> x \<Longrightarrow> \<pi> x - \<theta> x / ln x \<le> 1 * ub x
 3. \<And>x. ?c2 \<le> x \<Longrightarrow> 0 \<le> \<pi> x - \<theta> x / ln x
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 \<le> 1
 2. \<And>x. ?c4 \<le> x \<Longrightarrow> \<pi> x - \<theta> x / ln x \<le> 1 * ub x
 3. \<And>x. ?c2 \<le> x \<Longrightarrow> 0 \<le> \<pi> x - \<theta> x / ln x
[PROOF STEP]
assume "x \<ge> 4"
[PROOF STATE]
proof (state)
this:
4 \<le> x

goal (3 subgoals):
 1. 0 \<le> 1
 2. \<And>x. ?c4 \<le> x \<Longrightarrow> \<pi> x - \<theta> x / ln x \<le> 1 * ub x
 3. \<And>x. ?c2 \<le> x \<Longrightarrow> 0 \<le> \<pi> x - \<theta> x / ln x
[PROOF STEP]
from \<pi>_\<theta>_bound[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<pi> x - \<theta> x / ln x \<in> {0..2 / ln 2 * sqrt x + 8 * ln 2 * x / (ln x)\<^sup>2}
[PROOF STEP]
show "\<pi> x - \<theta> x / ln x \<ge> 0" and "\<pi> x - \<theta> x / ln x \<le> 1 * ub x"
[PROOF STATE]
proof (prove)
using this:
\<pi> x - \<theta> x / ln x \<in> {0..2 / ln 2 * sqrt x + 8 * ln 2 * x / (ln x)\<^sup>2}

goal (1 subgoal):
 1. 0 \<le> \<pi> x - \<theta> x / ln x &&& \<pi> x - \<theta> x / ln x \<le> 1 * ub x
[PROOF STEP]
by (simp_all add: ub_def)
[PROOF STATE]
proof (state)
this:
0 \<le> \<pi> x - \<theta> x / ln x
\<pi> x - \<theta> x / ln x \<le> 1 * ub x

goal (1 subgoal):
 1. 0 \<le> 1
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(ub)

goal (1 subgoal):
 1. (\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(\<lambda>x. x / (ln x)\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(ub)

goal (1 subgoal):
 1. (\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(\<lambda>x. x / (ln x)\<^sup>2)
[PROOF STEP]
have "ub \<in> O(\<lambda>x. x / ln x ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ub \<in> O(\<lambda>x. x / (ln x)\<^sup>2)
[PROOF STEP]
unfolding ub_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. 2 / ln 2 * sqrt x + 8 * ln 2 * x / (ln x)\<^sup>2) \<in> O(\<lambda>x. x / (ln x)\<^sup>2)
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
ub \<in> O(\<lambda>x. x / (ln x)\<^sup>2)

goal (1 subgoal):
 1. (\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(\<lambda>x. x / (ln x)\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(\<lambda>x. x / (ln x)\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(\<lambda>x. x / (ln x)\<^sup>2)

goal (1 subgoal):
 1. (\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(\<lambda>x. x / (ln x)\<^sup>2)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<pi> x - \<theta> x / ln x) \<in> O(\<lambda>x. x / (ln x)\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dist_add_cancel2 [simp]: "dist (b + a) (c + a) = dist b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (b + a) (c + a) = dist b c
[PROOF STEP]
by (simp add: dist_norm)


[STATEMENT]
lemma openin_relative_to: "(openin X relative_to S) = openin (subtopology X S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin X relative_to S = openin (subtopology X S)
[PROOF STEP]
by (force simp: relative_to_def openin_subtopology)


[STATEMENT]
lemma arccos_cos2: "x \<le> 0 \<Longrightarrow> - pi \<le> x \<Longrightarrow> arccos (cos x) = -x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> 0; - pi \<le> x\<rbrakk> \<Longrightarrow> arccos (cos x) = - x
[PROOF STEP]
by (auto simp: arccos_def intro!: the1_equality cos_total)


[STATEMENT]
lemma finiteFinestpart:
  "finite (finestpart X) = finite X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (finestpart X) = finite X
[PROOF STEP]
using finestpart_def lm071
[PROOF STATE]
proof (prove)
using this:
finestpart ?X = (\<lambda>x. {x}) ` ?X
finestpart {} = {} \<and> card \<circ> finestpart = card

goal (1 subgoal):
 1. finite (finestpart X) = finite X
[PROOF STEP]
by (metis card_eq_0_iff empty_is_image finite.simps cardFinestpart)


[STATEMENT]
lemma sum_mset_0_iff_ge_0:
  assumes "(\<And> x . f x \<ge> 0)"
  shows "(\<Sum> x \<in># A. f x ) = 0 \<longleftrightarrow> (\<forall> x \<in> set_mset A .f x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub># (image_mset f A) = (0::'a)) = (\<forall>x\<in>#A. f x = (0::'a))
[PROOF STEP]
using sum_mset_0_left assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. (0::'a) \<le> ?f x; \<Sum>\<^sub># (image_mset ?f ?A) = (0::'a)\<rbrakk> \<Longrightarrow> \<forall>x\<in>#?A. ?f x = (0::'a)
(0::'a) \<le> f ?x1

goal (1 subgoal):
 1. (\<Sum>\<^sub># (image_mset f A) = (0::'a)) = (\<forall>x\<in>#A. f x = (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
theorem (in finite_alphabet) rtl_empty[simp, intro!]: "{} \<in> regular_languages A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {} \<in> regular_languages A
[PROOF STEP]
by (rule ranked_tree_automaton.rtlI[OF ta_empty_rta, simplified])


[STATEMENT]
lemma lfp_in_Fix:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  shows "mono f \<Longrightarrow> lfp f \<in> Fix f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> lfp f \<in> Fix f
[PROOF STEP]
by (metis (mono_tags, lifting) Fix_def lfp_unfold mem_Collect_eq)


[STATEMENT]
lemma bigo_const_inverse [simp]:
  assumes "filterlim f at_top F" "F \<noteq> bot"
  shows "(\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x) :: real) \<longleftrightarrow> c = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
assume A: "(\<lambda>_. 1) \<in> O[F](\<lambda>x. inverse (f x))"
[PROOF STATE]
proof (state)
this:
(\<lambda>_. 1) \<in> O[F](\<lambda>x. inverse (f x))

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top F
F \<noteq> bot
[PROOF STEP]
have "(\<lambda>_. 1) \<in> o[F](f)"
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top F
F \<noteq> bot

goal (1 subgoal):
 1. (\<lambda>_. 1) \<in> o[F](f)
[PROOF STEP]
by (simp add: eventually_nonzero_simps smallomega_iff_smallo filterlim_at_top_iff_smallomega)
[PROOF STATE]
proof (state)
this:
(\<lambda>_. 1) \<in> o[F](f)

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>_. 1) \<in> o[F](f)

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
from assms A
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top F
F \<noteq> bot
(\<lambda>_. 1) \<in> O[F](\<lambda>x. inverse (f x))
[PROOF STEP]
have "f \<in> O[F](\<lambda>_. 1)"
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top F
F \<noteq> bot
(\<lambda>_. 1) \<in> O[F](\<lambda>x. inverse (f x))

goal (1 subgoal):
 1. f \<in> O[F](\<lambda>_. 1)
[PROOF STEP]
by (simp add: eventually_nonzero_simps landau_divide_simps)
[PROOF STATE]
proof (state)
this:
f \<in> O[F](\<lambda>_. 1)

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>_. 1) \<in> o[F](\<lambda>_. 1)
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
(\<lambda>_. 1) \<in> o[F](\<lambda>_. 1)

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>_. 1) \<in> o[F](\<lambda>_. 1)
filterlim f at_top F
F \<noteq> bot

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

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(\<lambda>_. 1) \<in> O[F](\<lambda>x. inverse (f x)) \<Longrightarrow> False

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>_. 1) \<in> O[F](\<lambda>x. inverse (f x)) \<Longrightarrow> False

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
by (cases "c = 0") auto
[PROOF STATE]
proof (state)
this:
((\<lambda>_. c) \<in> O[F](\<lambda>x. inverse (f x))) = (c = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma supporting_hyperplane_relative_frontier:
  fixes S :: "'a::euclidean_space set"
  assumes "convex S" "x \<in> closure S" "x \<notin> rel_interior S"
  obtains a where "a \<noteq> 0"
              and "\<And>y. y \<in> closure S \<Longrightarrow> a \<bullet> x \<le> a \<bullet> y"
              and "\<And>y. y \<in> rel_interior S \<Longrightarrow> a \<bullet> x < a \<bullet> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<noteq> (0::'a); \<And>y. y \<in> closure S \<Longrightarrow> a \<bullet> x \<le> a \<bullet> y; \<And>y. y \<in> rel_interior S \<Longrightarrow> a \<bullet> x < a \<bullet> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using supporting_hyperplane_rel_boundary [of "closure S" x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>convex (closure S); x \<in> closure S; x \<notin> rel_interior (closure S); \<And>a. \<lbrakk>a \<noteq> (0::'a); \<And>y. y \<in> closure S \<Longrightarrow> a \<bullet> x \<le> a \<bullet> y; \<And>y. y \<in> rel_interior (closure S) \<Longrightarrow> a \<bullet> x < a \<bullet> y\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<noteq> (0::'a); \<And>y. y \<in> closure S \<Longrightarrow> a \<bullet> x \<le> a \<bullet> y; \<And>y. y \<in> rel_interior S \<Longrightarrow> a \<bullet> x < a \<bullet> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms convex_closure convex_rel_interior_closure)


[STATEMENT]
lemma "dist x y \<le> e \<Longrightarrow> dist x z \<le> e \<Longrightarrow> dist y z \<le> e
  \<Longrightarrow> p \<in> (cball x e \<union> cball y e \<union> cball z e) \<Longrightarrow> dist p x \<le> 2*e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dist x y \<le> e; dist x z \<le> e; dist y z \<le> e; p \<in> cball x e \<union> cball y e \<union> cball z e\<rbrakk> \<Longrightarrow> dist p x \<le> 2 * e
[PROOF STEP]
by metric


[STATEMENT]
lemma iffb_inf_dual:
  assumes "Inf_pres \<phi>"
  and "Inf_pres \<psi>"
shows "fb\<^sup>-\<^sub>\<F> (\<phi> \<sqinter> \<psi>) = fb\<^sup>-\<^sub>\<F> \<phi> \<squnion> fb\<^sup>-\<^sub>\<F> \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fb\<^sup>-\<^sub>\<F> (\<phi> \<sqinter> \<psi>) = fb\<^sup>-\<^sub>\<F> \<phi> \<squnion> fb\<^sup>-\<^sub>\<F> \<psi>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fb\<^sup>-\<^sub>\<F> (\<phi> \<sqinter> \<psi>) = fb\<^sup>-\<^sub>\<F> \<phi> \<squnion> fb\<^sup>-\<^sub>\<F> \<psi>
[PROOF STEP]
have f1: "\<phi> \<sqinter> \<psi> = fb\<^sub>\<F> (fb\<^sup>-\<^sub>\<F> \<phi>) \<sqinter> fb\<^sub>\<F> (fb\<^sup>-\<^sub>\<F> \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> \<sqinter> \<psi> = fb\<^sub>\<F> (fb\<^sup>-\<^sub>\<F> \<phi>) \<sqinter> fb\<^sub>\<F> (fb\<^sup>-\<^sub>\<F> \<psi>)
[PROOF STEP]
using assms iffb_inv2
[PROOF STATE]
proof (prove)
using this:
Inf_pres \<phi>
Inf_pres \<psi>
Inf_pres ?\<phi> \<Longrightarrow> (fb\<^sub>\<F> \<circ> fb\<^sup>-\<^sub>\<F>) ?\<phi> = ?\<phi>

goal (1 subgoal):
 1. \<phi> \<sqinter> \<psi> = fb\<^sub>\<F> (fb\<^sup>-\<^sub>\<F> \<phi>) \<sqinter> fb\<^sub>\<F> (fb\<^sup>-\<^sub>\<F> \<psi>)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<phi> \<sqinter> \<psi> = fb\<^sub>\<F> (fb\<^sup>-\<^sub>\<F> \<phi>) \<sqinter> fb\<^sub>\<F> (fb\<^sup>-\<^sub>\<F> \<psi>)

goal (1 subgoal):
 1. fb\<^sup>-\<^sub>\<F> (\<phi> \<sqinter> \<psi>) = fb\<^sup>-\<^sub>\<F> \<phi> \<squnion> fb\<^sup>-\<^sub>\<F> \<psi>
[PROOF STEP]
have "\<phi> \<sqinter> \<psi> \<circ> Inter = Inter \<circ> \<P> (\<phi> \<sqinter> \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_pres (\<phi> \<sqinter> \<psi>)
[PROOF STEP]
using assms Inf_pres_inf
[PROOF STATE]
proof (prove)
using this:
Inf_pres \<phi>
Inf_pres \<psi>
\<lbrakk>Inf_pres ?f; Inf_pres ?g\<rbrakk> \<Longrightarrow> Inf_pres (?f \<sqinter> ?g)

goal (1 subgoal):
 1. Inf_pres (\<phi> \<sqinter> \<psi>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Inf_pres (\<phi> \<sqinter> \<psi>)

goal (1 subgoal):
 1. fb\<^sup>-\<^sub>\<F> (\<phi> \<sqinter> \<psi>) = fb\<^sup>-\<^sub>\<F> \<phi> \<squnion> fb\<^sup>-\<^sub>\<F> \<psi>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Inf_pres (\<phi> \<sqinter> \<psi>)

goal (1 subgoal):
 1. fb\<^sup>-\<^sub>\<F> (\<phi> \<sqinter> \<psi>) = fb\<^sup>-\<^sub>\<F> \<phi> \<squnion> fb\<^sup>-\<^sub>\<F> \<psi>
[PROOF STEP]
by (simp add: f1 ffb_iffb_galois ffb_sup_dual)
[PROOF STATE]
proof (state)
this:
fb\<^sup>-\<^sub>\<F> (\<phi> \<sqinter> \<psi>) = fb\<^sup>-\<^sub>\<F> \<phi> \<squnion> fb\<^sup>-\<^sub>\<F> \<psi>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  det_eq_0_rank:
  fixes A :: "real^'n^'n"
  shows "det A = 0 \<longleftrightarrow> rank A < CARD('n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (det A = 0) = (rank A < CARD('n))
[PROOF STEP]
using invertible_det_nz [of A]
[PROOF STATE]
proof (prove)
using this:
invertible A = (det A \<noteq> 0)

goal (1 subgoal):
 1. (det A = 0) = (rank A < CARD('n))
[PROOF STEP]
by (auto simp: matrix_left_invertible_injective invertible_left_inverse less_rank_noninjective)


[STATEMENT]
lemma imp_dfa_accepts:
  assumes "wf_dfa M n" and "wf_dfa N n"
  and "list_all (is_alph n) bs"
  shows "dfa_accepts (imp_dfa M N) bs = (dfa_accepts M bs \<longrightarrow> dfa_accepts N bs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dfa_accepts (imp_dfa M N) bs = (dfa_accepts M bs \<longrightarrow> dfa_accepts N bs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wf_dfa M n
wf_dfa N n
list_all (is_alph n) bs

goal (1 subgoal):
 1. dfa_accepts (imp_dfa M N) bs = (dfa_accepts M bs \<longrightarrow> dfa_accepts N bs)
[PROOF STEP]
by (auto simp add: binop_dfa_accepts imp_dfa_def)


[STATEMENT]
lemma eexp_add: "\<not> ((x = \<infinity> \<and> y = -\<infinity>) \<or> (x = -\<infinity> \<and> y = \<infinity>)) \<Longrightarrow> eexp (x + y) = eexp x * eexp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (x = \<infinity> \<and> y = - \<infinity> \<or> x = - \<infinity> \<and> y = \<infinity>) \<Longrightarrow> eexp (x + y) = eexp x * eexp y
[PROOF STEP]
by (cases x; cases y; simp add: exp_add ennreal_mult ennreal_top_mult ennreal_mult_top)


[STATEMENT]
lemma approx_mult_star_of: "a \<approx> star_of b \<Longrightarrow> c \<approx> star_of d \<Longrightarrow> a * c \<approx> star_of b * star_of d"
  for a c :: "'a::real_normed_algebra star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<approx> star_of b; c \<approx> star_of d\<rbrakk> \<Longrightarrow> a * c \<approx> star_of b * star_of d
[PROOF STEP]
by (blast intro!: approx_mult_HFinite approx_star_of_HFinite HFinite_star_of)


[STATEMENT]
lemma moebius_pt_comp_inv_image_right [simp]:
  shows "moebius_pt M ` moebius_pt (moebius_inv M) ` A = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt M ` moebius_pt (moebius_inv M) ` A = A
[PROOF STEP]
by force


[STATEMENT]
lemma zhmset_neg_as_pos: "zhmset_of (hmset_neg M) = zhmset_of (hmset_pos M) - M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zhmset_of (hmset_neg M) = zhmset_of (hmset_pos M) - M
[PROOF STEP]
using zhmsetmset_diff mset_neg_as_pos zhmsetmset_inject
[PROOF STATE]
proof (prove)
using this:
zhmsetmset (?x - ?xa) = zhmsetmset ?x - zhmsetmset ?xa
zmset_of (mset_neg ?M) = zmset_of (mset_pos ?M) - ?M
(zhmsetmset ?x = zhmsetmset ?y) = (?x = ?y)

goal (1 subgoal):
 1. zhmset_of (hmset_neg M) = zhmset_of (hmset_pos M) - M
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Gromov_extension_quasi_isometry_boundary_to_boundary:
  fixes f::"'a::Gromov_hyperbolic_space_geodesic \<Rightarrow> 'b::Gromov_hyperbolic_space_geodesic"
  assumes "lambda C-quasi_isometry f"
          "x \<in> Gromov_boundary"
  shows "(Gromov_extension f) x \<in> Gromov_boundary"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_extension f x \<in> Gromov_boundary
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gromov_extension f x \<in> Gromov_boundary
[PROOF STEP]
have *: "Gromov_converging_at_boundary (\<lambda>n. f (rep_Gromov_completion x n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_converging_at_boundary (\<lambda>n. f (rep_Gromov_completion x n))
[PROOF STEP]
by (simp add: Gromov_converging_at_infinity_quasi_isometry[OF assms(1)] Gromov_boundary_rep_converging assms(2))
[PROOF STATE]
proof (state)
this:
Gromov_converging_at_boundary (\<lambda>n. f (rep_Gromov_completion x n))

goal (1 subgoal):
 1. Gromov_extension f x \<in> Gromov_boundary
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_extension f x \<in> Gromov_boundary
[PROOF STEP]
unfolding Gromov_extension_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x \<in> Gromov_boundary then lim (to_Gromov_completion \<circ> f \<circ> rep_Gromov_completion x) else to_Gromov_completion (f (from_Gromov_completion x))) \<in> Gromov_boundary
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
x \<in> Gromov_boundary

goal (1 subgoal):
 1. (if x \<in> Gromov_boundary then lim (to_Gromov_completion \<circ> f \<circ> rep_Gromov_completion x) else to_Gromov_completion (f (from_Gromov_completion x))) \<in> Gromov_boundary
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
using this:
x \<in> Gromov_boundary

goal (1 subgoal):
 1. (if x \<in> Gromov_boundary then lim (\<lambda>xa. to_Gromov_completion (f (rep_Gromov_completion x xa))) else to_Gromov_completion (f (from_Gromov_completion x))) \<in> Gromov_boundary
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> Gromov_boundary \<Longrightarrow> lim (\<lambda>xa. to_Gromov_completion (f (rep_Gromov_completion x xa))) \<in> Gromov_boundary
[PROOF STEP]
by (metis Gromov_converging_at_boundary_converges * limI)
[PROOF STATE]
proof (state)
this:
Gromov_extension f x \<in> Gromov_boundary

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_ln_powr_over_x:
  "y \<noteq> -1 \<Longrightarrow> a \<le> b \<Longrightarrow> a > 1 \<Longrightarrow> integral {a..b} (\<lambda>x. ln x powr y / x :: real) =
     inverse (y + 1) * (ln b powr (y + 1) - ln a powr (y + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<noteq> - 1; a \<le> b; 1 < a\<rbrakk> \<Longrightarrow> integral {a..b} (\<lambda>x. ln x powr y / x) = inverse (y + 1) * (ln b powr (y + 1) - ln a powr (y + 1))
[PROOF STEP]
by (subst right_diff_distrib, intro integral_unique fundamental_theorem_of_calculus_real)
     (auto intro!: derivative_eq_intros)


[STATEMENT]
lemma "!!a::int. [| a+b+c+d <= i+j+k+l; a<=b; b<=c; c<=d; i<=j; j<=k; k<=l |]
      ==> 6*a <= 5*l+i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a + b + c + d \<le> i + j + k + l; a \<le> b; b \<le> c; c \<le> d; i \<le> j; j \<le> k; k \<le> l\<rbrakk> \<Longrightarrow> 6 * a \<le> 5 * l + i
[PROOF STEP]
by arith


[STATEMENT]
lemma (in comm_group) finite_sub_comp_iff_card_eq_mult:
  assumes "subgroup H G" "subgroup J G" "finite H" "finite J"
  shows "card (H <#> J) = card J * card H  \<longleftrightarrow> complementary H J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card (H <#> J) = card J * card H) = complementary H J
[PROOF STEP]
using finite_sub_comp_imp_card_eq_mult[OF assms] finite_sub_card_eq_mult_imp_comp[OF assms]
[PROOF STATE]
proof (prove)
using this:
complementary H J \<Longrightarrow> card (H <#> J) = card J * card H
card (H <#> J) = card J * card H \<Longrightarrow> complementary H J

goal (1 subgoal):
 1. (card (H <#> J) = card J * card H) = complementary H J
[PROOF STEP]
by blast


[STATEMENT]
lemma prod_lb:
  "\<lbrakk> (\<forall>w\<in>X. m \<le> length w); (\<forall>w\<in>Y. n \<le> length w) \<rbrakk> \<Longrightarrow> (\<forall>w\<in>(X\<cdot>Y). (m+n) \<le> length w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>w\<in>X. m \<le> |w|; \<forall>w\<in>Y. n \<le> |w|\<rbrakk> \<Longrightarrow> \<forall>w\<in>X \<cdot> Y. m + n \<le> |w|
[PROOF STEP]
by (metis l_prod_elim add_le_mono length_append)


[STATEMENT]
lemma ennreal_tendsto_top_eq_at_top:
  "((\<lambda>z. ennreal (f z)) \<longlongrightarrow> top) F \<longleftrightarrow> (LIM z F. f z :> at_top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. ennreal (f z)) \<longlongrightarrow> top) F = filterlim f at_top F
[PROOF STEP]
unfolding filterlim_at_top_dense tendsto_top_iff_ennreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>l\<ge>0. \<forall>\<^sub>F x in F. ennreal l < ennreal (f x)) = (\<forall>Z. \<forall>\<^sub>F x in F. Z < f x)
[PROOF STEP]
apply (auto simp: ennreal_less_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Z. \<forall>l\<ge>0. \<forall>\<^sub>F x in F. l < f x \<Longrightarrow> \<forall>\<^sub>F x in F. Z < f x
[PROOF STEP]
subgoal for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>l\<ge>0. \<forall>\<^sub>F x in F. l < f x \<Longrightarrow> \<forall>\<^sub>F x in F. y < f x
[PROOF STEP]
by (auto elim!: eventually_mono allE[of _ "max 0 y"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma refinement_transitive:
  "\<lbrakk> refines R1 pi1 S1 S2; refines R2 pi2 S2 S3 \<rbrakk>
  \<Longrightarrow> refines (R1 O R2) (pi1 o pi2) S1 S3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>refines R1 pi1 S1 S2; refines R2 pi2 S2 S3\<rbrakk> \<Longrightarrow> refines (R1 O R2) (pi1 \<circ> pi2) S1 S3
[PROOF STEP]
apply (auto simp add: refines_defs del: subsetI intro: rhoare_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>obs_consistent R1 pi1 S1 S2; obs_consistent R2 pi2 S2 S3; init S2 \<subseteq> R1 `` init S1; {R1} TS.trans S1, TS.trans S2 {> R1}; init S3 \<subseteq> R2 `` init S2; {R2} TS.trans S2, TS.trans S3 {> R2}\<rbrakk> \<Longrightarrow> init S3 \<subseteq> R2 `` R1 `` init S1
[PROOF STEP]
apply (fastforce dest: Image_mono)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma subseq_from_cnf_less_eq: "Sublist.subseq ks ls \<Longrightarrow> from_cnf ks \<le> from_cnf ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subseq ks ls \<Longrightarrow> from_cnf ks \<le> from_cnf ls
[PROOF STEP]
by (induct rule: list_emb.induct) (auto intro: ordinal_le_plusL order_trans)


[STATEMENT]
lemma mult_vec_zero_left: "0 ** p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 ** p = 0
[PROOF STEP]
by (rule poly_mapping_eqI_proj, simp add: term_simps)


[STATEMENT]
lemma span_Set_Monad[code]: "Span_code (Set_Monad l) = (SPAN (map vec_of_ell2 l))"
  \<comment> \<open>Code equation for the span of a finite set. (\<^term>\<open>Set_Monad\<close> is a datatype
     constructor that represents sets as lists in the computation.)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Span_code (Set_Monad l) = SPAN (map vec_of_ell2 l)
[PROOF STEP]
apply (simp add: Span_code_def SPAN_def Let_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan (set l) = ccspan (basis_enum_of_vec ` Set.filter (\<lambda>v. dim_vec v = CARD('a)) (vec_of_ell2 ` set l))
[PROOF STEP]
apply (subst Set_filter_unchanged)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> vec_of_ell2 ` set l \<Longrightarrow> dim_vec x = CARD('a)
 2. ccspan (set l) = ccspan (basis_enum_of_vec ` vec_of_ell2 ` set l)
[PROOF STEP]
apply (auto simp add: vec_of_ell2_def)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan (set l) = ccspan (basis_enum_of_vec ` vec_of_ell2 ` set l)
[PROOF STEP]
by (metis (no_types, lifting) ell2_of_vec_def image_image map_idI set_map vec_of_ell2_inverse)


[STATEMENT]
lemma sorted_splay:
  "sorted(inorder t) \<Longrightarrow> splay x t = Node l a r \<Longrightarrow>
  sorted(inorder l @ x # inorder r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted (inorder t); splay x t = \<langle>l, a, r\<rangle>\<rbrakk> \<Longrightarrow> Sorted_Less.sorted (inorder l @ x # inorder r)
[PROOF STEP]
unfolding inorder_splay[of x t, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted (inorder (splay x t)); splay x t = \<langle>l, a, r\<rangle>\<rbrakk> \<Longrightarrow> Sorted_Less.sorted (inorder l @ x # inorder r)
[PROOF STEP]
by(induction x t arbitrary: l a r rule: splay.induct)
  (auto simp: sorted_lems sorted_Cons_le sorted_snoc_le split: tree.splits)


[STATEMENT]
lemma forall_3': "(\<forall>i::3. P i) \<longleftrightarrow> P 0 \<and> P 1 \<and> P 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i. P i) = (P 0 \<and> P 1 \<and> P 2)
[PROOF STEP]
using forall_3 three_eq_zero
[PROOF STATE]
proof (prove)
using this:
(\<forall>i. ?P i) = (?P 1 \<and> ?P 2 \<and> ?P 3)
3 = 0

goal (1 subgoal):
 1. (\<forall>i. P i) = (P 0 \<and> P 1 \<and> P 2)
[PROOF STEP]
by auto


[STATEMENT]
lemma degree_pCons_eq_if [simp]: "degree (pCons a p) = (if p = 0 then 0 else Suc (degree p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (pCons a p) = (if p = 0 then 0 else Suc (degree p))
[PROOF STEP]
by (simp add: degree_pCons_0 degree_pCons_eq)


[STATEMENT]
lemma deg_fun_leq:
  assumes "finite (supp_fun s)" and "finite (supp_fun t)" and "s \<le> (t::'a \<Rightarrow> 'b::ordered_comm_monoid_add)"
  shows "deg_fun s \<le> deg_fun t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_fun s \<le> deg_fun t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deg_fun s \<le> deg_fun t
[PROOF STEP]
let ?A = "supp_fun s \<union> supp_fun t"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deg_fun s \<le> deg_fun t
[PROOF STEP]
from assms(1) assms(2)
[PROOF STATE]
proof (chain)
picking this:
finite (supp_fun s)
finite (supp_fun t)
[PROOF STEP]
have 1: "finite ?A"
[PROOF STATE]
proof (prove)
using this:
finite (supp_fun s)
finite (supp_fun t)

goal (1 subgoal):
 1. finite (supp_fun s \<union> supp_fun t)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (supp_fun s \<union> supp_fun t)

goal (1 subgoal):
 1. deg_fun s \<le> deg_fun t
[PROOF STEP]
have s: "supp_fun s \<subseteq> ?A" and t: "supp_fun t \<subseteq> ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp_fun s \<subseteq> supp_fun s \<union> supp_fun t &&& supp_fun t \<subseteq> supp_fun s \<union> supp_fun t
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
supp_fun s \<subseteq> supp_fun s \<union> supp_fun t
supp_fun t \<subseteq> supp_fun s \<union> supp_fun t

goal (1 subgoal):
 1. deg_fun s \<le> deg_fun t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_fun s \<le> deg_fun t
[PROOF STEP]
unfolding deg_fun_superset[OF s 1] deg_fun_superset[OF t 1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum s (supp_fun s \<union> supp_fun t) \<le> sum t (supp_fun s \<union> supp_fun t)
[PROOF STEP]
proof (rule sum_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> supp_fun s \<union> supp_fun t \<Longrightarrow> s i \<le> t i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> supp_fun s \<union> supp_fun t \<Longrightarrow> s i \<le> t i
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
s \<le> t
[PROOF STEP]
show "s i \<le> t i"
[PROOF STATE]
proof (prove)
using this:
s \<le> t

goal (1 subgoal):
 1. s i \<le> t i
[PROOF STEP]
unfolding le_fun_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. s x \<le> t x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
deg_fun s \<le> deg_fun t

goal:
No subgoals!
[PROOF STEP]
qed