[STATEMENT]
lemma composite_aux:
  assumes "\<not>prime n"
  shows   "measure_pmf.expectation (primality_test P n) of_bool < q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation (primality_test P n) of_bool < q
[PROOF STEP]
unfolding primality_test_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation (if n < 3 \<or> even n then return_pmf (n = 2) else pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (P n a))) of_bool < q
[PROOF STEP]
using assms composite_witness_bound q_pos
[PROOF STATE]
proof (prove)
using this:
\<not> prime n
\<lbrakk>\<not> prime n; 2 < n; odd n\<rbrakk> \<Longrightarrow> real (card {a. 2 \<le> a \<and> a < n \<and> P n a}) < q * real (n - 2)
0 < q

goal (1 subgoal):
 1. measure_pmf.expectation (if n < 3 \<or> even n then return_pmf (n = 2) else pmf_of_set {2..<n} \<bind> (\<lambda>a. return_pmf (P n a))) of_bool < q
[PROOF STEP]
by (clarsimp simp add: pmf_expectation_bind[where A = "{2..< n}"] sum_of_bool_eq_card field_simps Int_def
    simp flip: sum_divide_distrib)


[STATEMENT]
lemma root_cancel: "0 < d ==> root (d * n) ^ (d * k) = root n ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < d \<Longrightarrow> FFT.root (d * n) ^ (d * k) = FFT.root n ^ k
[PROOF STEP]
apply (unfold root_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < d \<Longrightarrow> cis (2 * pi / real (d * n)) ^ (d * k) = cis (2 * pi / real n) ^ k
[PROOF STEP]
apply (simp add: DeMoivre)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma of_nat_gt_0: "of_nat k \<noteq> 0 \<Longrightarrow> 0 < k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat k \<noteq> (0::'a) \<Longrightarrow> 0 < k
[PROOF STEP]
by (cases k) auto


[STATEMENT]
lemma "\<forall>x y::int. x < y \<longrightarrow> (2 * x + 1) < (2 * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x < y \<longrightarrow> 2 * x + 1 < 2 * y
[PROOF STEP]
by smt


[STATEMENT]
lemma rel_pmf_antisym:
  fixes p q :: "'a pmf"
  assumes 1: "rel_pmf R p q"
  assumes 2: "rel_pmf R q p"
  and refl: "reflp R" and trans: "transp R" and antisym: "antisymp R"
  shows "p = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p = q
[PROOF STEP]
from 1 2 refl trans
[PROOF STATE]
proof (chain)
picking this:
rel_pmf R p q
rel_pmf R q p
reflp R
transp R
[PROOF STEP]
have "rel_pmf (inf R R\<inverse>\<inverse>) p q"
[PROOF STATE]
proof (prove)
using this:
rel_pmf R p q
rel_pmf R q p
reflp R
transp R

goal (1 subgoal):
 1. rel_pmf (inf R R\<inverse>\<inverse>) p q
[PROOF STEP]
by(rule rel_pmf_inf)
[PROOF STATE]
proof (state)
this:
rel_pmf (inf R R\<inverse>\<inverse>) p q

goal (1 subgoal):
 1. p = q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rel_pmf (inf R R\<inverse>\<inverse>) p q

goal (1 subgoal):
 1. p = q
[PROOF STEP]
have "inf R R\<inverse>\<inverse> = (=)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf R R\<inverse>\<inverse> = (=)
[PROOF STEP]
using refl antisym
[PROOF STATE]
proof (prove)
using this:
reflp R
antisymp R

goal (1 subgoal):
 1. inf R R\<inverse>\<inverse> = (=)
[PROOF STEP]
by (auto intro!: ext simp add: reflpD dest: antisympD)
[PROOF STATE]
proof (state)
this:
inf R R\<inverse>\<inverse> = (=)

goal (1 subgoal):
 1. p = q
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rel_pmf (=) p q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rel_pmf (=) p q

goal (1 subgoal):
 1. p = q
[PROOF STEP]
unfolding pmf.rel_eq
[PROOF STATE]
proof (prove)
using this:
p = q

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aff_dim_translation_eq:
  "aff_dim ((+) a ` S) = aff_dim S" for a :: "'n::euclidean_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim ((+) a ` S) = aff_dim S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aff_dim ((+) a ` S) = aff_dim S
[PROOF STEP]
have "affine_parallel (affine hull S) (affine hull ((\<lambda>x. a + x) ` S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_parallel (affine hull S) (affine hull (+) a ` S)
[PROOF STEP]
unfolding affine_parallel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>aa. affine hull (+) a ` S = (+) aa ` (affine hull S)
[PROOF STEP]
apply (rule exI[of _ "a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull (+) a ` S = (+) a ` (affine hull S)
[PROOF STEP]
using affine_hull_translation[of a S]
[PROOF STATE]
proof (prove)
using this:
affine hull (+) a ` S = (+) a ` (affine hull S)

goal (1 subgoal):
 1. affine hull (+) a ` S = (+) a ` (affine hull S)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
affine_parallel (affine hull S) (affine hull (+) a ` S)

goal (1 subgoal):
 1. aff_dim ((+) a ` S) = aff_dim S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
affine_parallel (affine hull S) (affine hull (+) a ` S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
affine_parallel (affine hull S) (affine hull (+) a ` S)

goal (1 subgoal):
 1. aff_dim ((+) a ` S) = aff_dim S
[PROOF STEP]
using aff_dim_parallel_eq[of S "(\<lambda>x. a + x) ` S"]
[PROOF STATE]
proof (prove)
using this:
affine_parallel (affine hull S) (affine hull (+) a ` S)
affine_parallel (affine hull S) (affine hull (+) a ` S) \<Longrightarrow> aff_dim S = aff_dim ((+) a ` S)

goal (1 subgoal):
 1. aff_dim ((+) a ` S) = aff_dim S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aff_dim ((+) a ` S) = aff_dim S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nths_reduceIndices: "\<And> iset. nths xs iset = nths xs {i. i < length xs \<and> i \<in> iset}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>iset. nths xs iset = nths xs {i. i < |xs| \<and> i \<in> iset}
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>iset. nths [] iset = nths [] {i. i < |[]| \<and> i \<in> iset}
 2. \<And>a xs iset. (\<And>iset. nths xs iset = nths xs {i. i < |xs| \<and> i \<in> iset}) \<Longrightarrow> nths (a # xs) iset = nths (a # xs) {i. i < |a # xs| \<and> i \<in> iset}
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>iset. nths [] iset = nths [] {i. i < |[]| \<and> i \<in> iset}
 2. \<And>a xs iset. (\<And>iset. nths xs iset = nths xs {i. i < |xs| \<and> i \<in> iset}) \<Longrightarrow> nths (a # xs) iset = nths (a # xs) {i. i < |a # xs| \<and> i \<in> iset}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths [] iset = nths [] {i. i < |[]| \<and> i \<in> iset}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nths [] iset = nths [] {i. i < |[]| \<and> i \<in> iset}

goal (1 subgoal):
 1. \<And>a xs iset. (\<And>iset. nths xs iset = nths xs {i. i < |xs| \<and> i \<in> iset}) \<Longrightarrow> nths (a # xs) iset = nths (a # xs) {i. i < |a # xs| \<and> i \<in> iset}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs iset. (\<And>iset. nths xs iset = nths xs {i. i < |xs| \<and> i \<in> iset}) \<Longrightarrow> nths (a # xs) iset = nths (a # xs) {i. i < |a # xs| \<and> i \<in> iset}
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
nths xs ?iset = nths xs {i. i < |xs| \<and> i \<in> ?iset}

goal (1 subgoal):
 1. \<And>a xs iset. (\<And>iset. nths xs iset = nths xs {i. i < |xs| \<and> i \<in> iset}) \<Longrightarrow> nths (a # xs) iset = nths (a # xs) {i. i < |a # xs| \<and> i \<in> iset}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nths xs ?iset = nths xs {i. i < |xs| \<and> i \<in> ?iset}
[PROOF STEP]
have "nths xs {j. Suc j \<in> iset} = nths xs {i. i < length xs \<and> i \<in> {j. Suc j \<in> iset}}"
[PROOF STATE]
proof (prove)
using this:
nths xs ?iset = nths xs {i. i < |xs| \<and> i \<in> ?iset}

goal (1 subgoal):
 1. nths xs {j. Suc j \<in> iset} = nths xs {i. i < |xs| \<and> i \<in> {j. Suc j \<in> iset}}
[PROOF STEP]
by (rule_tac Cons)
[PROOF STATE]
proof (state)
this:
nths xs {j. Suc j \<in> iset} = nths xs {i. i < |xs| \<and> i \<in> {j. Suc j \<in> iset}}

goal (1 subgoal):
 1. \<And>a xs iset. (\<And>iset. nths xs iset = nths xs {i. i < |xs| \<and> i \<in> iset}) \<Longrightarrow> nths (a # xs) iset = nths (a # xs) {i. i < |a # xs| \<and> i \<in> iset}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nths xs {j. Suc j \<in> iset} = nths xs {i. i < |xs| \<and> i \<in> {j. Suc j \<in> iset}}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
nths xs {j. Suc j \<in> iset} = nths xs {i. i < |xs| \<and> i \<in> {j. Suc j \<in> iset}}

goal (1 subgoal):
 1. nths (x # xs) iset = nths (x # xs) {i. i < |x # xs| \<and> i \<in> iset}
[PROOF STEP]
by (simp add: nths_Cons)
[PROOF STATE]
proof (state)
this:
nths (x # xs) iset = nths (x # xs) {i. i < |x # xs| \<and> i \<in> iset}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeffs_monom [code abstract]:
  "coeffs (monom a n) = (if a = 0 then [] else replicate n 0 @ [a])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeffs (monom a n) = (if a = (0::'a) then [] else replicate n (0::'a) @ [a])
[PROOF STEP]
by (induct n) (simp_all add: monom_0 monom_Suc)


[STATEMENT]
lemma PosOrd_Stars_appendI:
  assumes "Stars vs1 :\<sqsubset>val Stars vs2" "flat (Stars vs1) = flat (Stars vs2)"
  shows "Stars (vs @ vs1) :\<sqsubset>val Stars (vs @ vs2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Stars (vs @ vs1) :\<sqsubset>val Stars (vs @ vs2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Stars vs1 :\<sqsubset>val Stars vs2
flat (Stars vs1) = flat (Stars vs2)

goal (1 subgoal):
 1. Stars (vs @ vs1) :\<sqsubset>val Stars (vs @ vs2)
[PROOF STEP]
apply(induct vs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Stars vs1 :\<sqsubset>val Stars vs2; flat (Stars vs1) = flat (Stars vs2)\<rbrakk> \<Longrightarrow> Stars ([] @ vs1) :\<sqsubset>val Stars ([] @ vs2)
 2. \<And>a vs. \<lbrakk>\<lbrakk>Stars vs1 :\<sqsubset>val Stars vs2; flat (Stars vs1) = flat (Stars vs2)\<rbrakk> \<Longrightarrow> Stars (vs @ vs1) :\<sqsubset>val Stars (vs @ vs2); Stars vs1 :\<sqsubset>val Stars vs2; flat (Stars vs1) = flat (Stars vs2)\<rbrakk> \<Longrightarrow> Stars ((a # vs) @ vs1) :\<sqsubset>val Stars ((a # vs) @ vs2)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a vs. \<lbrakk>\<lbrakk>Stars vs1 :\<sqsubset>val Stars vs2; flat (Stars vs1) = flat (Stars vs2)\<rbrakk> \<Longrightarrow> Stars (vs @ vs1) :\<sqsubset>val Stars (vs @ vs2); Stars vs1 :\<sqsubset>val Stars vs2; flat (Stars vs1) = flat (Stars vs2)\<rbrakk> \<Longrightarrow> Stars ((a # vs) @ vs1) :\<sqsubset>val Stars ((a # vs) @ vs2)
[PROOF STEP]
apply(simp add: PosOrd_StarsI2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_pderivs_lang_UNIV:
  shows "finite (pderivs_lang UNIV r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (pderivs_lang UNIV r)
[PROOF STEP]
unfolding pderivs_lang_UNIV
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (pderivs [] r \<union> pderivs_lang UNIV1 r)
[PROOF STEP]
by (simp add: finite_pderivs_lang_UNIV1)


[STATEMENT]
lemma phi_inverse_left:
  assumes "g \<in> G"
  shows "quot_comp_alt (\<phi> (inverse g \<cdot>| K)) g = \<phi> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quot_comp_alt (\<phi> (local.inverse g \<cdot>| K)) g = \<phi> K
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. quot_comp_alt (\<phi> (local.inverse g \<cdot>| K)) g = \<phi> K
[PROOF STEP]
have "(\<phi> (inverse g \<cdot>| K)) \<cdot> g \<in> ((inverse g) \<cdot> g) \<cdot>| K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> (local.inverse g \<cdot>| K) \<cdot> g \<in> local.inverse g \<cdot> g \<cdot>| K
[PROOF STEP]
using phi_coset_mem assms
[PROOF STATE]
proof (prove)
using this:
?a \<in> G \<Longrightarrow> \<phi> (?a \<cdot>| K) \<in> ?a \<cdot>| K
g \<in> G

goal (1 subgoal):
 1. \<phi> (local.inverse g \<cdot>| K) \<cdot> g \<in> local.inverse g \<cdot> g \<cdot>| K
[PROOF STEP]
by (metis Left_Coset_memE factor_unit invertible invertible_inverse_closed invertible_left_inverse normal)
[PROOF STATE]
proof (state)
this:
\<phi> (local.inverse g \<cdot>| K) \<cdot> g \<in> local.inverse g \<cdot> g \<cdot>| K

goal (1 subgoal):
 1. quot_comp_alt (\<phi> (local.inverse g \<cdot>| K)) g = \<phi> K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<phi> (local.inverse g \<cdot>| K) \<cdot> g \<in> local.inverse g \<cdot> g \<cdot>| K
[PROOF STEP]
have "(\<phi> (inverse g \<cdot>| K)) \<cdot> g \<cdot>| K = K"
[PROOF STATE]
proof (prove)
using this:
\<phi> (local.inverse g \<cdot>| K) \<cdot> g \<in> local.inverse g \<cdot> g \<cdot>| K

goal (1 subgoal):
 1. \<phi> (local.inverse g \<cdot>| K) \<cdot> g \<cdot>| K = K
[PROOF STEP]
using Block_self Left_Coset_Class_unit Normal_def
    quotient.unit_closed sub
[PROOF STATE]
proof (prove)
using this:
\<phi> (local.inverse g \<cdot>| K) \<cdot> g \<in> local.inverse g \<cdot> g \<cdot>| K
\<lbrakk>?a \<in> ?A; ?A \<in> Partition\<rbrakk> \<Longrightarrow> Class ?a = ?A
?g \<in> G \<Longrightarrow> ?g \<cdot>| K = Class ?g
K = Class \<one>
Class \<one> \<in> Partition
?a \<in> K \<Longrightarrow> ?a \<in> G

goal (1 subgoal):
 1. \<phi> (local.inverse g \<cdot>| K) \<cdot> g \<cdot>| K = K
[PROOF STEP]
by (smt (verit, best) assms composition_closed invertible invertible_inverse_closed
    invertible_left_inverse)
[PROOF STATE]
proof (state)
this:
\<phi> (local.inverse g \<cdot>| K) \<cdot> g \<cdot>| K = K

goal (1 subgoal):
 1. quot_comp_alt (\<phi> (local.inverse g \<cdot>| K)) g = \<phi> K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<phi> (local.inverse g \<cdot>| K) \<cdot> g \<cdot>| K = K
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<phi> (local.inverse g \<cdot>| K) \<cdot> g \<cdot>| K = K

goal (1 subgoal):
 1. quot_comp_alt (\<phi> (local.inverse g \<cdot>| K)) g = \<phi> K
[PROOF STEP]
using quot_comp_alt_def
[PROOF STATE]
proof (prove)
using this:
\<phi> (local.inverse g \<cdot>| K) \<cdot> g \<cdot>| K = K
quot_comp_alt ?a ?b = \<phi> (?a \<cdot> ?b \<cdot>| K)

goal (1 subgoal):
 1. quot_comp_alt (\<phi> (local.inverse g \<cdot>| K)) g = \<phi> K
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
quot_comp_alt (\<phi> (local.inverse g \<cdot>| K)) g = \<phi> K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma first_vec_two_block_non_inter_is_first_vec:
  assumes "dim_col A + dim_col B = dim_vec v"
  assumes "dim_row A = n"
  shows "vec_first (two_block_non_interfering A B *\<^sub>v v) n = A *\<^sub>v (vec_first v (dim_col A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first (two_block_non_interfering A B *\<^sub>v v) n = A *\<^sub>v vec_first v (dim_col A)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
assume a: "i < dim_vec (A *\<^sub>v vec_first v (dim_col A))"
[PROOF STATE]
proof (state)
this:
i < dim_vec (A *\<^sub>v vec_first v (dim_col A))

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
let ?tb = "two_block_non_interfering A B"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
have i_n: "i < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n
[PROOF STEP]
using a assms(2)
[PROOF STATE]
proof (prove)
using this:
i < dim_vec (A *\<^sub>v vec_first v (dim_col A))
dim_row A = n

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

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
have "vec_first (?tb *\<^sub>v v) n $ i = vec_first (vec (dim_row ?tb) (\<lambda> i. row ?tb i \<bullet> v)) n $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = vec_first (vec (dim_row (two_block_non_interfering A B)) (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v)) n $ i
[PROOF STEP]
unfolding mult_mat_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first (vec (dim_row (two_block_non_interfering A B)) (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v)) n $ i = vec_first (vec (dim_row (two_block_non_interfering A B)) (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v)) n $ i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = vec_first (vec (dim_row (two_block_non_interfering A B)) (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v)) n $ i

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = vec_first (vec (dim_row (two_block_non_interfering A B)) (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v)) n $ i

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
have "... = (vec n  (\<lambda> i. row ?tb i \<bullet> v)) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first (vec (dim_row (two_block_non_interfering A B)) (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v)) n $ i = vec n (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v) $ i
[PROOF STEP]
unfolding vec_first_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec n (($) (vec (dim_row (two_block_non_interfering A B)) (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v))) $ i = vec n (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v) $ i
[PROOF STEP]
using trans_less_add1
[PROOF STATE]
proof (prove)
using this:
?i < ?j \<Longrightarrow> ?i < ?j + ?m

goal (1 subgoal):
 1. vec n (($) (vec (dim_row (two_block_non_interfering A B)) (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v))) $ i = vec n (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v) $ i
[PROOF STEP]
by (metis a assms(2) dim_mult_mat_vec index_vec  two_block_non_interfering_dims(1))
[PROOF STATE]
proof (state)
this:
vec_first (vec (dim_row (two_block_non_interfering A B)) (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v)) n $ i = vec n (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v) $ i

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec_first (vec (dim_row (two_block_non_interfering A B)) (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v)) n $ i = vec n (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v) $ i

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
have "... = row ?tb i \<bullet> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec n (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v) $ i = row (two_block_non_interfering A B) i \<bullet> v
[PROOF STEP]
by (simp add: i_n)
[PROOF STATE]
proof (state)
this:
vec n (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v) $ i = row (two_block_non_interfering A B) i \<bullet> v

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec n (\<lambda>i. row (two_block_non_interfering A B) i \<bullet> v) $ i = row (two_block_non_interfering A B) i \<bullet> v

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
have "... = (row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (two_block_non_interfering A B) i \<bullet> v = (row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v
[PROOF STEP]
using assms(2) i_n two_block_non_interfering_row_comp1
[PROOF STATE]
proof (prove)
using this:
dim_row A = n
i < n
?i < dim_row ?A \<Longrightarrow> row (two_block_non_interfering ?A ?B) ?i = row ?A ?i @\<^sub>v 0\<^sub>v (dim_col ?B)

goal (1 subgoal):
 1. row (two_block_non_interfering A B) i \<bullet> v = (row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
row (two_block_non_interfering A B) i \<bullet> v = (row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row (two_block_non_interfering A B) i \<bullet> v = (row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
have "... = row A i \<bullet> vec_first v (dim_vec (row A i)) +
                   0\<^sub>v (dim_col B) \<bullet> vec_last v (dim_vec (0\<^sub>v (dim_col B)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v = row A i \<bullet> vec_first v (dim_vec (row A i)) + 0\<^sub>v (dim_col B) \<bullet> vec_last v (dim_vec (0\<^sub>v (dim_col B)))
[PROOF STEP]
using append_split_vec_distrib_scalar_prod[of "row A i" "0\<^sub>v (dim_col B)" v] assms(1)
[PROOF STATE]
proof (prove)
using this:
dim_vec (row A i @\<^sub>v 0\<^sub>v (dim_col B)) = dim_vec v \<Longrightarrow> (row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v = row A i \<bullet> vec_first v (dim_vec (row A i)) + 0\<^sub>v (dim_col B) \<bullet> vec_last v (dim_vec (0\<^sub>v (dim_col B)))
dim_col A + dim_col B = dim_vec v

goal (1 subgoal):
 1. (row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v = row A i \<bullet> vec_first v (dim_vec (row A i)) + 0\<^sub>v (dim_col B) \<bullet> vec_last v (dim_vec (0\<^sub>v (dim_col B)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v = row A i \<bullet> vec_first v (dim_vec (row A i)) + 0\<^sub>v (dim_col B) \<bullet> vec_last v (dim_vec (0\<^sub>v (dim_col B)))

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v = row A i \<bullet> vec_first v (dim_vec (row A i)) + 0\<^sub>v (dim_col B) \<bullet> vec_last v (dim_vec (0\<^sub>v (dim_col B)))
[PROOF STEP]
have "vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i =
             row A i \<bullet> vec_first v (dim_vec (row A i))"
[PROOF STATE]
proof (prove)
using this:
(row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v = row A i \<bullet> vec_first v (dim_vec (row A i)) + 0\<^sub>v (dim_col B) \<bullet> vec_last v (dim_vec (0\<^sub>v (dim_col B)))

goal (1 subgoal):
 1. vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = row A i \<bullet> vec_first v (dim_vec (row A i))
[PROOF STEP]
using calculation
[PROOF STATE]
proof (prove)
using this:
(row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v = row A i \<bullet> vec_first v (dim_vec (row A i)) + 0\<^sub>v (dim_col B) \<bullet> vec_last v (dim_vec (0\<^sub>v (dim_col B)))
vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (row A i @\<^sub>v 0\<^sub>v (dim_col B)) \<bullet> v

goal (1 subgoal):
 1. vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = row A i \<bullet> vec_first v (dim_vec (row A i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = row A i \<bullet> vec_first v (dim_vec (row A i))

goal (2 subgoals):
 1. \<And>i. i < dim_vec (A *\<^sub>v vec_first v (dim_col A)) \<Longrightarrow> vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
 2. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = row A i \<bullet> vec_first v (dim_vec (row A i))
[PROOF STEP]
show "vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i =
             (A *\<^sub>v vec_first v (dim_col A)) $ i"
[PROOF STATE]
proof (prove)
using this:
vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = row A i \<bullet> vec_first v (dim_vec (row A i))

goal (1 subgoal):
 1. vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i
[PROOF STEP]
by (simp add: assms(2) i_n)
[PROOF STATE]
proof (state)
this:
vec_first (two_block_non_interfering A B *\<^sub>v v) n $ i = (A *\<^sub>v vec_first v (dim_col A)) $ i

goal (1 subgoal):
 1. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
have "dim_vec (A *\<^sub>v v) = dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (A *\<^sub>v v) = dim_row A
[PROOF STEP]
using dim_vec_def dim_mult_mat_vec[of A v]
[PROOF STATE]
proof (prove)
using this:
dim_vec \<equiv> map_fun Rep_vec id fst
dim_vec (A *\<^sub>v v) = dim_row A

goal (1 subgoal):
 1. dim_vec (A *\<^sub>v v) = dim_row A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_vec (A *\<^sub>v v) = dim_row A

goal (1 subgoal):
 1. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dim_vec (A *\<^sub>v v) = dim_row A
[PROOF STEP]
have "dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = n"
[PROOF STATE]
proof (prove)
using this:
dim_vec (A *\<^sub>v v) = dim_row A

goal (1 subgoal):
 1. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = n

goal (1 subgoal):
 1. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = n
[PROOF STEP]
show "dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) =
             dim_vec (A *\<^sub>v vec_first v (dim_col A))"
[PROOF STATE]
proof (prove)
using this:
dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = n

goal (1 subgoal):
 1. dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))
[PROOF STEP]
by (simp add: assms(2))
[PROOF STATE]
proof (state)
this:
dim_vec (vec_first (two_block_non_interfering A B *\<^sub>v v) n) = dim_vec (A *\<^sub>v vec_first v (dim_col A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma parcs_c_K5: "parcs c_K5 = {(u,v). u \<in> {0..4} \<and> v \<in> {0..4} \<and> u \<noteq> v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. parcs c_K5 = {(u, v). u \<in> {0..4} \<and> v \<in> {0..4} \<and> u \<noteq> v}
[PROOF STEP]
by (auto simp: c_K5_list_def list_digraph_ext_def)


[STATEMENT]
lemma os_ts__sams:
  assumes "B P TS A C" and
    "A B OS P C"
  shows "SAMS A B P P B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SAMS A B P P B C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. SAMS A B P P B C
[PROOF STEP]
have "B Out P C \<or> \<not> Bet A B P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B Out P C \<or> \<not> Bet A B P
[PROOF STEP]
using assms(2) bet_col col123__nos
[PROOF STATE]
proof (prove)
using this:
A B OS P C
Bet ?A ?B ?C \<Longrightarrow> Col ?A ?B ?C
Col ?P ?Q ?A \<Longrightarrow> \<not> ?P ?Q OS ?A ?B

goal (1 subgoal):
 1. B Out P C \<or> \<not> Bet A B P
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B Out P C \<or> \<not> Bet A B P

goal (1 subgoal):
 1. SAMS A B P P B C
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
B Out P C \<or> \<not> Bet A B P

goal (1 subgoal):
 1. SAMS A B P P B C
[PROOF STEP]
have "\<exists> J. (P B J CongA P B C \<and> \<not> B P OS A J \<and> \<not> A B TS P J \<and> Coplanar A B P J)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>J. P B J CongA P B C \<and> \<not> B P OS A J \<and> \<not> A B TS P J \<and> Coplanar A B P J
[PROOF STEP]
by (metis assms(1) assms(2) conga_refl l9_9 os__coplanar os_distincts)
[PROOF STATE]
proof (state)
this:
\<exists>J. P B J CongA P B C \<and> \<not> B P OS A J \<and> \<not> A B TS P J \<and> Coplanar A B P J

goal (1 subgoal):
 1. SAMS A B P P B C
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
B Out P C \<or> \<not> Bet A B P
\<exists>J. P B J CongA P B C \<and> \<not> B P OS A J \<and> \<not> A B TS P J \<and> Coplanar A B P J
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
B Out P C \<or> \<not> Bet A B P
\<exists>J. P B J CongA P B C \<and> \<not> B P OS A J \<and> \<not> A B TS P J \<and> Coplanar A B P J

goal (1 subgoal):
 1. SAMS A B P P B C
[PROOF STEP]
using SAMS_def assms(2) os_distincts
[PROOF STATE]
proof (prove)
using this:
B Out P C \<or> \<not> Bet A B P
\<exists>J. P B J CongA P B C \<and> \<not> B P OS A J \<and> \<not> A B TS P J \<and> Coplanar A B P J
SAMS ?A ?B ?C ?D ?E ?F \<equiv> (?A \<noteq> ?B \<and> (?E Out ?D ?F \<or> \<not> Bet ?A ?B ?C)) \<and> (\<exists>J. ?C ?B J CongA ?D ?E ?F \<and> \<not> ?B ?C OS ?A J \<and> \<not> ?A ?B TS ?C J \<and> Coplanar ?A ?B ?C J)
A B OS P C
?A ?B OS ?X ?Y \<Longrightarrow> ?A \<noteq> ?B \<and> ?A \<noteq> ?X \<and> ?A \<noteq> ?Y \<and> ?B \<noteq> ?X \<and> ?B \<noteq> ?Y

goal (1 subgoal):
 1. SAMS A B P P B C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
SAMS A B P P B C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma basis_subspace_exists:
  assumes "subspace S"
  obtains B where "finite B" "B \<subseteq> S" "independent B" "span B = S" "card B = dim S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>finite B; B \<subseteq> S; independent B; span B = S; card B = dim S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms span_subspace basis_exists finiteI_independent)


[STATEMENT]
lemma hcmod_le_Infinitesimal:
  "\<lbrakk>e \<in> Infinitesimal; hcmod x \<le> hcmod e\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>e \<in> Infinitesimal; hcmod x \<le> hcmod e\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal
[PROOF STEP]
by (auto elim: hrabs_le_Infinitesimal simp add: Infinitesimal_hcmod_iff)


[STATEMENT]
lemma open_Collect_conj:
  assumes "open {x. P x}" "open {x. Q x}"
  shows "open {x. P x \<and> Q x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {x. P x \<and> Q x}
[PROOF STEP]
using open_Int[OF assms]
[PROOF STATE]
proof (prove)
using this:
open ({x. P x} \<inter> {x. Q x})

goal (1 subgoal):
 1. open {x. P x \<and> Q x}
[PROOF STEP]
by (simp add: Int_def)


[STATEMENT]
lemma eq_from_nat_into_iff:
  "countable A \<Longrightarrow> x \<in> A \<Longrightarrow> i \<in> to_nat_on A ` A \<Longrightarrow> x = from_nat_into A i \<longleftrightarrow> i = to_nat_on A x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; x \<in> A; i \<in> to_nat_on A ` A\<rbrakk> \<Longrightarrow> (x = from_nat_into A i) = (i = to_nat_on A x)
[PROOF STEP]
by auto


[STATEMENT]
lemma scan_drop[simp]: "drop k (scan f xs a) = scan f (drop k xs) (fold f (take k xs) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop k (scan f xs a) = scan f (drop k xs) (fold f (take k xs) a)
[PROOF STEP]
by (induct k arbitrary: xs a) (auto simp: take_Suc neq_Nil_conv)


[STATEMENT]
lemma sum_plus_bot_2:
  fixes f :: "('a,'b::aggregation_order) square"
  shows "sum2\<^sub>M f \<oplus>\<^sub>M mbot = sum2\<^sub>M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum2\<^sub>M f \<oplus>\<^sub>M mbot = sum2\<^sub>M f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (sum2\<^sub>M f \<oplus>\<^sub>M mbot) x = (sum2\<^sub>M f) x
[PROOF STEP]
fix e
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (sum2\<^sub>M f \<oplus>\<^sub>M mbot) x = (sum2\<^sub>M f) x
[PROOF STEP]
have "(sum2\<^sub>M f \<oplus>\<^sub>M mbot) e = (\<Sum>\<^sub>k \<Sum>\<^sub>l f (k,l)) + bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sum2\<^sub>M f \<oplus>\<^sub>M mbot) e = aggregation.sum_0 (\<lambda>k. aggregation.sum_0 (\<lambda>l. f (k, l)) {l. True}) {k. True} + bot
[PROOF STEP]
by (simp add: plus_matrix_def bot_matrix_def sum_matrix_2_def)
[PROOF STATE]
proof (state)
this:
(sum2\<^sub>M f \<oplus>\<^sub>M mbot) e = aggregation.sum_0 (\<lambda>k. aggregation.sum_0 (\<lambda>l. f (k, l)) {l. True}) {k. True} + bot

goal (1 subgoal):
 1. \<And>x. (sum2\<^sub>M f \<oplus>\<^sub>M mbot) x = (sum2\<^sub>M f) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(sum2\<^sub>M f \<oplus>\<^sub>M mbot) e = aggregation.sum_0 (\<lambda>k. aggregation.sum_0 (\<lambda>l. f (k, l)) {l. True}) {k. True} + bot

goal (1 subgoal):
 1. \<And>x. (sum2\<^sub>M f \<oplus>\<^sub>M mbot) x = (sum2\<^sub>M f) x
[PROOF STEP]
have "... = (\<Sum>\<^sub>k \<Sum>\<^sub>l f (k,l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aggregation.sum_0 (\<lambda>k. aggregation.sum_0 (\<lambda>l. f (k, l)) {l. True}) {k. True} + bot = aggregation.sum_0 (\<lambda>k. aggregation.sum_0 (\<lambda>l. f (k, l)) {l. True}) {k. True}
[PROOF STEP]
by (metis (no_types, lifting) add_add_bot aggregation.sum_0.F_one)
[PROOF STATE]
proof (state)
this:
aggregation.sum_0 (\<lambda>k. aggregation.sum_0 (\<lambda>l. f (k, l)) {l. True}) {k. True} + bot = aggregation.sum_0 (\<lambda>k. aggregation.sum_0 (\<lambda>l. f (k, l)) {l. True}) {k. True}

goal (1 subgoal):
 1. \<And>x. (sum2\<^sub>M f \<oplus>\<^sub>M mbot) x = (sum2\<^sub>M f) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
aggregation.sum_0 (\<lambda>k. aggregation.sum_0 (\<lambda>l. f (k, l)) {l. True}) {k. True} + bot = aggregation.sum_0 (\<lambda>k. aggregation.sum_0 (\<lambda>l. f (k, l)) {l. True}) {k. True}

goal (1 subgoal):
 1. \<And>x. (sum2\<^sub>M f \<oplus>\<^sub>M mbot) x = (sum2\<^sub>M f) x
[PROOF STEP]
have "... = (sum2\<^sub>M f) e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aggregation.sum_0 (\<lambda>k. aggregation.sum_0 (\<lambda>l. f (k, l)) {l. True}) {k. True} = (sum2\<^sub>M f) e
[PROOF STEP]
by (simp add: sum_matrix_2_def)
[PROOF STATE]
proof (state)
this:
aggregation.sum_0 (\<lambda>k. aggregation.sum_0 (\<lambda>l. f (k, l)) {l. True}) {k. True} = (sum2\<^sub>M f) e

goal (1 subgoal):
 1. \<And>x. (sum2\<^sub>M f \<oplus>\<^sub>M mbot) x = (sum2\<^sub>M f) x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(sum2\<^sub>M f \<oplus>\<^sub>M mbot) e = (sum2\<^sub>M f) e
[PROOF STEP]
show "(sum2\<^sub>M f \<oplus>\<^sub>M mbot) e = (sum2\<^sub>M f) e"
[PROOF STATE]
proof (prove)
using this:
(sum2\<^sub>M f \<oplus>\<^sub>M mbot) e = (sum2\<^sub>M f) e

goal (1 subgoal):
 1. (sum2\<^sub>M f \<oplus>\<^sub>M mbot) e = (sum2\<^sub>M f) e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(sum2\<^sub>M f \<oplus>\<^sub>M mbot) e = (sum2\<^sub>M f) e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subseq_same_length:
  assumes "subseq xs ys" and "length xs = length ys" shows "xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subseq xs ys
length xs = length ys

goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
by (induct) (auto dest: list_emb_length)


[STATEMENT]
lemma hl_ax3: "\<exists>f::ind \<Rightarrow> ind. inj f \<and> \<not> surj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. inj f \<and> \<not> surj f
[PROOF STEP]
by (rule_tac x="Suc_Rep" in exI)
     (metis Suc_Rep_inject' injI Suc_Rep_not_Zero_Rep surjD)


[STATEMENT]
lemma row_Cons:"row (v#M) i = (v!i)#(row M i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (v # M) i = v ! i # row M i
[PROOF STEP]
unfolding row_def map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>w. w ! i) (v # M) = v ! i # map (\<lambda>w. w ! i) M
[PROOF STEP]
by auto


[STATEMENT]
lemma point_to_type_closed:
 "point_to_type Xs x \<subseteq> Pow (\<Union> Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. point_to_type Xs x \<subseteq> Pow (\<Union> Xs)
[PROOF STEP]
unfolding point_to_type_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {X \<in> Xs. x \<in> X} \<subseteq> Pow (\<Union> Xs)
[PROOF STEP]
by blast


[STATEMENT]
lemma ket_k_dim:
  "ket_k k \<in> carrier_vec K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ket_k k \<in> carrier_vec K
[PROOF STEP]
unfolding ket_k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.vec K (\<lambda>ka. if ka = k then 1 else 0) \<in> carrier_vec K
[PROOF STEP]
by auto


[STATEMENT]
lemma (in complete_lattice) Inf_set_fold:
  "Inf (set xs) = fold inf xs top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> set xs = fold (\<sqinter>) xs \<top>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sqinter> set xs = fold (\<sqinter>) xs \<top>
[PROOF STEP]
interpret comp_fun_idem "inf :: 'a \<Rightarrow> 'a \<Rightarrow> 'a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_idem (\<sqinter>)
[PROOF STEP]
by (fact comp_fun_idem_inf)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sqinter> set xs = fold (\<sqinter>) xs \<top>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> set xs = fold (\<sqinter>) xs \<top>
[PROOF STEP]
by (simp add: Inf_fold_inf fold_set_fold inf_commute)
[PROOF STATE]
proof (state)
this:
\<Sqinter> set xs = fold (\<sqinter>) xs \<top>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lim_ident_at: "\<not> trivial_limit (at x within s) \<Longrightarrow> Lim (at x within s) (\<lambda>x. x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within s \<noteq> bot \<Longrightarrow> Lim (at x within s) (\<lambda>x. x) = x
[PROOF STEP]
by (rule tendsto_Lim[OF _ tendsto_ident_at]) auto


[STATEMENT]
lemma bad_pair_set_filter_alt:
  "bad_pair_set S T c = Set.filter (\<lambda> p . bad_pair (fst p) (snd p) T c) (S \<times> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bad_pair_set S T c = Set.filter (\<lambda>p. bad_pair (fst p) (snd p) T c) (S \<times> S)
[PROOF STEP]
using bad_pair_set_def
[PROOF STATE]
proof (prove)
using this:
bad_pair_set ?S ?T ?c \<equiv> {(u, v). (u, v) \<in> ?S \<times> ?S \<and> bad_pair u v ?T ?c}

goal (1 subgoal):
 1. bad_pair_set S T c = Set.filter (\<lambda>p. bad_pair (fst p) (snd p) T c) (S \<times> S)
[PROOF STEP]
by auto


[STATEMENT]
lemma dvd_div_ge_1:
  fixes a b :: nat
  assumes "a \<ge> 1" "b dvd a"
  shows "a div b \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> a div b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 \<le> a div b
[PROOF STEP]
from \<open>b dvd a\<close>
[PROOF STATE]
proof (chain)
picking this:
b dvd a
[PROOF STEP]
obtain c where "a = b * c"
[PROOF STATE]
proof (prove)
using this:
b dvd a

goal (1 subgoal):
 1. (\<And>c. a = b * c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
a = b * c

goal (1 subgoal):
 1. 1 \<le> a div b
[PROOF STEP]
with \<open>a \<ge> 1\<close>
[PROOF STATE]
proof (chain)
picking this:
1 \<le> a
a = b * c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 \<le> a
a = b * c

goal (1 subgoal):
 1. 1 \<le> a div b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> a div b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transitive:
  fixes P :: pi
  and   Q :: pi
  and   R :: pi

  assumes "P \<approx>\<^sup>s Q"
  and     "Q \<approx>\<^sup>s R"

  shows "P \<approx>\<^sup>s R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<approx>\<^sup>s R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P \<approx>\<^sup>s Q
Q \<approx>\<^sup>s R

goal (1 subgoal):
 1. P \<approx>\<^sup>s R
[PROOF STEP]
by(force simp add: substClosed_def intro: Weak_Late_Bisim.transitive)


[STATEMENT]
lemma unit_circle_fix_moebius_comp [simp]:
  assumes "unit_circle_fix M1" and "unit_circle_fix M2"
  shows "unit_circle_fix (moebius_comp M1 M2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_circle_fix (moebius_comp M1 M2)
[PROOF STEP]
using unit_circle_fix_moebius_add[OF assms]
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix (M1 + M2)

goal (1 subgoal):
 1. unit_circle_fix (moebius_comp M1 M2)
[PROOF STEP]
by simp


[STATEMENT]
lemma limpt_of_closure: "x islimpt closure S \<longleftrightarrow> x islimpt S"
  for x :: "'a::metric_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x islimpt closure S = x islimpt S
[PROOF STEP]
by (auto simp: closure_def islimpt_Un dest: limpt_of_limpts)


[STATEMENT]
lemma continuous_map_from_subtopology_mono:
     "\<lbrakk>continuous_map (subtopology X T) X' f; S \<subseteq> T\<rbrakk>
      \<Longrightarrow> continuous_map (subtopology X S) X' f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map (subtopology X T) X' f; S \<subseteq> T\<rbrakk> \<Longrightarrow> continuous_map (subtopology X S) X' f
[PROOF STEP]
by (metis inf.absorb_iff2 continuous_map_from_subtopology subtopology_subtopology)


[STATEMENT]
lemma Pi_mem: "f \<in> Pi A B \<Longrightarrow> x \<in> A \<Longrightarrow> f x \<in> B x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> Pi A B; x \<in> A\<rbrakk> \<Longrightarrow> f x \<in> B x
[PROOF STEP]
by (simp add: Pi_def)


[STATEMENT]
lemma fps_mult_left_const_nth [simp]:
  "(fps_const (c::'a::{comm_monoid_add,mult_zero}) * f)$n = c* f$n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_const c * f) $ n = c * f $ n
[PROOF STEP]
by (simp add: fps_mult_nth mult_delta_left)


[STATEMENT]
lemma map_f:
  "\<forall>cl_f_ty_list. map (\<lambda>(cl, f). fd_def cl f) cl_f_list = map (\<lambda>(cl, f, ty). fd_def cl f) cl_f_ty_list \<longrightarrow>
   map (\<lambda>(cl, f). f) cl_f_list = map (\<lambda>(cl, f, ty). f) cl_f_ty_list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>cl_f_ty_list. map (\<lambda>(cl, f). fd_def cl f) cl_f_list = map (\<lambda>(cl, f, ty). fd_def cl f) cl_f_ty_list \<longrightarrow> map (\<lambda>(cl, f). f) cl_f_list = map (\<lambda>(cl, f, ty). f) cl_f_ty_list
[PROOF STEP]
by (induct cl_f_list, auto)


[STATEMENT]
lemma vars_mset_set_zip [simp]:
  assumes "length xs = length ys"
  shows "vars_mset (mset (zip xs ys)) = (\<Union>x\<in>set xs \<union> set ys. vars_term x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars_mset (mset (zip xs ys)) = \<Union> (vars_term ` (set xs \<union> set ys))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys

goal (1 subgoal):
 1. vars_mset (mset (zip xs ys)) = \<Union> (vars_term ` (set xs \<union> set ys))
[PROOF STEP]
by (induct xs ys rule: list_induct2) (auto simp: vars_mset_def)


[STATEMENT]
lemma atMost_lessThan_conv: "{..n} = {..<Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..n} = {..<Suc n}
[PROOF STEP]
by (simp only: atMost_def lessThan_def less_Suc_eq_le)


[STATEMENT]
lemma sorted_mid_iff2:
  "sorted(x # xs @ y # ys) =
  (sorted(x # xs) \<and> x < y \<and> sorted(xs @ [y]) \<and> sorted(y # ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (x # xs @ y # ys) = (sorted (x # xs) \<and> x < y \<and> sorted (xs @ [y]) \<and> sorted (y # ys))
[PROOF STEP]
by(fastforce simp add: sorted_wrt_Cons sorted_wrt_append)


[STATEMENT]
lemma (in infinite_cts_filtration) borel_adapt_nat_filtration_info:
  fixes X::"nat \<Rightarrow> bool stream \<Rightarrow> 'b::{t0_space}"
  assumes "borel_adapt_stoch_proc F X"
  and "m \<le> n"
shows "X m (pseudo_proj_True n w) = X m w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X m (pseudo_proj_True n w) = X m w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X m (pseudo_proj_True n w) = X m w
[PROOF STEP]
have "X m \<in> borel_measurable (F n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X m \<in> borel_measurable (F n)
[PROOF STEP]
using assms natural_filtration
[PROOF STATE]
proof (prove)
using this:
borel_adapt_stoch_proc F X
m \<le> n
F = nat_filtration

goal (1 subgoal):
 1. X m \<in> borel_measurable (F n)
[PROOF STEP]
using  increasing_measurable_info
[PROOF STATE]
proof (prove)
using this:
borel_adapt_stoch_proc F X
m \<le> n
F = nat_filtration
\<lbrakk>?f \<in> F ?s \<rightarrow>\<^sub>M ?N; ?s \<le> ?t\<rbrakk> \<Longrightarrow> ?f \<in> F ?t \<rightarrow>\<^sub>M ?N

goal (1 subgoal):
 1. X m \<in> borel_measurable (F n)
[PROOF STEP]
by (metis adapt_stoch_proc_def)
[PROOF STATE]
proof (state)
this:
X m \<in> borel_measurable (F n)

goal (1 subgoal):
 1. X m (pseudo_proj_True n w) = X m w
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
X m \<in> borel_measurable (F n)

goal (1 subgoal):
 1. X m (pseudo_proj_True n w) = X m w
[PROOF STEP]
using nat_filtration_info natural_filtration
[PROOF STATE]
proof (prove)
using this:
X m \<in> borel_measurable (F n)
?f \<in> borel_measurable (nat_filtration ?n) \<Longrightarrow> ?f \<circ> pseudo_proj_True ?n = ?f
F = nat_filtration

goal (1 subgoal):
 1. X m (pseudo_proj_True n w) = X m w
[PROOF STEP]
by (metis comp_apply)
[PROOF STATE]
proof (state)
this:
X m (pseudo_proj_True n w) = X m w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma square_free_prod_list_distinct:
  assumes sf: "square_free (prod_list us :: 'a :: idom poly)"
  and us: "\<And> u. u \<in> set us \<Longrightarrow> degree u > 0"
  shows "distinct us"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct us
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> distinct us \<Longrightarrow> False
[PROOF STEP]
assume "\<not> distinct us"
[PROOF STATE]
proof (state)
this:
\<not> distinct us

goal (1 subgoal):
 1. \<not> distinct us \<Longrightarrow> False
[PROOF STEP]
from not_distinct_decomp[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>xs ys zs y. us = xs @ [y] @ ys @ [y] @ zs
[PROOF STEP]
obtain xs ys zs u where
     "us = xs @ u # ys @ u # zs"
[PROOF STATE]
proof (prove)
using this:
\<exists>xs ys zs y. us = xs @ [y] @ ys @ [y] @ zs

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

goal (1 subgoal):
 1. \<not> distinct us \<Longrightarrow> False
[PROOF STEP]
hence dvd: "u * u dvd prod_list us" and u: "u \<in> set us"
[PROOF STATE]
proof (prove)
using this:
us = xs @ u # ys @ u # zs

goal (1 subgoal):
 1. u * u dvd prod_list us &&& u \<in> set us
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u * u dvd prod_list us
u \<in> set us

goal (1 subgoal):
 1. \<not> distinct us \<Longrightarrow> False
[PROOF STEP]
from dvd us[OF u] sf
[PROOF STATE]
proof (chain)
picking this:
u * u dvd prod_list us
0 < degree u
square_free (prod_list us)
[PROOF STEP]
have "prod_list us = 0"
[PROOF STATE]
proof (prove)
using this:
u * u dvd prod_list us
0 < degree u
square_free (prod_list us)

goal (1 subgoal):
 1. prod_list us = 0
[PROOF STEP]
unfolding square_free_def
[PROOF STATE]
proof (prove)
using this:
u * u dvd prod_list us
0 < degree u
prod_list us \<noteq> 0 \<and> (\<forall>q. 0 < degree q \<longrightarrow> \<not> q * q dvd prod_list us)

goal (1 subgoal):
 1. prod_list us = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prod_list us = 0

goal (1 subgoal):
 1. \<not> distinct us \<Longrightarrow> False
[PROOF STEP]
hence "0 \<in> set us"
[PROOF STATE]
proof (prove)
using this:
prod_list us = 0

goal (1 subgoal):
 1. 0 \<in> set us
[PROOF STEP]
by (simp add: prod_list_zero_iff)
[PROOF STATE]
proof (state)
this:
0 \<in> set us

goal (1 subgoal):
 1. \<not> distinct us \<Longrightarrow> False
[PROOF STEP]
from us[OF this]
[PROOF STATE]
proof (chain)
picking this:
0 < degree 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
0 < degree 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_factorization_prod_mset_primes:
  assumes "\<And>p. p \<in># A \<Longrightarrow> prime p"
  shows   "prime_factorization (prod_mset A) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factorization (\<Prod>\<^sub># A) = A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?p1 \<in># A \<Longrightarrow> prime ?p1

goal (1 subgoal):
 1. prime_factorization (\<Prod>\<^sub># A) = A
[PROOF STEP]
proof (induction A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>p. p \<in># {#} \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># {#}) = {#}
 2. \<And>x A. \<lbrakk>(\<And>p. p \<in># A \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># A) = A; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> prime_factorization (\<Prod>\<^sub># (add_mset x A)) = add_mset x A
[PROOF STEP]
case (add p A)
[PROOF STATE]
proof (state)
this:
(\<And>p. p \<in># A \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># A) = A
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1

goal (2 subgoals):
 1. (\<And>p. p \<in># {#} \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># {#}) = {#}
 2. \<And>x A. \<lbrakk>(\<And>p. p \<in># A \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># A) = A; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> prime_factorization (\<Prod>\<^sub># (add_mset x A)) = add_mset x A
[PROOF STEP]
from add.prems[of 0]
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<in># add_mset p A \<Longrightarrow> prime (0::'a)
[PROOF STEP]
have "0 \<notin># A"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<in># add_mset p A \<Longrightarrow> prime (0::'a)

goal (1 subgoal):
 1. (0::'a) \<notin># A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) \<notin># A

goal (2 subgoals):
 1. (\<And>p. p \<in># {#} \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># {#}) = {#}
 2. \<And>x A. \<lbrakk>(\<And>p. p \<in># A \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># A) = A; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> prime_factorization (\<Prod>\<^sub># (add_mset x A)) = add_mset x A
[PROOF STEP]
hence "prod_mset A \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<notin># A

goal (1 subgoal):
 1. \<Prod>\<^sub># A \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Prod>\<^sub># A \<noteq> (0::'a)

goal (2 subgoals):
 1. (\<And>p. p \<in># {#} \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># {#}) = {#}
 2. \<And>x A. \<lbrakk>(\<And>p. p \<in># A \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># A) = A; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> prime_factorization (\<Prod>\<^sub># (add_mset x A)) = add_mset x A
[PROOF STEP]
with add
[PROOF STATE]
proof (chain)
picking this:
(\<And>p. p \<in># A \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># A) = A
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
\<Prod>\<^sub># A \<noteq> (0::'a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<And>p. p \<in># A \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># A) = A
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
\<Prod>\<^sub># A \<noteq> (0::'a)

goal (1 subgoal):
 1. prime_factorization (\<Prod>\<^sub># (add_mset p A)) = add_mset p A
[PROOF STEP]
by (simp_all add: mult_ac prime_factorization_times_prime Multiset.union_commute)
[PROOF STATE]
proof (state)
this:
prime_factorization (\<Prod>\<^sub># (add_mset p A)) = add_mset p A

goal (1 subgoal):
 1. (\<And>p. p \<in># {#} \<Longrightarrow> prime p) \<Longrightarrow> prime_factorization (\<Prod>\<^sub># {#}) = {#}
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma diff: "f (x - y) = f x - f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (x - y) = f x - f y
[PROOF STEP]
using add [of x "- y"]
[PROOF STATE]
proof (prove)
using this:
f (x + - y) = f x + f (- y)

goal (1 subgoal):
 1. f (x - y) = f x - f y
[PROOF STEP]
by (simp add: minus)


[STATEMENT]
lemma Polys_closed_sum: "(\<And>a. a \<in> A \<Longrightarrow> f a \<in> P[X]) \<Longrightarrow> sum f A \<in> P[X]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. a \<in> A \<Longrightarrow> f a \<in> P[X]) \<Longrightarrow> sum f A \<in> P[X]
[PROOF STEP]
by (induct A rule: infinite_finite_induct) (auto intro: zero_in_Polys Polys_closed_plus)


[STATEMENT]
lemma ennreal_top_neq_of_nat[simp]: "(top::ennreal) \<noteq> of_nat i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. top \<noteq> of_nat i
[PROOF STEP]
using ennreal_of_nat_neq_top[of i]
[PROOF STATE]
proof (prove)
using this:
of_nat i \<noteq> top

goal (1 subgoal):
 1. top \<noteq> of_nat i
[PROOF STEP]
by metis


[STATEMENT]
lemma inc_vec_index_one_iff:  "i < length Vs \<Longrightarrow> inc_vec_of Vs bl $ i = 1 \<longleftrightarrow> Vs ! i \<in> bl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length Vs \<Longrightarrow> (inc_vec_of Vs bl $ i = (1::'b)) = (Vs ! i \<in> bl)
[PROOF STEP]
by (auto simp add: inc_vec_of_def )


[STATEMENT]
lemma ordertype_finite_less_than [simp]:
  assumes "finite A" shows "ordertype A less_than = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype A less_than = ord_of_nat (card A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordertype A less_than = ord_of_nat (card A)
[PROOF STEP]
let ?M = "ord_of_nat ` A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordertype A less_than = ord_of_nat (card A)
[PROOF STEP]
obtain M: "finite ?M" "?M \<subseteq> ON"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>finite (ord_of_nat ` A); ord_of_nat ` A \<subseteq> ON\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Ord_ord_of_nat assms
[PROOF STATE]
proof (prove)
using this:
Ord (ord_of_nat ?k)
finite A

goal (1 subgoal):
 1. (\<lbrakk>finite (ord_of_nat ` A); ord_of_nat ` A \<subseteq> ON\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (ord_of_nat ` A)
ord_of_nat ` A \<subseteq> ON

goal (1 subgoal):
 1. ordertype A less_than = ord_of_nat (card A)
[PROOF STEP]
have "ordertype A less_than = ordertype ?M VWF"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype A less_than = ordertype (ord_of_nat ` A) VWF
[PROOF STEP]
by (rule ordertype_inc_eq [symmetric]) (use assms finite_imp_small total_on_def in \<open>force+\<close>)
[PROOF STATE]
proof (state)
this:
ordertype A less_than = ordertype (ord_of_nat ` A) VWF

goal (1 subgoal):
 1. ordertype A less_than = ord_of_nat (card A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ordertype A less_than = ordertype (ord_of_nat ` A) VWF

goal (1 subgoal):
 1. ordertype A less_than = ord_of_nat (card A)
[PROOF STEP]
have "\<dots> = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype (ord_of_nat ` A) VWF = ord_of_nat (card A)
[PROOF STEP]
proof (subst ordertype_eq_iff)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. Ord (ord_of_nat (card A))
 2. wf VWF
 3. small (ord_of_nat ` A)
 4. total_on (ord_of_nat ` A) VWF
 5. trans VWF
 6. \<exists>f. bij_betw f (ord_of_nat ` A) (elts (ord_of_nat (card A))) \<and> (\<forall>x\<in>ord_of_nat ` A. \<forall>y\<in>ord_of_nat ` A. (f x < f y) = ((x, y) \<in> VWF))
[PROOF STEP]
let ?M = "ord_of_nat ` A"
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. Ord (ord_of_nat (card A))
 2. wf VWF
 3. small (ord_of_nat ` A)
 4. total_on (ord_of_nat ` A) VWF
 5. trans VWF
 6. \<exists>f. bij_betw f (ord_of_nat ` A) (elts (ord_of_nat (card A))) \<and> (\<forall>x\<in>ord_of_nat ` A. \<forall>y\<in>ord_of_nat ` A. (f x < f y) = ((x, y) \<in> VWF))
[PROOF STEP]
obtain h where bijh: "bij_betw h {..<card A} ?M" and smh: "strict_mono_on {..<card A} h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. \<lbrakk>bij_betw h {..<card A} (ord_of_nat ` A); strict_mono_on {..<card A} h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis M card_image ex_bij_betw_strict_mono_card inj_on_def ord_of_nat_inject)
[PROOF STATE]
proof (state)
this:
bij_betw h {..<card A} (ord_of_nat ` A)
strict_mono_on {..<card A} h

goal (6 subgoals):
 1. Ord (ord_of_nat (card A))
 2. wf VWF
 3. small (ord_of_nat ` A)
 4. total_on (ord_of_nat ` A) VWF
 5. trans VWF
 6. \<exists>f. bij_betw f (ord_of_nat ` A) (elts (ord_of_nat (card A))) \<and> (\<forall>x\<in>ord_of_nat ` A. \<forall>y\<in>ord_of_nat ` A. (f x < f y) = ((x, y) \<in> VWF))
[PROOF STEP]
define f where "f \<equiv> ord_of_nat \<circ> inv_into {..<card A} h"
[PROOF STATE]
proof (state)
this:
f \<equiv> ord_of_nat \<circ> inv_into {..<card A} h

goal (6 subgoals):
 1. Ord (ord_of_nat (card A))
 2. wf VWF
 3. small (ord_of_nat ` A)
 4. total_on (ord_of_nat ` A) VWF
 5. trans VWF
 6. \<exists>f. bij_betw f (ord_of_nat ` A) (elts (ord_of_nat (card A))) \<and> (\<forall>x\<in>ord_of_nat ` A. \<forall>y\<in>ord_of_nat ` A. (f x < f y) = ((x, y) \<in> VWF))
[PROOF STEP]
show "\<exists>f. bij_betw f ?M (elts (card A)) \<and> (\<forall>x\<in>?M. \<forall>y\<in>?M. f x < f y \<longleftrightarrow> ((x, y) \<in> VWF))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. bij_betw f (ord_of_nat ` A) (elts (ord_of_nat (card A))) \<and> (\<forall>x\<in>ord_of_nat ` A. \<forall>y\<in>ord_of_nat ` A. (f x < f y) = ((x, y) \<in> VWF))
[PROOF STEP]
proof (intro exI conjI ballI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bij_betw ?f (ord_of_nat ` A) (elts (ord_of_nat (card A)))
 2. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (?f x < ?f y) = ((x, y) \<in> VWF)
[PROOF STEP]
have "bij_betw (ord_of_nat \<circ> inv_into {..<card A} h) (ord_of_nat ` A) (ord_of_nat ` {..<card A})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (ord_of_nat \<circ> inv_into {..<card A} h) (ord_of_nat ` A) (ord_of_nat ` {..<card A})
[PROOF STEP]
by (meson UNIV_I bijh bij_betw_def bij_betw_inv_into bij_betw_subset bij_betw_trans inj_ord_of_nat subsetI)
[PROOF STATE]
proof (state)
this:
bij_betw (ord_of_nat \<circ> inv_into {..<card A} h) (ord_of_nat ` A) (ord_of_nat ` {..<card A})

goal (2 subgoals):
 1. bij_betw ?f (ord_of_nat ` A) (elts (ord_of_nat (card A)))
 2. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (?f x < ?f y) = ((x, y) \<in> VWF)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw (ord_of_nat \<circ> inv_into {..<card A} h) (ord_of_nat ` A) (ord_of_nat ` {..<card A})
[PROOF STEP]
show "bij_betw f ?M (elts (card A))"
[PROOF STATE]
proof (prove)
using this:
bij_betw (ord_of_nat \<circ> inv_into {..<card A} h) (ord_of_nat ` A) (ord_of_nat ` {..<card A})

goal (1 subgoal):
 1. bij_betw f (ord_of_nat ` A) (elts (ord_of_nat (card A)))
[PROOF STEP]
by (metis elts_ord_of_nat f_def)
[PROOF STATE]
proof (state)
this:
bij_betw f (ord_of_nat ` A) (elts (ord_of_nat (card A)))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
assume xy: "x \<in> ?M" "y \<in> ?M"
[PROOF STATE]
proof (state)
this:
x \<in> ord_of_nat ` A
y \<in> ord_of_nat ` A

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> ord_of_nat ` A
y \<in> ord_of_nat ` A
[PROOF STEP]
obtain m n where "x = ord_of_nat m" "y = ord_of_nat n"
[PROOF STATE]
proof (prove)
using this:
x \<in> ord_of_nat ` A
y \<in> ord_of_nat ` A

goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>x = ord_of_nat m; y = ord_of_nat n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = ord_of_nat m
y = ord_of_nat n

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
have "(f x < f y) \<longleftrightarrow> ((h \<circ> inv_into {..<card A} h) x < (h \<circ> inv_into {..<card A} h) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f x < f y) = ((h \<circ> inv_into {..<card A} h) x < (h \<circ> inv_into {..<card A} h) y)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((ord_of_nat \<circ> inv_into {..<card A} h) x < (ord_of_nat \<circ> inv_into {..<card A} h) y) = ((h \<circ> inv_into {..<card A} h) x < (h \<circ> inv_into {..<card A} h) y)
[PROOF STEP]
using smh bij_betw_imp_surj_on [OF bijh]
[PROOF STATE]
proof (prove)
using this:
strict_mono_on {..<card A} h
h ` {..<card A} = ord_of_nat ` A

goal (1 subgoal):
 1. ((ord_of_nat \<circ> inv_into {..<card A} h) x < (ord_of_nat \<circ> inv_into {..<card A} h) y) = ((h \<circ> inv_into {..<card A} h) x < (h \<circ> inv_into {..<card A} h) y)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>strict_mono_on {..<card A} h; h ` {..<card A} = ord_of_nat ` A\<rbrakk> \<Longrightarrow> (inv_into {..<card A} h x < inv_into {..<card A} h y) = (h (inv_into {..<card A} h x) < h (inv_into {..<card A} h y))
[PROOF STEP]
by (metis (mono_tags, lifting) inv_into_into not_less_iff_gr_or_eq order.asym strict_mono_onD xy)
[PROOF STATE]
proof (state)
this:
(f x < f y) = ((h \<circ> inv_into {..<card A} h) x < (h \<circ> inv_into {..<card A} h) y)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f x < f y) = ((h \<circ> inv_into {..<card A} h) x < (h \<circ> inv_into {..<card A} h) y)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
have "\<dots> = (x < y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((h \<circ> inv_into {..<card A} h) x < (h \<circ> inv_into {..<card A} h) y) = (x < y)
[PROOF STEP]
using bijh
[PROOF STATE]
proof (prove)
using this:
bij_betw h {..<card A} (ord_of_nat ` A)

goal (1 subgoal):
 1. ((h \<circ> inv_into {..<card A} h) x < (h \<circ> inv_into {..<card A} h) y) = (x < y)
[PROOF STEP]
by (simp add: bij_betw_inv_into_right xy)
[PROOF STATE]
proof (state)
this:
((h \<circ> inv_into {..<card A} h) x < (h \<circ> inv_into {..<card A} h) y) = (x < y)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((h \<circ> inv_into {..<card A} h) x < (h \<circ> inv_into {..<card A} h) y) = (x < y)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ((x, y) \<in> VWF)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x < y) = ((x, y) \<in> VWF)
[PROOF STEP]
using M(2) ON_imp_Ord xy
[PROOF STATE]
proof (prove)
using this:
ord_of_nat ` A \<subseteq> ON
\<lbrakk>?H \<subseteq> ON; ?x \<in> ?H\<rbrakk> \<Longrightarrow> Ord ?x
x \<in> ord_of_nat ` A
y \<in> ord_of_nat ` A

goal (1 subgoal):
 1. (x < y) = ((x, y) \<in> VWF)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x < y) = ((x, y) \<in> VWF)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> ord_of_nat ` A; y \<in> ord_of_nat ` A\<rbrakk> \<Longrightarrow> (f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
show "(f x < f y) \<longleftrightarrow> ((x, y) \<in> VWF)"
[PROOF STATE]
proof (prove)
using this:
(f x < f y) = ((x, y) \<in> VWF)

goal (1 subgoal):
 1. (f x < f y) = ((x, y) \<in> VWF)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f x < f y) = ((x, y) \<in> VWF)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>f. bij_betw f (ord_of_nat ` A) (elts (ord_of_nat (card A))) \<and> (\<forall>x\<in>ord_of_nat ` A. \<forall>y\<in>ord_of_nat ` A. (f x < f y) = ((x, y) \<in> VWF))

goal (5 subgoals):
 1. Ord (ord_of_nat (card A))
 2. wf VWF
 3. small (ord_of_nat ` A)
 4. total_on (ord_of_nat ` A) VWF
 5. trans VWF
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
ordertype (ord_of_nat ` A) VWF = ord_of_nat (card A)

goal (1 subgoal):
 1. ordertype A less_than = ord_of_nat (card A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ordertype A less_than = ord_of_nat (card A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ordertype A less_than = ord_of_nat (card A)

goal (1 subgoal):
 1. ordertype A less_than = ord_of_nat (card A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ordertype A less_than = ord_of_nat (card A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma app_insf_LstSeq_if: "LstSeq s k z \<Longrightarrow> app (insf s (succ k) y) k' = (if k' = succ k then y else app s k')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LstSeq s k z \<Longrightarrow> app (insf s (succ k) y) k' = (if k' = succ k then y else app s k')
[PROOF STEP]
by (metis app_insf2_LstSeq app_insf_LstSeq)


[STATEMENT]
lemma mat_gt_arc_compat2:
  assumes gt: "mat_gt_arc A B"
  and ge: "mat_ge B C"
  and A: "A \<in> carrier_mat nr nc"
  and B: "B \<in> carrier_mat nr nc"
  and C: "C \<in> carrier_mat nr nc"
  shows "mat_gt_arc A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_gt_arc A C
[PROOF STEP]
proof (rule mat_comp_allI[OF A C])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < nr; j < nc\<rbrakk> \<Longrightarrow> A $$ (i, j) \<succ> C $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < nr; j < nc\<rbrakk> \<Longrightarrow> A $$ (i, j) \<succ> C $$ (i, j)
[PROOF STEP]
assume i: "i < nr" and j: "j < nc"
[PROOF STATE]
proof (state)
this:
i < nr
j < nc

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < nr; j < nc\<rbrakk> \<Longrightarrow> A $$ (i, j) \<succ> C $$ (i, j)
[PROOF STEP]
have "A $$ (i,j) \<succ> B $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (i, j) \<succ> B $$ (i, j)
[PROOF STEP]
using mat_comp_allE[OF gt] A B i j
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A \<in> carrier_mat ?nr ?nc; B \<in> carrier_mat ?nr ?nc; ?i < ?nr; ?j < ?nc\<rbrakk> \<Longrightarrow> A $$ (?i, ?j) \<succ> B $$ (?i, ?j)
A \<in> carrier_mat nr nc
B \<in> carrier_mat nr nc
i < nr
j < nc

goal (1 subgoal):
 1. A $$ (i, j) \<succ> B $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A $$ (i, j) \<succ> B $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < nr; j < nc\<rbrakk> \<Longrightarrow> A $$ (i, j) \<succ> C $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A $$ (i, j) \<succ> B $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < nr; j < nc\<rbrakk> \<Longrightarrow> A $$ (i, j) \<succ> C $$ (i, j)
[PROOF STEP]
have "B $$ (i,j) \<ge> C $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C $$ (i, j) \<le> B $$ (i, j)
[PROOF STEP]
using ge B i j
[PROOF STATE]
proof (prove)
using this:
B \<ge>\<^sub>m C
B \<in> carrier_mat nr nc
i < nr
j < nc

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

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < nr; j < nc\<rbrakk> \<Longrightarrow> A $$ (i, j) \<succ> C $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A $$ (i, j) \<succ> C $$ (i, j)
[PROOF STEP]
show "A $$ (i,j) \<succ> C $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
A $$ (i, j) \<succ> C $$ (i, j)

goal (1 subgoal):
 1. A $$ (i, j) \<succ> C $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A $$ (i, j) \<succ> C $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [code]: "isEmpty t = (case t of Empty \<Rightarrow> True | _ \<Rightarrow> False)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isEmpty t = (case t of Empty \<Rightarrow> True | _ \<Rightarrow> False)
[PROOF STEP]
apply (cases t)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. t = Empty \<Longrightarrow> isEmpty t = (case t of Empty \<Rightarrow> True | _ \<Rightarrow> False)
 2. \<And>x2. t = Single x2 \<Longrightarrow> isEmpty t = (case t of Empty \<Rightarrow> True | _ \<Rightarrow> False)
 3. \<And>x31 x32 x33 x34. t = Deep x31 x32 x33 x34 \<Longrightarrow> isEmpty t = (case t of Empty \<Rightarrow> True | _ \<Rightarrow> False)
[PROOF STEP]
apply (auto simp add: isEmpty_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inv_character_principal [simp]: "inv_character (principal_char G) = principal_char G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_character (principal_char G) = principal_char G
[PROOF STEP]
by (simp add: inv_character_def principal_char_def fun_eq_iff)


[STATEMENT]
lemma (in aGroup) ag_eq_diffzero:"\<lbrakk>a \<in> carrier A; b \<in> carrier A\<rbrakk> \<Longrightarrow>
                       (a = b) = (a \<plusminus> (-\<^sub>a b) = \<zero>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; b \<in> carrier A\<rbrakk> \<Longrightarrow> (a = b) = (a \<plusminus> -\<^sub>a b = \<zero>)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier A; b \<in> carrier A; a = b\<rbrakk> \<Longrightarrow> a \<plusminus> -\<^sub>a b = \<zero>
 2. \<lbrakk>a \<in> carrier A; b \<in> carrier A; a \<plusminus> -\<^sub>a b = \<zero>\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
apply (simp add:ag_r_inv1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; b \<in> carrier A; a \<plusminus> -\<^sub>a b = \<zero>\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
apply (frule ag_mOp_closed[of "b"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; b \<in> carrier A; a \<plusminus> -\<^sub>a b = \<zero>; -\<^sub>a b \<in> carrier A\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
apply (simp add:ag_pOp_commute[of "a" "-\<^sub>a b"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; b \<in> carrier A; -\<^sub>a b \<plusminus> a = \<zero>; -\<^sub>a b \<in> carrier A\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
apply (subst ag_inv_unique[of "-\<^sub>a b" "a"], assumption+,
        simp add:ag_inv_inv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Lim_ident_at: "\<not> trivial_limit (at x within s) \<Longrightarrow> Lim (at x within s) (\<lambda>x. x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within s \<noteq> bot \<Longrightarrow> Lim (at x within s) (\<lambda>x. x) = x
[PROOF STEP]
by (rule tendsto_Lim[OF _ tendsto_ident_at]) auto


[STATEMENT]
lemma lookup_default_filter:
  "lookup_default d (filter P m) k =
     (if P k (lookup_default d m k) then lookup_default d m k else d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup_default d (Mapping.filter P m) k = (if P k (lookup_default d m k) then lookup_default d m k else d)
[PROOF STEP]
by (simp add: lookup_default_def lookup_filter split: option.splits)


[STATEMENT]
lemma degree_fps_poly_swap2_eq:
  assumes "\<And>n. degree (fps_nth p n) \<le> d"
  assumes "d > 0 \<or> fps_nth p n \<noteq> 0"
  assumes "degree (fps_nth p n) = d"
  shows   "degree (fps_poly_swap2 p) = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (fps_poly_swap2 p) = d
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree (fps_poly_swap2 p) \<le> d
 2. d \<le> degree (fps_poly_swap2 p)
[PROOF STEP]
have "fps_nth (coeff (fps_poly_swap2 p) d) n = poly.coeff (fps_nth p n) d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (fps_poly_swap2 p) d $ n = coeff (p $ n) d
[PROOF STEP]
by (subst fps_nth_coeff_fps_poly_swap2[OF assms(1)]) auto
[PROOF STATE]
proof (state)
this:
coeff (fps_poly_swap2 p) d $ n = coeff (p $ n) d

goal (2 subgoals):
 1. degree (fps_poly_swap2 p) \<le> d
 2. d \<le> degree (fps_poly_swap2 p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
coeff (fps_poly_swap2 p) d $ n = coeff (p $ n) d

goal (2 subgoals):
 1. degree (fps_poly_swap2 p) \<le> d
 2. d \<le> degree (fps_poly_swap2 p)
[PROOF STEP]
have "\<dots> \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (p $ n) d \<noteq> (0::'a)
[PROOF STEP]
using assms(2,3)
[PROOF STATE]
proof (prove)
using this:
0 < d \<or> p $ n \<noteq> 0
degree (p $ n) = d

goal (1 subgoal):
 1. coeff (p $ n) d \<noteq> (0::'a)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
coeff (p $ n) d \<noteq> (0::'a)

goal (2 subgoals):
 1. degree (fps_poly_swap2 p) \<le> d
 2. d \<le> degree (fps_poly_swap2 p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
coeff (fps_poly_swap2 p) d $ n \<noteq> (0::'a)
[PROOF STEP]
have "coeff (fps_poly_swap2 p) d \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
coeff (fps_poly_swap2 p) d $ n \<noteq> (0::'a)

goal (1 subgoal):
 1. coeff (fps_poly_swap2 p) d \<noteq> 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
coeff (fps_poly_swap2 p) d \<noteq> 0

goal (2 subgoals):
 1. degree (fps_poly_swap2 p) \<le> d
 2. d \<le> degree (fps_poly_swap2 p)
[PROOF STEP]
thus "degree (fps_poly_swap2 p) \<ge> d"
[PROOF STATE]
proof (prove)
using this:
coeff (fps_poly_swap2 p) d \<noteq> 0

goal (1 subgoal):
 1. d \<le> degree (fps_poly_swap2 p)
[PROOF STEP]
using le_degree
[PROOF STATE]
proof (prove)
using this:
coeff (fps_poly_swap2 p) d \<noteq> 0
coeff ?p ?n \<noteq> (0::?'a) \<Longrightarrow> ?n \<le> degree ?p

goal (1 subgoal):
 1. d \<le> degree (fps_poly_swap2 p)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
d \<le> degree (fps_poly_swap2 p)

goal (1 subgoal):
 1. degree (fps_poly_swap2 p) \<le> d
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (fps_poly_swap2 p) \<le> d
[PROOF STEP]
show "degree (fps_poly_swap2 p) \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (fps_poly_swap2 p) \<le> d
[PROOF STEP]
by (intro degree_fps_poly_swap2_le) fact
[PROOF STATE]
proof (state)
this:
degree (fps_poly_swap2 p) \<le> d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem nn_integral_monotone_convergence_INF_AE:
  fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> ennreal"
  assumes f: "\<And>i. AE x in M. f (Suc i) x \<le> f i x"
    and [measurable]: "\<And>i. f i \<in> borel_measurable M"
    and fin: "(\<integral>\<^sup>+ x. f i x \<partial>M) < \<infinity>"
  shows "(\<integral>\<^sup>+ x. (INF i. f i x) \<partial>M) = (INF i. integral\<^sup>N M (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
fix f :: "nat \<Rightarrow> ennreal" and j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
assume "decseq f"
[PROOF STATE]
proof (state)
this:
decseq f

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
decseq f
[PROOF STEP]
have "(INF i. f i) = (INF i. f (i + j))"
[PROOF STATE]
proof (prove)
using this:
decseq f

goal (1 subgoal):
 1. Inf (range f) = (INF i. f (i + j))
[PROOF STEP]
apply (intro INF_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>decseq f; i \<in> UNIV\<rbrakk> \<Longrightarrow> \<exists>ja\<in>UNIV. f (ja + j) \<le> f i
 2. \<And>ja. \<lbrakk>decseq f; ja \<in> UNIV\<rbrakk> \<Longrightarrow> \<exists>i\<in>UNIV. f i \<le> f (ja + j)
[PROOF STEP]
apply (rule_tac x="i" in bexI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i. \<lbrakk>decseq f; i \<in> UNIV\<rbrakk> \<Longrightarrow> f (i + j) \<le> f i
 2. \<And>i. \<lbrakk>decseq f; i \<in> UNIV\<rbrakk> \<Longrightarrow> i \<in> UNIV
 3. \<And>ja. \<lbrakk>decseq f; ja \<in> UNIV\<rbrakk> \<Longrightarrow> \<exists>i\<in>UNIV. f i \<le> f (ja + j)
[PROOF STEP]
apply (auto simp: decseq_def le_fun_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Inf (range f) = (INF i. f (i + j))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
decseq ?fa2 \<Longrightarrow> Inf (range ?fa2) = (INF i. ?fa2 (i + ?j2))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
note INF_shift = this
[PROOF STATE]
proof (state)
this:
decseq ?fa2 \<Longrightarrow> Inf (range ?fa2) = (INF i. ?fa2 (i + ?j2))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
have mono: "AE x in M. \<forall>i. f (Suc i) x \<le> f i x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. \<forall>i. f (Suc i) x \<le> f i x
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
AE x in M. f (Suc ?i) x \<le> f ?i x

goal (1 subgoal):
 1. AE x in M. \<forall>i. f (Suc i) x \<le> f i x
[PROOF STEP]
by (auto simp: AE_all_countable)
[PROOF STATE]
proof (state)
this:
AE x in M. \<forall>i. f (Suc i) x \<le> f i x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. \<forall>i. f (Suc i) x \<le> f i x
[PROOF STEP]
have "AE x in M. (INF i. f i x) = (INF n. f (n + i) x)"
[PROOF STATE]
proof (prove)
using this:
AE x in M. \<forall>i. f (Suc i) x \<le> f i x

goal (1 subgoal):
 1. AE x in M. (INF i. f i x) = (INF n. f (n + i) x)
[PROOF STEP]
by eventually_elim (auto intro!: decseq_SucI INF_shift)
[PROOF STATE]
proof (state)
this:
AE x in M. (INF i. f i x) = (INF n. f (n + i) x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. (INF i. f i x) = (INF n. f (n + i) x)
[PROOF STEP]
have "(\<integral>\<^sup>+ x. (INF i. f i x) \<partial>M) = (\<integral>\<^sup>+ x. (INF n. f (n + i) x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
AE x in M. (INF i. f i x) = (INF n. f (n + i) x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = \<integral>\<^sup>+ x. (INF n. f (n + i) x) \<partial>M
[PROOF STEP]
by (rule nn_integral_cong_AE)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = \<integral>\<^sup>+ x. (INF n. f (n + i) x) \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = \<integral>\<^sup>+ x. (INF n. f (n + i) x) \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
have "\<dots> = (INF n. (\<integral>\<^sup>+ x. f (n + i) x \<partial>M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF n. f (n + i) x) \<partial>M = (INF n. integral\<^sup>N M (f (n + i)))
[PROOF STEP]
by (rule nn_integral_monotone_convergence_INF_AE') (insert assms, auto)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (INF n. f (n + i) x) \<partial>M = (INF n. integral\<^sup>N M (f (n + i)))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (INF n. f (n + i) x) \<partial>M = (INF n. integral\<^sup>N M (f (n + i)))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
have "\<dots> = (INF n. (\<integral>\<^sup>+ x. f n x \<partial>M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF n. integral\<^sup>N M (f (n + i))) = (INF n. integral\<^sup>N M (f n))
[PROOF STEP]
by (intro INF_shift[symmetric] decseq_SucI nn_integral_mono_AE f)
[PROOF STATE]
proof (state)
this:
(INF n. integral\<^sup>N M (f (n + i))) = (INF n. integral\<^sup>N M (f n))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF n. integral\<^sup>N M (f n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF n. integral\<^sup>N M (f n))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (INF i. f i x) \<partial>M = (INF i. integral\<^sup>N M (f i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma complex_poly_decompose_rsquarefree:
  assumes "rsquarefree p"
  shows   "smult (lead_coeff p) (\<Prod>z|poly p z = 0. [:-z, 1:]) = (p :: complex poly)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
 2. p \<noteq> 0 \<Longrightarrow> smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
 2. p \<noteq> 0 \<Longrightarrow> smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
[PROOF STEP]
have "(\<Prod>z|poly p z = 0. [:-z, 1:]) = (\<Prod>z|poly p z = 0. [:-z, 1:] ^ order z p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:] ^ order z p)
[PROOF STEP]
using assms False
[PROOF STATE]
proof (prove)
using this:
rsquarefree p
p \<noteq> 0

goal (1 subgoal):
 1. (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:] ^ order z p)
[PROOF STEP]
by (intro prod.cong) (auto simp: rsquarefree_root_order)
[PROOF STATE]
proof (state)
this:
(\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:] ^ order z p)

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
 2. p \<noteq> 0 \<Longrightarrow> smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:] ^ order z p)

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
 2. p \<noteq> 0 \<Longrightarrow> smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
[PROOF STEP]
have "smult (lead_coeff p) \<dots> = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:] ^ order z p) = p
[PROOF STEP]
by (rule complex_poly_decompose)
[PROOF STATE]
proof (state)
this:
smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:] ^ order z p) = p

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
 2. p \<noteq> 0 \<Longrightarrow> smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p

goal (1 subgoal):
 1. smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p

goal (1 subgoal):
 1. p = 0 \<Longrightarrow> smult (lead_coeff p) (\<Prod>z\<in>{z. poly p z = 0}. [:- z, 1:]) = p
[PROOF STEP]
qed auto


[STATEMENT]
lemma (in Module) l_span_closed1:"\<lbrakk>H \<subseteq> carrier M;
      s \<in> {j. j \<le> (n::nat)} \<rightarrow> carrier R;
      f \<in> {j. j \<le> n} \<rightarrow> linear_span R M (carrier R) H \<rbrakk> \<Longrightarrow>
      \<Sigma>\<^sub>e M (\<lambda>j.  s j \<cdot>\<^sub>s (f j)) n \<in> linear_span R M (carrier R) H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> carrier R; f \<in> {j. j \<le> n} \<rightarrow> linear_span R M (carrier R) H\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e M (\<lambda>j. s j \<cdot>\<^sub>s f j) n \<in> linear_span R M (carrier R) H
[PROOF STEP]
apply (cut_tac sc_Ring,
       frule Ring.whole_ideal [of "R"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> carrier R; f \<in> {j. j \<le> n} \<rightarrow> linear_span R M (carrier R) H; Ring R; ideal R (carrier R)\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e M (\<lambda>j. s j \<cdot>\<^sub>s f j) n \<in> linear_span R M (carrier R) H
[PROOF STEP]
apply (frule l_span_sum_closedTr[of "carrier R" H n], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> carrier R; f \<in> {j. j \<le> n} \<rightarrow> linear_span R M (carrier R) H; Ring R; ideal R (carrier R); \<forall>s f. s \<in> {j. j \<le> n} \<rightarrow> carrier R \<and> f \<in> {j. j \<le> n} \<rightarrow> linear_span R M (carrier R) H \<longrightarrow> \<Sigma>\<^sub>e M (\<lambda>j. s j \<cdot>\<^sub>s f j) n \<in> linear_span R M (carrier R) H\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e M (\<lambda>j. s j \<cdot>\<^sub>s f j) n \<in> linear_span R M (carrier R) H
[PROOF STEP]
apply (drule_tac x = s in spec,
       drule_tac x = f in spec,
       simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma covector_inf_comp_2:
  assumes "vector x"
    shows "y * (x \<sqinter> z) = (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * (x \<sqinter> z) = (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y * (x \<sqinter> z) = (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)
[PROOF STEP]
have "y * (x \<sqinter> z) \<le> (y \<sqinter> (top * (x \<sqinter> z)\<^sup>T)) * (x \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * (x \<sqinter> z) \<le> (y \<sqinter> top * (x \<sqinter> z)\<^sup>T) * (x \<sqinter> z)
[PROOF STEP]
by (metis dedekind_2 inf_top_right)
[PROOF STATE]
proof (state)
this:
y * (x \<sqinter> z) \<le> (y \<sqinter> top * (x \<sqinter> z)\<^sup>T) * (x \<sqinter> z)

goal (1 subgoal):
 1. y * (x \<sqinter> z) = (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y * (x \<sqinter> z) \<le> (y \<sqinter> top * (x \<sqinter> z)\<^sup>T) * (x \<sqinter> z)

goal (1 subgoal):
 1. y * (x \<sqinter> z) = (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)
[PROOF STEP]
have "... \<le> (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<sqinter> top * (x \<sqinter> z)\<^sup>T) * (x \<sqinter> z) \<le> (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)
[PROOF STEP]
by (metis assms comp_left_isotone conv_dist_comp conv_order conv_top eq_refl inf_le1 inf_mono)
[PROOF STATE]
proof (state)
this:
(y \<sqinter> top * (x \<sqinter> z)\<^sup>T) * (x \<sqinter> z) \<le> (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)

goal (1 subgoal):
 1. y * (x \<sqinter> z) = (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
y * (x \<sqinter> z) \<le> (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y * (x \<sqinter> z) \<le> (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)

goal (1 subgoal):
 1. y * (x \<sqinter> z) = (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)
[PROOF STEP]
using comp_left_subdist_inf order.antisym
[PROOF STATE]
proof (prove)
using this:
y * (x \<sqinter> z) \<le> (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)
(?x \<sqinter> ?y) * ?z \<le> ?x * ?z \<sqinter> ?y * ?z
\<lbrakk>?a \<le> ?b; ?b \<le> ?a\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. y * (x \<sqinter> z) = (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y * (x \<sqinter> z) = (y \<sqinter> x\<^sup>T) * (x \<sqinter> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma range_bintrunc: "range ((take_bit :: nat \<Rightarrow> int \<Rightarrow> int) n) = {i. 0 \<le> i \<and> i < 2 ^ n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range (take_bit n) = {i. 0 \<le> i \<and> i < 2 ^ n}
[PROOF STEP]
by (auto simp add: take_bit_eq_mod image_iff) (metis mod_pos_pos_trivial)


[STATEMENT]
lemma infnorm_neg: "infnorm (- x) = infnorm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infnorm (- x) = infnorm x
[PROOF STEP]
unfolding infnorm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup {\<bar>- x \<bullet> b\<bar> |b. b \<in> Basis} = Sup {\<bar>x \<bullet> b\<bar> |b. b \<in> Basis}
[PROOF STEP]
by simp


[STATEMENT]
lemma distinct_finite_set_mset_subseteq_iff[iff]:
  assumes "distinct_mset M" "finite N"
  shows "set_mset M \<subseteq> N \<longleftrightarrow> M \<subseteq># mset_set N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set_mset M \<subseteq> N) = (M \<subseteq># mset_set N)
[PROOF STEP]
by (metis assms distinct_mset_set_mset_ident finite_set_mset msubset_mset_set_iff)


[STATEMENT]
lemma nprv_sdsjI:
"nprv F \<phi> \<Longrightarrow>
 F \<subseteq> fmla \<Longrightarrow> finite F \<Longrightarrow> G \<subseteq> fmla \<Longrightarrow> finite G \<Longrightarrow> \<phi> \<in> G \<Longrightarrow>
 nprv F (sdsj G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>nprv F \<phi>; F \<subseteq> fmla; finite F; G \<subseteq> fmla; finite G; \<phi> \<in> G\<rbrakk> \<Longrightarrow> nprv F (sdsj G)
[PROOF STEP]
unfolding nprv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prv (imp (scnj F) \<phi>); F \<subseteq> fmla; finite F; G \<subseteq> fmla; finite G; \<phi> \<in> G\<rbrakk> \<Longrightarrow> prv (imp (scnj F) (sdsj G))
[PROOF STEP]
by (simp add: prv_imp_sdsj)


[STATEMENT]
lemma wnf_lemma_1:
  "(n(p * L) * n(q * L) \<squnion> an(p * L) * an(r * L)) * n(p * L) = n(p * L) * n(q * L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n (p * L) * n (q * L) \<squnion> an (p * L) * an (r * L)) * n (p * L) = n (p * L) * n (q * L)
[PROOF STEP]
by (smt sup_commute an_n_def n_sup_left_absorb_mult n_sup_right_dist_mult n_export n_mult_commutative n_mult_complement_intro_n)


[STATEMENT]
lemma out_cong_cong:
  assumes "B Out A A0" and
    "E Out D D0" and
    "Cong B A E D" and
    "Cong B A0 E D0"
  shows "Cong A A0 D D0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cong A A0 D D0
[PROOF STEP]
by (meson Out_def assms(1) assms(2) assms(3) assms(4) cong_4321 cong_symmetry l4_3_1 l5_6 l6_13_1 l6_13_2)


[STATEMENT]
lemma lcoset_subgroup_imp_eq_reps:
  "Group H \<Longrightarrow> w +o H \<subseteq> w' +o G \<Longrightarrow> w' +o G = w +o G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group H; w +o H \<subseteq> w' +o G\<rbrakk> \<Longrightarrow> w' +o G = w +o G
[PROOF STEP]
using Group.lcoset_refl[of H w] lcoset_conv_set[of w] lcoset_el_reduce
        set_plus_rearrange2[of w' "-w'+w" G]
[PROOF STATE]
proof (prove)
using this:
Group H \<Longrightarrow> w \<in> w +o H
w \<in> ?b +o ?A \<Longrightarrow> - ?b + w \<in> ?A
?a \<in> G \<Longrightarrow> ?a +o G = G
w' +o ((- w' + w) +o G) = (w' + (- w' + w)) +o G

goal (1 subgoal):
 1. \<lbrakk>Group H; w +o H \<subseteq> w' +o G\<rbrakk> \<Longrightarrow> w' +o G = w +o G
[PROOF STEP]
by    force


[STATEMENT]
lemma inside_same_component:
   "\<lbrakk>connected_component (- S) x y; x \<in> inside S\<rbrakk> \<Longrightarrow> y \<in> inside S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>connected_component (- S) x y; x \<in> inside S\<rbrakk> \<Longrightarrow> y \<in> inside S
[PROOF STEP]
using connected_component_eq connected_component_in
[PROOF STATE]
proof (prove)
using this:
?y \<in> connected_component_set ?S ?x \<Longrightarrow> connected_component_set ?S ?y = connected_component_set ?S ?x
connected_component ?S ?x ?y \<Longrightarrow> ?x \<in> ?S \<and> ?y \<in> ?S

goal (1 subgoal):
 1. \<lbrakk>connected_component (- S) x y; x \<in> inside S\<rbrakk> \<Longrightarrow> y \<in> inside S
[PROOF STEP]
by (fastforce simp add: inside_def)


[STATEMENT]
lemma finite_field_ops_integer: "field_ops (finite_field_ops_integer pp) mod_ring_rel_integer"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. field_ops (finite_field_ops_integer pp) mod_ring_rel_integer
[PROOF STEP]
by (unfold_locales, insert ring_finite_field_ops_integer[OF *], auto simp:
  ring_ops_def
  finite_field_ops_integer_def
  mod_ring_divide_integer
  mod_ring_inverse_integer
  mod_ring_mod_integer
  mod_ring_normalize_integer)


[STATEMENT]
lemma cprank_upper_bound: "cprank A \<le> prod_list (dims A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cprank A \<le> prod_list (dims A)
[PROOF STEP]
unfolding cprank_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. cprank_max n A) \<le> prod_list (dims A)
[PROOF STEP]
using cprank_max_upper_bound Least_le
[PROOF STATE]
proof (prove)
using this:
cprank_max (prod_list (dims ?A)) ?A
?P ?k \<Longrightarrow> (LEAST x. ?P x) \<le> ?k

goal (1 subgoal):
 1. (LEAST n. cprank_max n A) \<le> prod_list (dims A)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma future_reach_And_Not: "future_reach (And_Not \<phi> \<psi>) = max (future_reach \<phi>) (future_reach \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. future_reach (And_Not \<phi> \<psi>) = max (future_reach \<phi>) (future_reach \<psi>)
[PROOF STEP]
unfolding And_Not_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. future_reach (Neg (Or (Neg \<phi>) \<psi>)) = max (future_reach \<phi>) (future_reach \<psi>)
[PROOF STEP]
by simp