[STATEMENT]
lemma block_sum_ssub_bound:
  shows "\<forall>t. (\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
have "(\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b))
          \<le> (\<Sum>k\<le>length p - 1. nth_digit (s k && z (l k)) t b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> (\<Sum>k\<le>length p - 1. nth_digit (s k && z (l k)) t b)
[PROOF STEP]
unfolding sum_ssub_nzero.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..length p - 1. if issub (p ! k) \<and> j = goes_to (p ! k) then nth_digit (s k && z (l k)) t b else 0) \<le> (\<Sum>k\<le>length p - 1. nth_digit (s k && z (l k)) t b)
[PROOF STEP]
by (simp add: atMost_atLeast0 sum_mono)
[PROOF STATE]
proof (state)
this:
\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> (\<Sum>k\<le>length p - 1. nth_digit (s k && z (l k)) t b)

goal (1 subgoal):
 1. \<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> (\<Sum>k\<le>length p - 1. nth_digit (s k && z (l k)) t b)

goal (1 subgoal):
 1. \<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
have "... \<le> (\<Sum>k\<le>length p - 1. Seq k t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>length p - 1. nth_digit (s k && z (l k)) t b) \<le> (\<Sum>k\<le>length p - 1. Seq k t)
[PROOF STEP]
using bitAND_sum_lt[where ?x = "\<lambda>k. z (l k)"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<le>length p - 1. nth_digit (s k && z (l k)) ?t b) \<le> (\<Sum>k\<le>length p - 1. Seq k ?t)

goal (1 subgoal):
 1. (\<Sum>k\<le>length p - 1. nth_digit (s k && z (l k)) t b) \<le> (\<Sum>k\<le>length p - 1. Seq k t)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>length p - 1. nth_digit (s k && z (l k)) t b) \<le> (\<Sum>k\<le>length p - 1. Seq k t)

goal (1 subgoal):
 1. \<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> (\<Sum>k\<le>length p - 1. Seq k t)
[PROOF STEP]
have "(\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> (\<Sum>k\<le>length p - 1. Seq k t)

goal (1 subgoal):
 1. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
using sum_sk_bound[of t] Seq_def
[PROOF STATE]
proof (prove)
using this:
\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> (\<Sum>k\<le>length p - 1. Seq k t)
(\<Sum>k\<le>length p - 1. nth_digit (s k) t b) \<le> 1
Seq = (\<lambda>k t. nth_digit (s k) t b)

goal (1 subgoal):
 1. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
using dual_order.trans
[PROOF STATE]
proof (prove)
using this:
\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> (\<Sum>k\<le>length p - 1. Seq k t)
(\<Sum>k\<le>length p - 1. nth_digit (s k) t b) \<le> 1
Seq = (\<lambda>k t. nth_digit (s k) t b)
\<lbrakk>?b \<le> ?a; ?c \<le> ?b\<rbrakk> \<Longrightarrow> ?c \<le> ?a

goal (1 subgoal):
 1. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1

goal (1 subgoal):
 1. \<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) ?t2 b)  \<le> 1

goal (1 subgoal):
 1. \<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) ?t2 b)  \<le> 1

goal (1 subgoal):
 1. \<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
using Seq_def
[PROOF STATE]
proof (prove)
using this:
\<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) ?t2 b)  \<le> 1
Seq = (\<lambda>k t. nth_digit (s k) t b)

goal (1 subgoal):
 1. \<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>t. \<Sum>S- p j (\<lambda>k. nth_digit (s k && z (l k)) t b)  \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invertible_times_non_zero:
  fixes M :: "real^'n^'n"
  assumes "invertible M" and "v \<noteq> 0"
  shows "M *v v \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M *v v \<noteq> 0
[PROOF STEP]
using \<open>invertible M\<close> and \<open>v \<noteq> 0\<close> and invertible_times_eq_zero [of M v]
[PROOF STATE]
proof (prove)
using this:
invertible M
v \<noteq> 0
\<lbrakk>invertible M; M *v v = 0\<rbrakk> \<Longrightarrow> v = 0

goal (1 subgoal):
 1. M *v v \<noteq> 0
[PROOF STEP]
by auto


[STATEMENT]
lemma one_le_Log_cancel_iff[simp]:
  "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 1 \<le> Log a x \<longleftrightarrow> a \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (1 \<le> Log a x) = (a \<le> x)
[PROOF STEP]
using Log_le_cancel_iff[of a a x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < a; 0 < a; 0 < x\<rbrakk> \<Longrightarrow> (Log a a \<le> Log a x) = (a \<le> x)

goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (1 \<le> Log a x) = (a \<le> x)
[PROOF STEP]
by simp


[STATEMENT]
lemma basis_to_basis_subspace_isomorphism:
  assumes s: "vs1.subspace S"
    and t: "vs2.subspace T"
    and d: "vs1.dim S = vs2.dim T"
    and B: "B \<subseteq> S" "vs1.independent B" "S \<subseteq> vs1.span B" "card B = vs1.dim S"
    and C: "C \<subseteq> T" "vs2.independent C" "T \<subseteq> vs2.span C" "card C = vs2.dim T"
  shows "\<exists>f. linear s1 s2 f \<and> f ` B = C \<and> f ` S = T \<and> inj_on f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. linear (*a) (*b) f \<and> f ` B = C \<and> f ` S = T \<and> inj_on f S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. linear (*a) (*b) f \<and> f ` B = C \<and> f ` S = T \<and> inj_on f S
[PROOF STEP]
from B
[PROOF STATE]
proof (chain)
picking this:
B \<subseteq> S
vs1.independent B
S \<subseteq> vs1.span B
card B = vs1.dim S
[PROOF STEP]
have fB: "finite B"
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> S
vs1.independent B
S \<subseteq> vs1.span B
card B = vs1.dim S

goal (1 subgoal):
 1. finite B
[PROOF STEP]
by (simp add: vs1.finiteI_independent)
[PROOF STATE]
proof (state)
this:
finite B

goal (1 subgoal):
 1. \<exists>f. linear (*a) (*b) f \<and> f ` B = C \<and> f ` S = T \<and> inj_on f S
[PROOF STEP]
from C
[PROOF STATE]
proof (chain)
picking this:
C \<subseteq> T
vs2.independent C
T \<subseteq> vs2.span C
card C = vs2.dim T
[PROOF STEP]
have fC: "finite C"
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> T
vs2.independent C
T \<subseteq> vs2.span C
card C = vs2.dim T

goal (1 subgoal):
 1. finite C
[PROOF STEP]
by (simp add: vs2.finiteI_independent)
[PROOF STATE]
proof (state)
this:
finite C

goal (1 subgoal):
 1. \<exists>f. linear (*a) (*b) f \<and> f ` B = C \<and> f ` S = T \<and> inj_on f S
[PROOF STEP]
from finite_basis_to_basis_subspace_isomorphism[OF s t d fB B fC C]
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. linear (*a) (*b) f \<and> f ` B = C \<and> f ` S = T \<and> inj_on f S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>f. linear (*a) (*b) f \<and> f ` B = C \<and> f ` S = T \<and> inj_on f S

goal (1 subgoal):
 1. \<exists>f. linear (*a) (*b) f \<and> f ` B = C \<and> f ` S = T \<and> inj_on f S
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<exists>f. linear (*a) (*b) f \<and> f ` B = C \<and> f ` S = T \<and> inj_on f S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma long_chain_card_geq:
  assumes "local_long_ch_by_ord f X" and fin: "finite X"
  shows "card X \<ge> 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<le> card X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 3 \<le> card X
[PROOF STEP]
obtain x y z where xyz: "x\<in>X" "y\<in>X" "z\<in>X" and neq: "x\<noteq>y" "x\<noteq>z" "y\<noteq>z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y z. \<lbrakk>x \<in> X; y \<in> X; z \<in> X; x \<noteq> y; x \<noteq> z; y \<noteq> z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using three_in_long_chain assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>local_long_ch_by_ord ?f ?X; \<And>x y z. \<lbrakk>x \<in> ?X; y \<in> ?X; z \<in> ?X; x \<noteq> y; x \<noteq> z; y \<noteq> z\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
local_long_ch_by_ord f X
finite X

goal (1 subgoal):
 1. (\<And>x y z. \<lbrakk>x \<in> X; y \<in> X; z \<in> X; x \<noteq> y; x \<noteq> z; y \<noteq> z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> X
y \<in> X
z \<in> X
x \<noteq> y
x \<noteq> z
y \<noteq> z

goal (1 subgoal):
 1. 3 \<le> card X
[PROOF STEP]
let ?S = "{x,y,z}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 3 \<le> card X
[PROOF STEP]
have "?S \<subseteq> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x, y, z} \<subseteq> X
[PROOF STEP]
by (simp add: xyz)
[PROOF STATE]
proof (state)
this:
{x, y, z} \<subseteq> X

goal (1 subgoal):
 1. 3 \<le> card X
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{x, y, z} \<subseteq> X

goal (1 subgoal):
 1. 3 \<le> card X
[PROOF STEP]
have "card ?S \<ge> 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<le> card {x, y, z}
[PROOF STEP]
using antisym \<open>x \<noteq> y\<close> \<open>x \<noteq> z\<close> \<open>y \<noteq> z\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<le> ?b; ?b \<le> ?a\<rbrakk> \<Longrightarrow> ?a = ?b
x \<noteq> y
x \<noteq> z
y \<noteq> z

goal (1 subgoal):
 1. 3 \<le> card {x, y, z}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 \<le> card {x, y, z}

goal (1 subgoal):
 1. 3 \<le> card X
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{x, y, z} \<subseteq> X
3 \<le> card {x, y, z}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{x, y, z} \<subseteq> X
3 \<le> card {x, y, z}

goal (1 subgoal):
 1. 3 \<le> card X
[PROOF STEP]
by (meson neq fin three_subset)
[PROOF STATE]
proof (state)
this:
3 \<le> card X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma toSet_splitP[simp]:
  "(\<forall>(x', b', c')\<in>toSet (\<Gamma>' @ (x, b, c) #\<^sub>\<Gamma> \<Gamma>). P x' b' c') \<longleftrightarrow> (\<forall> (x', b', c')\<in>toSet \<Gamma>'. P x' b' c') \<and> P x b c \<and> (\<forall> (x', b', c')\<in>toSet \<Gamma>. P x' b' c')"  (is "?A \<longleftrightarrow> ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>(x', b', c')\<in>toSet (\<Gamma>' @ (x, b, c) #\<^sub>\<Gamma> \<Gamma>). P x' b' c') = ((\<forall>(x', b', c')\<in>toSet \<Gamma>'. P x' b' c') \<and> P x b c \<and> (\<forall>(x', b', c')\<in>toSet \<Gamma>. P x' b' c'))
[PROOF STEP]
using toSet_splitU
[PROOF STATE]
proof (prove)
using this:
((?x', ?b', ?c') \<in> toSet (?\<Gamma>' @ (?x, ?b, ?c) #\<^sub>\<Gamma> ?\<Gamma>)) = ((?x', ?b', ?c') \<in> toSet ?\<Gamma>' \<union> {(?x, ?b, ?c)} \<union> toSet ?\<Gamma>)

goal (1 subgoal):
 1. (\<forall>(x', b', c')\<in>toSet (\<Gamma>' @ (x, b, c) #\<^sub>\<Gamma> \<Gamma>). P x' b' c') = ((\<forall>(x', b', c')\<in>toSet \<Gamma>'. P x' b' c') \<and> P x b c \<and> (\<forall>(x', b', c')\<in>toSet \<Gamma>. P x' b' c'))
[PROOF STEP]
by force


[STATEMENT]
lemma get_salt: "\<lbrakk> 176 + sLen \<le> emBits; roundup emBits 8 * 8 - emBits \<le> 7\<rbrakk> \<Longrightarrow> (generate_salt (maskedDB_zero (generate_DB (generate_PS emBits 160)) emBits)) = salt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>176 + sLen \<le> emBits; roundup emBits 8 * 8 - emBits \<le> 7\<rbrakk> \<Longrightarrow> generate_salt (maskedDB_zero (generate_DB (generate_PS emBits 160)) emBits) = salt
[PROOF STEP]
apply (insert roundup_help2 [of emBits] length_generate_PS [of emBits] equal_zero [of emBits])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>176 + sLen \<le> emBits; roundup emBits 8 * 8 - emBits \<le> 7; 176 + sLen \<le> emBits \<Longrightarrow> roundup emBits 8 * 8 - emBits \<le> roundup emBits 8 * 8 - 160 - sLen - 16; length (generate_PS emBits 160) = roundup emBits 8 * 8 - sLen - 160 - 16; \<lbrakk>176 + sLen \<le> emBits; roundup emBits 8 * 8 - emBits \<le> roundup emBits 8 * 8 - (176 + sLen)\<rbrakk> \<Longrightarrow> 0 = roundup emBits 8 * 8 - emBits - (roundup emBits 8 * 8 - (176 + sLen))\<rbrakk> \<Longrightarrow> generate_salt (maskedDB_zero (generate_DB (generate_PS emBits 160)) emBits) = salt
[PROOF STEP]
apply (simp add: generate_DB_def generate_PS_def maskedDB_zero_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>176 + sLen \<le> emBits; roundup emBits 8 * 8 - emBits \<le> 7; roundup emBits 8 * 8 - emBits \<le> roundup emBits 8 * 8 - (176 + sLen); length (bv_prepend (roundup emBits 8 * 8 - (176 + sLen)) \<zero> []) = roundup emBits 8 * 8 - (176 + sLen)\<rbrakk> \<Longrightarrow> generate_salt (bv_prepend (roundup emBits 8 * 8 - emBits) \<zero> (drop (roundup emBits 8 * 8 - emBits) (bv_prepend (roundup emBits 8 * 8 - (176 + sLen)) \<zero> []) @ \<zero> # \<zero> # \<zero> # \<zero> # \<zero> # \<zero> # \<zero> # \<one> # salt)) = salt
[PROOF STEP]
apply (simp add: bv_prepend_split bv_prepend_drop generate_salt_def
    show_rightmost_bits_def sLen_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma a_alt_def:
  assumes "l < length fs"
  shows "a i (Suc l) = (let v = \<mu>' l l \<cdot>\<^sub>v (a i l) - ( \<mu>' i l) \<cdot>\<^sub>v a l l in
                       (if l = 0 then v else (1 / \<mu>' (l - 1) (l - 1)) \<cdot>\<^sub>v v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a i (Suc l) = (let v = \<mu>' l l \<cdot>\<^sub>v a i l - \<mu>' i l \<cdot>\<^sub>v a l l in if l = 0 then v else (1::'a) / \<mu>' (l - 1) (l - 1) \<cdot>\<^sub>v v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a i (Suc l) = (let v = \<mu>' l l \<cdot>\<^sub>v a i l - \<mu>' i l \<cdot>\<^sub>v a l l in if l = 0 then v else (1::'a) / \<mu>' (l - 1) (l - 1) \<cdot>\<^sub>v v)
[PROOF STEP]
have [simp]: "\<mu>' (l - Suc 0) (l - Suc 0) = d l" if "0 < l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<mu>' (l - Suc 0) (l - Suc 0) = d l
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < l

goal (1 subgoal):
 1. \<mu>' (l - Suc 0) (l - Suc 0) = d l
[PROOF STEP]
unfolding \<mu>'_def
[PROOF STATE]
proof (prove)
using this:
0 < l

goal (1 subgoal):
 1. d (Suc (l - Suc 0)) * \<mu> (l - Suc 0) (l - Suc 0) = d l
[PROOF STEP]
by (auto simp add: \<mu>.simps)
[PROOF STATE]
proof (state)
this:
0 < l \<Longrightarrow> \<mu>' (l - Suc 0) (l - Suc 0) = d l

goal (1 subgoal):
 1. a i (Suc l) = (let v = \<mu>' l l \<cdot>\<^sub>v a i l - \<mu>' i l \<cdot>\<^sub>v a l l in if l = 0 then v else (1::'a) / \<mu>' (l - 1) (l - 1) \<cdot>\<^sub>v v)
[PROOF STEP]
have [simp]: "\<mu>' l l = d (Suc l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<mu>' l l = d (Suc l)
[PROOF STEP]
unfolding \<mu>'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d (Suc l) * \<mu> l l = d (Suc l)
[PROOF STEP]
by (auto simp add: \<mu>.simps)
[PROOF STATE]
proof (state)
this:
\<mu>' l l = d (Suc l)

goal (1 subgoal):
 1. a i (Suc l) = (let v = \<mu>' l l \<cdot>\<^sub>v a i l - \<mu>' i l \<cdot>\<^sub>v a l l in if l = 0 then v else (1::'a) / \<mu>' (l - 1) (l - 1) \<cdot>\<^sub>v v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a i (Suc l) = (let v = \<mu>' l l \<cdot>\<^sub>v a i l - \<mu>' i l \<cdot>\<^sub>v a l l in if l = 0 then v else (1::'a) / \<mu>' (l - 1) (l - 1) \<cdot>\<^sub>v v)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < length fs

goal (1 subgoal):
 1. a i (Suc l) = (let v = \<mu>' l l \<cdot>\<^sub>v a i l - \<mu>' i l \<cdot>\<^sub>v a l l in if l = 0 then v else (1::'a) / \<mu>' (l - 1) (l - 1) \<cdot>\<^sub>v v)
[PROOF STEP]
by (auto simp add: Let_def a_l')
[PROOF STATE]
proof (state)
this:
a i (Suc l) = (let v = \<mu>' l l \<cdot>\<^sub>v a i l - \<mu>' i l \<cdot>\<^sub>v a l l in if l = 0 then v else (1::'a) / \<mu>' (l - 1) (l - 1) \<cdot>\<^sub>v v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in bounded_sesquilinear) bounded_clinear_right: "bounded_clinear (\<lambda>b. prod a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_clinear ((**) a)
[PROOF STEP]
apply standard
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>b1 b2. a ** (b1 + b2) = a ** b1 + a ** b2
 2. \<And>r b. a ** r *\<^sub>C b = r *\<^sub>C (a ** b)
 3. \<exists>K. \<forall>x. norm (a ** x) \<le> norm x * K
[PROOF STEP]
apply (auto simp add: scaleC_right add_right)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (a ** x) \<le> norm x * K
[PROOF STEP]
by (metis ab_semigroup_mult_class.mult_ac(1) ordered_field_class.sign_simps(34) real.pos_bounded)


[STATEMENT]
lemma less_length_cut_same:
  "\<lbrakk>(w @- sconst y) !! p = a\<rbrakk> \<Longrightarrow> a = y \<or> (p < length (cut_same y (w @- sconst y)) \<and> w ! p = a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w @- sconst y) !! p = a \<Longrightarrow> a = y \<or> p < length (cut_same y (w @- sconst y)) \<and> w ! p = a
[PROOF STEP]
unfolding cut_same_def length_stake
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w @- sconst y) !! p = a \<Longrightarrow> a = y \<or> p < (LEAST n. sdrop n (w @- sconst y) = sconst y) \<and> w ! p = a
[PROOF STEP]
by (rule LeastI2_ex[OF exI[of _ "length w"]])
    (auto simp: sdrop_shift shift_snth split: if_split_asm elim!: drop_sconstE)


[STATEMENT]
lemma gs_rel_dec:
  assumes "l \<noteq> 0" "GS_rec_fun\<^sub>b v \<noteq> \<nu>\<^sub>b_opt"
  shows "\<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>
[PROOF STEP]
have "log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c \<le> log (1 / l) (l * dist v \<nu>\<^sub>b_opt) - c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c \<le> log (1 / l) (l * dist v \<nu>\<^sub>b_opt) - c
[PROOF STEP]
using GS.\<L>\<^sub>b_split_contraction[of _ "\<nu>\<^sub>b_opt"] GS.QR_contraction norm_GS_QR_le_disc disc_lt_one GS_QR_disc_le_disc
[PROOF STATE]
proof (prove)
using this:
dist (GS_rec_fun\<^sub>b ?v) (GS_rec_fun\<^sub>b \<nu>\<^sub>b_opt) \<le> GS.QR_disc * dist ?v \<nu>\<^sub>b_opt
GS.QR_disc < 1
norm (inv\<^sub>L (Q_GS ?d) o\<^sub>L R_GS ?d) \<le> l
l < 1
GS.QR_disc \<le> l

goal (1 subgoal):
 1. log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c \<le> log (1 / l) (l * dist v \<nu>\<^sub>b_opt) - c
[PROOF STEP]
by (fastforce simp: assms less_le intro!: log_le order.trans[OF GS.\<L>\<^sub>b_split_contraction[of v "\<nu>\<^sub>b_opt", simplified]] mult_right_mono)
[PROOF STATE]
proof (state)
this:
log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c \<le> log (1 / l) (l * dist v \<nu>\<^sub>b_opt) - c

goal (1 subgoal):
 1. \<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c \<le> log (1 / l) (l * dist v \<nu>\<^sub>b_opt) - c

goal (1 subgoal):
 1. \<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>
[PROOF STEP]
have "\<dots> = log (1 / l) l + log (1/l) (dist v \<nu>\<^sub>b_opt) - c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log (1 / l) (l * dist v \<nu>\<^sub>b_opt) - c = log (1 / l) l + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c
[PROOF STEP]
using assms disc_lt_one
[PROOF STATE]
proof (prove)
using this:
l \<noteq> 0
GS_rec_fun\<^sub>b v \<noteq> \<nu>\<^sub>b_opt
l < 1

goal (1 subgoal):
 1. log (1 / l) (l * dist v \<nu>\<^sub>b_opt) - c = log (1 / l) l + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c
[PROOF STEP]
by (auto simp: less_le intro!: log_mult)
[PROOF STATE]
proof (state)
this:
log (1 / l) (l * dist v \<nu>\<^sub>b_opt) - c = log (1 / l) l + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c

goal (1 subgoal):
 1. \<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
log (1 / l) (l * dist v \<nu>\<^sub>b_opt) - c = log (1 / l) l + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c

goal (1 subgoal):
 1. \<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>
[PROOF STEP]
have "\<dots> = -(log (1 / l) (1/l)) + (log (1/l) (dist v \<nu>\<^sub>b_opt)) - c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log (1 / l) l + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c = - log (1 / l) (1 / l) + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c
[PROOF STEP]
using assms disc_lt_one
[PROOF STATE]
proof (prove)
using this:
l \<noteq> 0
GS_rec_fun\<^sub>b v \<noteq> \<nu>\<^sub>b_opt
l < 1

goal (1 subgoal):
 1. log (1 / l) l + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c = - log (1 / l) (1 / l) + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c
[PROOF STEP]
by (subst log_inverse[symmetric]) (auto simp: less_le right_inverse_eq)
[PROOF STATE]
proof (state)
this:
log (1 / l) l + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c = - log (1 / l) (1 / l) + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c

goal (1 subgoal):
 1. \<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
log (1 / l) l + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c = - log (1 / l) (1 / l) + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c

goal (1 subgoal):
 1. \<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>
[PROOF STEP]
have "\<dots> = (log (1/l) (dist v \<nu>\<^sub>b_opt)) - 1 - c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - log (1 / l) (1 / l) + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c = log (1 / l) (dist v \<nu>\<^sub>b_opt) - 1 - c
[PROOF STEP]
using assms order.strict_implies_not_eq[OF disc_lt_one]
[PROOF STATE]
proof (prove)
using this:
l \<noteq> 0
GS_rec_fun\<^sub>b v \<noteq> \<nu>\<^sub>b_opt
l \<noteq> 1

goal (1 subgoal):
 1. - log (1 / l) (1 / l) + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c = log (1 / l) (dist v \<nu>\<^sub>b_opt) - 1 - c
[PROOF STEP]
by (auto intro!: log_eq_one neq_le_trans)
[PROOF STATE]
proof (state)
this:
- log (1 / l) (1 / l) + log (1 / l) (dist v \<nu>\<^sub>b_opt) - c = log (1 / l) (dist v \<nu>\<^sub>b_opt) - 1 - c

goal (1 subgoal):
 1. \<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c \<le> log (1 / l) (dist v \<nu>\<^sub>b_opt) - 1 - c
[PROOF STEP]
have "log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c \<le> log (1 / l) (dist v \<nu>\<^sub>b_opt) - 1 - c"
[PROOF STATE]
proof (prove)
using this:
log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c \<le> log (1 / l) (dist v \<nu>\<^sub>b_opt) - 1 - c

goal (1 subgoal):
 1. log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c \<le> log (1 / l) (dist v \<nu>\<^sub>b_opt) - 1 - c
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c \<le> log (1 / l) (dist v \<nu>\<^sub>b_opt) - 1 - c

goal (1 subgoal):
 1. \<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c \<le> log (1 / l) (dist v \<nu>\<^sub>b_opt) - 1 - c

goal (1 subgoal):
 1. \<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<lceil>log (1 / l) (dist (GS_rec_fun\<^sub>b v) \<nu>\<^sub>b_opt) - c\<rceil> < \<lceil>log (1 / l) (dist v \<nu>\<^sub>b_opt) - c\<rceil>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cp_thm':
  assumes "iszlfm p"
    and "d_\<beta> p 1"
    and "d_\<delta> p d"
    and "d > 0"
  shows "(\<exists>x. Ifm bbs (x # bs) p) \<longleftrightarrow>
    ((\<exists>j\<in> {1 .. d}. Ifm bbs (j#bs) (minusinf p)) \<or>
      (\<exists>j\<in> {1.. d}. \<exists>b\<in> (Inum (i#bs)) ` set (\<beta> p). Ifm bbs ((b + j) # bs) p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. Ifm bbs (x # bs) p) = ((\<exists>j\<in>{1..d}. Ifm bbs (j # bs) (minusinf p)) \<or> (\<exists>j\<in>{1..d}. \<exists>b\<in>Inum (i # bs) ` set (\<beta> p). Ifm bbs ((b + j) # bs) p))
[PROOF STEP]
using cp_thm[OF assms,where i="i"]
[PROOF STATE]
proof (prove)
using this:
(\<exists>x. Ifm ?bbs (x # ?bs) p) = (\<exists>j\<in>{1..d}. Ifm ?bbs (j # ?bs) (minusinf p) \<or> (\<exists>b\<in>set (\<beta> p). Ifm ?bbs ((Inum (i # ?bs) b + j) # ?bs) p))

goal (1 subgoal):
 1. (\<exists>x. Ifm bbs (x # bs) p) = ((\<exists>j\<in>{1..d}. Ifm bbs (j # bs) (minusinf p)) \<or> (\<exists>j\<in>{1..d}. \<exists>b\<in>Inum (i # bs) ` set (\<beta> p). Ifm bbs ((b + j) # bs) p))
[PROOF STEP]
by auto


[STATEMENT]
lemma A_authenticates_B_bis:
     "\<lbrakk> Outpts (Card A) A  \<lbrace>Agent B, Nonce Nb, Key K, Cert2\<rbrace> \<in> set evs;
        \<not>illegalUse(Card B);
        evs \<in> srb \<rbrakk>
 \<Longrightarrow> \<exists> Cert1. Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace>
                \<in> set evs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, Key K, Cert2\<rbrace> \<in> set evs; \<not> illegalUse (Card B); evs \<in> srb\<rbrakk> \<Longrightarrow> \<exists>Cert1. Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace> \<in> set evs
[PROOF STEP]
apply (blast dest: Na_Nb_certificate_authentic Outpts_A_Card_form_10 Outpts_A_Card_imp_pairK_parts)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma no_rewritten_fermat4:
  "\<not> (\<exists> (a::int) b. (a^4 + b^4 = c^2 \<and> a*b*c \<noteq> 0 \<and> odd a \<and> coprime a b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>a b. a ^ 4 + b ^ 4 = c\<^sup>2 \<and> a * b * c \<noteq> 0 \<and> odd a \<and> coprime a b
[PROOF STEP]
proof (induct c rule: infinite_descent0_measure[where V="\<lambda>c. nat(c^2)"])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. nat (x\<^sup>2) = 0 \<Longrightarrow> \<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b
 2. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
case (0 x)
[PROOF STATE]
proof (state)
this:
nat (x\<^sup>2) = 0

goal (2 subgoals):
 1. \<And>x. nat (x\<^sup>2) = 0 \<Longrightarrow> \<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b
 2. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
have "x^2 \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x\<^sup>2
[PROOF STEP]
by (rule zero_le_power2)
[PROOF STATE]
proof (state)
this:
0 \<le> x\<^sup>2

goal (2 subgoals):
 1. \<And>x. nat (x\<^sup>2) = 0 \<Longrightarrow> \<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b
 2. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
with 0
[PROOF STATE]
proof (chain)
picking this:
nat (x\<^sup>2) = 0
0 \<le> x\<^sup>2
[PROOF STEP]
have "int(nat(x^2)) = 0"
[PROOF STATE]
proof (prove)
using this:
nat (x\<^sup>2) = 0
0 \<le> x\<^sup>2

goal (1 subgoal):
 1. int (nat (x\<^sup>2)) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (nat (x\<^sup>2)) = 0

goal (2 subgoals):
 1. \<And>x. nat (x\<^sup>2) = 0 \<Longrightarrow> \<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b
 2. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
hence "x = 0"
[PROOF STATE]
proof (prove)
using this:
int (nat (x\<^sup>2)) = 0

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

goal (2 subgoals):
 1. \<And>x. nat (x\<^sup>2) = 0 \<Longrightarrow> \<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b
 2. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
x = 0

goal (1 subgoal):
 1. \<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
case (smaller x)
[PROOF STATE]
proof (state)
this:
0 < nat (x\<^sup>2)
\<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < nat (x\<^sup>2)
\<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
obtain a b where "a^4 + b^4 = x^2" and "a*b*x \<noteq> 0"
    and "odd a" and "coprime a b"
[PROOF STATE]
proof (prove)
using this:
0 < nat (x\<^sup>2)
\<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a ^ 4 + b ^ 4 = x\<^sup>2; a * b * x \<noteq> 0; odd a; coprime a b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a ^ 4 + b ^ 4 = x\<^sup>2
a * b * x \<noteq> 0
odd a
coprime a b

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
hence "\<exists> p q r. (p^4+q^4=r^2 \<and> p*q*r \<noteq> 0 \<and> odd p
    \<and> coprime p q \<and> r^2 < x^2)"
[PROOF STATE]
proof (prove)
using this:
a ^ 4 + b ^ 4 = x\<^sup>2
a * b * x \<noteq> 0
odd a
coprime a b

goal (1 subgoal):
 1. \<exists>p q r. p ^ 4 + q ^ 4 = r\<^sup>2 \<and> p * q * r \<noteq> 0 \<and> odd p \<and> coprime p q \<and> r\<^sup>2 < x\<^sup>2
[PROOF STEP]
by (rule smaller_fermat4)
[PROOF STATE]
proof (state)
this:
\<exists>p q r. p ^ 4 + q ^ 4 = r\<^sup>2 \<and> p * q * r \<noteq> 0 \<and> odd p \<and> coprime p q \<and> r\<^sup>2 < x\<^sup>2

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>p q r. p ^ 4 + q ^ 4 = r\<^sup>2 \<and> p * q * r \<noteq> 0 \<and> odd p \<and> coprime p q \<and> r\<^sup>2 < x\<^sup>2
[PROOF STEP]
obtain p q r where pqr: "p^4 + q^4 = r^2 \<and> p*q*r \<noteq> 0 \<and> odd p
    \<and> coprime p q \<and> r^2 < x^2"
[PROOF STATE]
proof (prove)
using this:
\<exists>p q r. p ^ 4 + q ^ 4 = r\<^sup>2 \<and> p * q * r \<noteq> 0 \<and> odd p \<and> coprime p q \<and> r\<^sup>2 < x\<^sup>2

goal (1 subgoal):
 1. (\<And>p q r. p ^ 4 + q ^ 4 = r\<^sup>2 \<and> p * q * r \<noteq> 0 \<and> odd p \<and> coprime p q \<and> r\<^sup>2 < x\<^sup>2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p ^ 4 + q ^ 4 = r\<^sup>2 \<and> p * q * r \<noteq> 0 \<and> odd p \<and> coprime p q \<and> r\<^sup>2 < x\<^sup>2

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
have "r^2 \<ge> 0" and "x^2 \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> r\<^sup>2 &&& 0 \<le> x\<^sup>2
[PROOF STEP]
by (auto simp only: zero_le_power2)
[PROOF STATE]
proof (state)
this:
0 \<le> r\<^sup>2
0 \<le> x\<^sup>2

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
hence "int(nat(r^2)) = r^2 \<and> int(nat(x^2)) = x^2"
[PROOF STATE]
proof (prove)
using this:
0 \<le> r\<^sup>2
0 \<le> x\<^sup>2

goal (1 subgoal):
 1. int (nat (r\<^sup>2)) = r\<^sup>2 \<and> int (nat (x\<^sup>2)) = x\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (nat (r\<^sup>2)) = r\<^sup>2 \<and> int (nat (x\<^sup>2)) = x\<^sup>2

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
with pqr
[PROOF STATE]
proof (chain)
picking this:
p ^ 4 + q ^ 4 = r\<^sup>2 \<and> p * q * r \<noteq> 0 \<and> odd p \<and> coprime p q \<and> r\<^sup>2 < x\<^sup>2
int (nat (r\<^sup>2)) = r\<^sup>2 \<and> int (nat (x\<^sup>2)) = x\<^sup>2
[PROOF STEP]
have "int(nat(r^2)) < int(nat(x^2))"
[PROOF STATE]
proof (prove)
using this:
p ^ 4 + q ^ 4 = r\<^sup>2 \<and> p * q * r \<noteq> 0 \<and> odd p \<and> coprime p q \<and> r\<^sup>2 < x\<^sup>2
int (nat (r\<^sup>2)) = r\<^sup>2 \<and> int (nat (x\<^sup>2)) = x\<^sup>2

goal (1 subgoal):
 1. int (nat (r\<^sup>2)) < int (nat (x\<^sup>2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (nat (r\<^sup>2)) < int (nat (x\<^sup>2))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
hence "nat(r^2) < nat(x^2)"
[PROOF STATE]
proof (prove)
using this:
int (nat (r\<^sup>2)) < int (nat (x\<^sup>2))

goal (1 subgoal):
 1. nat (r\<^sup>2) < nat (x\<^sup>2)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
nat (r\<^sup>2) < nat (x\<^sup>2)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat (x\<^sup>2); \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = x\<^sup>2 \<and> a * b * x \<noteq> 0 \<and> odd a \<and> coprime a b)\<rbrakk> \<Longrightarrow> \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
with pqr
[PROOF STATE]
proof (chain)
picking this:
p ^ 4 + q ^ 4 = r\<^sup>2 \<and> p * q * r \<noteq> 0 \<and> odd p \<and> coprime p q \<and> r\<^sup>2 < x\<^sup>2
nat (r\<^sup>2) < nat (x\<^sup>2)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
p ^ 4 + q ^ 4 = r\<^sup>2 \<and> p * q * r \<noteq> 0 \<and> odd p \<and> coprime p q \<and> r\<^sup>2 < x\<^sup>2
nat (r\<^sup>2) < nat (x\<^sup>2)

goal (1 subgoal):
 1. \<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y. nat (y\<^sup>2) < nat (x\<^sup>2) \<and> \<not> (\<nexists>a b. a ^ 4 + b ^ 4 = y\<^sup>2 \<and> a * b * y \<noteq> 0 \<and> odd a \<and> coprime a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_vsubst_commute:
assumes "wls s X"
and "xs \<noteq> xs' \<or> {x,y} \<inter> {x',y'} = {}" and "fresh xs x X" and "fresh xs' x' X"
shows "((X #[x // y]_xs) #[x' // y']_xs') = ((X #[x' // y']_xs') #[x // y]_xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X #[x // y]_xs #[x' // y']_xs' = X #[x' // y']_xs' #[x // y]_xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
xs \<noteq> xs' \<or> {x, y} \<inter> {x', y'} = {}
fresh xs x X
fresh xs' x' X

goal (1 subgoal):
 1. X #[x // y]_xs #[x' // y']_xs' = X #[x' // y']_xs' #[x // y]_xs
[PROOF STEP]
by(simp add: vsubst_commute)


[STATEMENT]
lemma int_of_uint64_plus: "int_of_uint64 (x + y) = (int_of_uint64 x + int_of_uint64 y) mod 18446744073709551616"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_uint64 (x + y) = (int_of_uint64 x + int_of_uint64 y) mod 18446744073709551616
[PROOF STEP]
by (transfer, unfold uint_word_ariths two_64, rule refl)


[STATEMENT]
lemma abs_conv_abscissa_diff_leI:
  "abs_conv_abscissa (f :: 'a :: dirichlet_series fds) \<le> d \<Longrightarrow> abs_conv_abscissa g \<le> d \<Longrightarrow>
     abs_conv_abscissa (f - g) \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>abs_conv_abscissa f \<le> d; abs_conv_abscissa g \<le> d\<rbrakk> \<Longrightarrow> abs_conv_abscissa (f - g) \<le> d
[PROOF STEP]
using abs_conv_abscissa_add_le[of f "-g"]
[PROOF STATE]
proof (prove)
using this:
abs_conv_abscissa (f + - g) \<le> max (abs_conv_abscissa f) (abs_conv_abscissa (- g))

goal (1 subgoal):
 1. \<lbrakk>abs_conv_abscissa f \<le> d; abs_conv_abscissa g \<le> d\<rbrakk> \<Longrightarrow> abs_conv_abscissa (f - g) \<le> d
[PROOF STEP]
by (auto simp: le_max_iff_disj)


[STATEMENT]
lemma grab_eqD:
    "\<lbrakk>grab N n = (A,M); infinite N\<rbrakk>
    \<Longrightarrow> A \<lless> M \<and> finite A \<and> card A = n \<and> infinite M \<and> A \<subseteq> N \<and> M \<subseteq> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>grab N n = (A, M); infinite N\<rbrakk> \<Longrightarrow> A \<lless> M \<and> finite A \<and> card A = n \<and> infinite M \<and> A \<subseteq> N \<and> M \<subseteq> N
[PROOF STEP]
using card_grab grab_def less_sets_grab finite_grab_iff
[PROOF STATE]
proof (prove)
using this:
infinite ?N \<Longrightarrow> card (fst (grab ?N ?n)) = ?n
grab ?N ?n \<equiv> (?N \<inter> enum ?N ` {..<?n}, ?N \<inter> {enum ?N ?n..})
infinite ?N \<Longrightarrow> fst (grab ?N ?n) \<lless> snd (grab ?N ?n)
finite (snd (grab ?N ?n)) = finite ?N

goal (1 subgoal):
 1. \<lbrakk>grab N n = (A, M); infinite N\<rbrakk> \<Longrightarrow> A \<lless> M \<and> finite A \<and> card A = n \<and> infinite M \<and> A \<subseteq> N \<and> M \<subseteq> N
[PROOF STEP]
by auto


[STATEMENT]
lemma size1_height_log: "log 2 (size1 t) \<le> height t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log 2 (real (size1 t)) \<le> real (height t)
[PROOF STEP]
by (simp add: log2_of_power_le size1_height)


[STATEMENT]
lemma L1_D:
  assumes "f \<in> space\<^sub>N (\<LL> 1 M)"
  shows "f \<in> borel_measurable M"
        "integrable M f"
        "Norm (\<LL> 1 M) f = (\<integral>x. \<bar>f x\<bar> \<partial>M)"
        "eNorm (\<LL> 1 M) f = (\<integral>x. \<bar>f x\<bar> \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> borel_measurable M &&& integrable M f) &&& Norm (\<LL> 1 M) f = LINT x|M. \<bar>f x\<bar> &&& eNorm (\<LL> 1 M) f = ennreal (LINT x|M. \<bar>f x\<bar>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> space\<^sub>N (\<LL> 1 M)

goal (1 subgoal):
 1. (f \<in> borel_measurable M &&& integrable M f) &&& Norm (\<LL> 1 M) f = LINT x|M. \<bar>f x\<bar> &&& eNorm (\<LL> 1 M) f = ennreal (LINT x|M. \<bar>f x\<bar>)
[PROOF STEP]
by (auto simp add: L1_space L1_I)


[STATEMENT]
lemma
  assumes "c > (1 :: real)" "k \<noteq> 0"
  shows   "(\<lambda>n. real n ^ k) \<in> o(\<lambda>n. c ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real n ^ k) \<in> o((^) c)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < c
k \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>n. real n ^ k) \<in> o((^) c)
[PROOF STEP]
by (real_asymp (verbose))


[STATEMENT]
lemma invariant_1_2_poly_cond2: "invariant_1_2 rai \<Longrightarrow> poly_cond2 (poly_real_alg_1 rai)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invariant_1_2 rai \<Longrightarrow> poly_cond2 (poly_real_alg_1 rai)
[PROOF STEP]
unfolding invariant_1_def invariant_1_2_def poly_cond2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case rai of (p, l, r) \<Rightarrow> (\<exists>!x. root_cond (p, l, r) x) \<and> sgn l = sgn r \<and> poly_cond p) \<and> 1 < degree (poly_real_alg_1 rai) \<Longrightarrow> poly_cond (poly_real_alg_1 rai) \<and> 1 < degree (poly_real_alg_1 rai)
[PROOF STEP]
by auto


[STATEMENT]
lemma real_distribution_interval_measure:
  fixes F :: "real \<Rightarrow> real"
  assumes nondecF : "\<And> x y. x \<le> y \<Longrightarrow> F x \<le> F y" and
    right_cont_F : "\<And>a. continuous (at_right a) F" and
    lim_F_at_bot : "(F \<longlongrightarrow> 0) at_bot" and
    lim_F_at_top : "(F \<longlongrightarrow> 1) at_top"
  shows "real_distribution (interval_measure F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_distribution (interval_measure F)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_distribution (interval_measure F)
[PROOF STEP]
let ?F = "interval_measure F"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_distribution (interval_measure F)
[PROOF STEP]
interpret prob_space ?F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (interval_measure F)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (interval_measure F) (space (interval_measure F)) = 1
[PROOF STEP]
qed (use interval_measure_UNIV[OF assms] in simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_distribution (interval_measure F)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_distribution (interval_measure F)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. events = sets borel
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
real_distribution (interval_measure F)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_int_div:
  fixes d :: int
  assumes "d \<noteq> 0" "d dvd n"
  shows "(of_int (n div d) ::'a::field_char_0) = of_int n / of_int d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (n div d) = of_int n / of_int d
[PROOF STEP]
using assms of_int_div_aux [of d n, where ?'a = 'a]
[PROOF STATE]
proof (prove)
using this:
d \<noteq> 0
d dvd n
d \<noteq> 0 \<Longrightarrow> of_int n / of_int d = of_int (n div d) + of_int (n mod d) / of_int d

goal (1 subgoal):
 1. of_int (n div d) = of_int n / of_int d
[PROOF STEP]
by simp


[STATEMENT]
lemma conditional_entropy_eq_ce_with_hypothesis:
  "\<H>(X | Y) = -(\<Sum>y\<in>Y`msgs. (\<P>(Y) {y}) * (\<Sum>x\<in>X`msgs. (\<P>(X ; Y) {(x,y)}) / (\<P>(Y) {y}) *
     log b ((\<P>(X ; Y) {(x,y)}) / (\<P>(Y) {y}))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<H>( X | Y ) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
apply (subst conditional_entropy_eq[OF
    simple_distributedI[OF simple_function_finite _ refl]
    simple_distributedI[OF simple_function_finite _ refl]])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. 0 \<le> prob (Y -` {x} \<inter> space \<mu>)
 2. \<And>x. 0 \<le> prob ((\<lambda>x. (X x, Y x)) -` {x} \<inter> space \<mu>)
 3. - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` space \<mu>. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> space \<mu>) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> space \<mu>) / prob (Y -` {y} \<inter> space \<mu>))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
unfolding space_point_measure
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. 0 \<le> prob (Y -` {x} \<inter> msgs)
 2. \<And>x. 0 \<le> prob ((\<lambda>x. (X x, Y x)) -` {x} \<inter> msgs)
 3. - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. 0 \<le> prob (Y -` {x} \<inter> msgs)
 2. \<And>x. 0 \<le> prob ((\<lambda>x. (X x, Y x)) -` {x} \<inter> msgs)
 3. - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
have "- (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. (\<P>(X ; Y) {(x, y)}) * log b ((\<P>(X ; Y) {(x, y)}) / (\<P>(Y) {y}))) =
    - (\<Sum>x\<in>X`msgs. (\<Sum>y\<in>Y`msgs. (\<P>(X ; Y) {(x, y)}) * log b ((\<P>(X ; Y) {(x, y)}) / (\<P>(Y) {y}))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>x\<in>X ` msgs. \<Sum>y\<in>Y ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs)))
[PROOF STEP]
unfolding sum.cartesian_product
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>(x, y)\<in>X ` msgs \<times> Y ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs)))
[PROOF STEP]
apply (intro arg_cong[where f=uminus] sum.mono_neutral_left)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite (X ` msgs \<times> Y ` msgs)
 2. (\<lambda>x. (X x, Y x)) ` msgs \<subseteq> X ` msgs \<times> Y ` msgs
 3. \<forall>i\<in>X ` msgs \<times> Y ` msgs - (\<lambda>x. (X x, Y x)) ` msgs. (case i of (x, y) \<Rightarrow> prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = 0
[PROOF STEP]
apply (auto simp: vimage_def image_iff intro!: measure_eq_0I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa ba ab bb a bc. \<lbrakk>\<forall>x\<in>msgs. X (aa, ba) = X x \<longrightarrow> Y (ab, bb) \<noteq> Y x; (aa, ba) \<in> msgs; (ab, bb) \<in> msgs; log b (prob ({x. X x = X (aa, ba) \<and> Y x = Y (ab, bb)} \<inter> msgs) / prob ({x. Y x = Y (ab, bb)} \<inter> msgs)) \<noteq> 0; (a, bc) \<in> msgs; X (a, bc) = X (aa, ba); Y (a, bc) = Y (ab, bb)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply metis
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
- (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>x\<in>X ` msgs. \<Sum>y\<in>Y ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs)))

goal (3 subgoals):
 1. \<And>x. 0 \<le> prob (Y -` {x} \<inter> msgs)
 2. \<And>x. 0 \<le> prob ((\<lambda>x. (X x, Y x)) -` {x} \<inter> msgs)
 3. - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>x\<in>X ` msgs. \<Sum>y\<in>Y ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs)))

goal (3 subgoals):
 1. \<And>x. 0 \<le> prob (Y -` {x} \<inter> msgs)
 2. \<And>x. 0 \<le> prob ((\<lambda>x. (X x, Y x)) -` {x} \<inter> msgs)
 3. - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
have "\<dots> = - (\<Sum>y\<in>Y`msgs. (\<Sum>x\<in>X`msgs. (\<P>(X ; Y) {(x, y)}) * log b ((\<P>(X ; Y) {(x, y)}) / (\<P>(Y) {y}))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Sum>x\<in>X ` msgs. \<Sum>y\<in>Y ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. \<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs)))
[PROOF STEP]
by (subst sum.swap) rule
[PROOF STATE]
proof (state)
this:
- (\<Sum>x\<in>X ` msgs. \<Sum>y\<in>Y ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. \<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs)))

goal (3 subgoals):
 1. \<And>x. 0 \<le> prob (Y -` {x} \<inter> msgs)
 2. \<And>x. 0 \<le> prob ((\<lambda>x. (X x, Y x)) -` {x} \<inter> msgs)
 3. - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (\<Sum>x\<in>X ` msgs. \<Sum>y\<in>Y ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. \<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs)))

goal (3 subgoals):
 1. \<And>x. 0 \<le> prob (Y -` {x} \<inter> msgs)
 2. \<And>x. 0 \<le> prob ((\<lambda>x. (X x, Y x)) -` {x} \<inter> msgs)
 3. - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
have "\<dots> = -(\<Sum>y\<in>Y`msgs. (\<P>(Y) {y}) * (\<Sum>x\<in>X`msgs. (\<P>(X ; Y) {(x,y)}) / (\<P>(Y) {y}) * log b ((\<P>(X ; Y) {(x,y)}) / (\<P>(Y) {y}))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Sum>y\<in>Y ` msgs. \<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
by (auto simp add: sum_distrib_left vimage_def intro!: sum.cong prob_conj_imp1)
[PROOF STATE]
proof (state)
this:
- (\<Sum>y\<in>Y ` msgs. \<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))

goal (3 subgoals):
 1. \<And>x. 0 \<le> prob (Y -` {x} \<inter> msgs)
 2. \<And>x. 0 \<le> prob ((\<lambda>x. (X x, Y x)) -` {x} \<inter> msgs)
 3. - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
show "- (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. (\<P>(X ; Y) {(x, y)}) * log b ((\<P>(X ; Y) {(x, y)}) / (\<P>(Y) {y}))) =
    -(\<Sum>y\<in>Y`msgs. (\<P>(Y) {y}) * (\<Sum>x\<in>X`msgs. (\<P>(X ; Y) {(x,y)}) / (\<P>(Y) {y}) * log b ((\<P>(X ; Y) {(x,y)}) / (\<P>(Y) {y}))))"
[PROOF STATE]
proof (prove)
using this:
- (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))

goal (1 subgoal):
 1. - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
- (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x)) ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))) = - (\<Sum>y\<in>Y ` msgs. prob (Y -` {y} \<inter> msgs) * (\<Sum>x\<in>X ` msgs. prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs) * log b (prob ((\<lambda>x. (X x, Y x)) -` {(x, y)} \<inter> msgs) / prob (Y -` {y} \<inter> msgs))))

goal (2 subgoals):
 1. \<And>x. 0 \<le> prob (Y -` {x} \<inter> msgs)
 2. \<And>x. 0 \<le> prob ((\<lambda>x. (X x, Y x)) -` {x} \<inter> msgs)
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma Hermite_unique_JNF_aux:
  fixes A::"'a::{bezout_ring_div,normalization_euclidean_semiring,unique_euclidean_ring} mat"
  assumes "A \<in> carrier_mat n n"
    "P \<in> carrier_mat n n"
    "H \<in> carrier_mat n n"
    "Q \<in> carrier_mat n n "
    "K \<in> carrier_mat n n"
  assumes "A = P * H"
    and "A = Q * K" and "invertible_mat A" and "invertible_mat P"
    and "invertible_mat Q" and "Hermite_JNF associates res H" and "Hermite_JNF associates res K"
shows "H = K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H = K
[PROOF STEP]
using Hermite_unique_JNF_with_nontriv_mod_ring[unfolded CARD_mod_ring,
      internalize_sort "'n::nontriv", where ?'a='b]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>class.nontriv TYPE('b); ?A \<in> carrier_mat CARD('b) CARD('b); ?P \<in> carrier_mat CARD('b) CARD('b); ?H \<in> carrier_mat CARD('b) CARD('b); ?Q \<in> carrier_mat CARD('b) CARD('b); ?K \<in> carrier_mat CARD('b) CARD('b); ?A = ?P * ?H; ?A = ?Q * ?K; invertible_mat ?A; invertible_mat ?P; invertible_mat ?Q; Hermite_JNF ?associates ?res ?H; Hermite_JNF ?associates ?res ?K\<rbrakk> \<Longrightarrow> ?H = ?K

goal (1 subgoal):
 1. H = K
[PROOF STEP]
unfolding type_to_set(2)[symmetric]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>class.nontriv TYPE('b); ?A \<in> carrier_mat n n; ?P \<in> carrier_mat n n; ?H \<in> carrier_mat n n; ?Q \<in> carrier_mat n n; ?K \<in> carrier_mat n n; ?A = ?P * ?H; ?A = ?Q * ?K; invertible_mat ?A; invertible_mat ?P; invertible_mat ?Q; Hermite_JNF ?associates ?res ?H; Hermite_JNF ?associates ?res ?K\<rbrakk> \<Longrightarrow> ?H = ?K

goal (1 subgoal):
 1. H = K
[PROOF STEP]
using type_to_set(1) assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>class.nontriv TYPE('b); ?A \<in> carrier_mat n n; ?P \<in> carrier_mat n n; ?H \<in> carrier_mat n n; ?Q \<in> carrier_mat n n; ?K \<in> carrier_mat n n; ?A = ?P * ?H; ?A = ?Q * ?K; invertible_mat ?A; invertible_mat ?P; invertible_mat ?Q; Hermite_JNF ?associates ?res ?H; Hermite_JNF ?associates ?res ?K\<rbrakk> \<Longrightarrow> ?H = ?K
class.nontriv TYPE('b)
A \<in> carrier_mat n n
P \<in> carrier_mat n n
H \<in> carrier_mat n n
Q \<in> carrier_mat n n
K \<in> carrier_mat n n
A = P * H
A = Q * K
invertible_mat A
invertible_mat P
invertible_mat Q
Hermite_JNF associates res H
Hermite_JNF associates res K

goal (1 subgoal):
 1. H = K
[PROOF STEP]
by blast


[STATEMENT]
lemma independent_vnmD2:
  fixes p q r \<alpha>
  assumes "\<alpha> \<in> {0<..1}"
    and "p \<in> C"
    and "q \<in> C"
    and "r \<in> C"
  assumes "independent_vnm C P"
  assumes "p \<succeq>[P] q"
  shows "mix_pmf \<alpha> p r \<succeq>[P] mix_pmf \<alpha> q r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mix_pmf \<alpha> p r \<succeq>[P] mix_pmf \<alpha> q r
[PROOF STEP]
using assms independece_dest_alt
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<in> {0<..1}
p \<in> C
q \<in> C
r \<in> C
independent_vnm C P
p \<succeq>[P] q
independent_vnm ?C ?P \<Longrightarrow> \<forall>p\<in>?C. \<forall>q\<in>?C. \<forall>r\<in>?C. \<forall>\<alpha>\<in>{0<..1}. p \<succeq>[?P] q = mix_pmf \<alpha> p r \<succeq>[?P] mix_pmf \<alpha> q r

goal (1 subgoal):
 1. mix_pmf \<alpha> p r \<succeq>[P] mix_pmf \<alpha> q r
[PROOF STEP]
by blast


[STATEMENT]
lemma nonEmptySet:
shows "A \<noteq> [] \<longrightarrow> (\<exists> a. a \<in> set A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> [] \<longrightarrow> (\<exists>a. a \<in> set A)
[PROOF STEP]
by (auto simp add:neq_Nil_conv)


[STATEMENT]
lemma p_props:  "(\<Sum>i<k. as!i * bs!i powr p) = 1"
  and p_unique: "(\<Sum>i<k. as!i * bs!i powr p') = 1 \<Longrightarrow> p = p'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<k. as ! i * bs ! i powr p) = 1 &&& ((\<Sum>i<k. as ! i * bs ! i powr p') = 1 \<Longrightarrow> p = p')
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Sum>i<k. as ! i * bs ! i powr p) = 1
 2. (\<Sum>i<k. as ! i * bs ! i powr p') = 1 \<Longrightarrow> p = p'
[PROOF STEP]
from theI'[OF akra_bazzi_p_unique] the1_equality[OF akra_bazzi_p_unique]
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i<k. as ! i * bs ! i powr (THE x. (\<Sum>i<k. as ! i * bs ! i powr x) = 1)) = 1
(\<Sum>i<k. as ! i * bs ! i powr ?a) = 1 \<Longrightarrow> (THE x. (\<Sum>i<k. as ! i * bs ! i powr x) = 1) = ?a
[PROOF STEP]
show "(\<Sum>i<k. as!i * bs!i powr p) = 1" "(\<Sum>i<k. as!i * bs!i powr p') = 1 \<Longrightarrow> p = p'"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<k. as ! i * bs ! i powr (THE x. (\<Sum>i<k. as ! i * bs ! i powr x) = 1)) = 1
(\<Sum>i<k. as ! i * bs ! i powr ?a) = 1 \<Longrightarrow> (THE x. (\<Sum>i<k. as ! i * bs ! i powr x) = 1) = ?a

goal (1 subgoal):
 1. (\<Sum>i<k. as ! i * bs ! i powr p) = 1 &&& ((\<Sum>i<k. as ! i * bs ! i powr p') = 1 \<Longrightarrow> p = p')
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<k. as ! i * bs ! i powr (THE x. (\<Sum>i<k. as ! i * bs ! i powr x) = 1)) = 1
(\<Sum>i<k. as ! i * bs ! i powr ?a) = 1 \<Longrightarrow> (THE x. (\<Sum>i<k. as ! i * bs ! i powr x) = 1) = ?a

goal (1 subgoal):
 1. (\<Sum>i<k. as ! i * bs ! i powr (THE p. (\<Sum>i<k. as ! i * bs ! i powr p) = 1)) = 1 &&& ((\<Sum>i<k. as ! i * bs ! i powr p') = 1 \<Longrightarrow> (THE p. (\<Sum>i<k. as ! i * bs ! i powr p) = 1) = p')
[PROOF STEP]
by - blast+
[PROOF STATE]
proof (state)
this:
(\<Sum>i<k. as ! i * bs ! i powr p) = 1
(\<Sum>i<k. as ! i * bs ! i powr p') = 1 \<Longrightarrow> p = p'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linear_with_overloaded[ud_with]:
  "Vector_Spaces.linear =
    (
      \<lambda>scale\<^sub>1 scale\<^sub>2.
        linear_with (+) 0 (-) uminus scale\<^sub>1 (+) 0 (-) uminus scale\<^sub>2
    )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Vector_Spaces.linear = (\<lambda>scale\<^sub>1. linear_with (+) (0::'b) (-) uminus scale\<^sub>1 (+) (0::'c) (-) uminus)
[PROOF STEP]
unfolding
    Vector_Spaces.linear_def linear_with_def
    vector_space_with_overloaded module_hom_with_overloaded
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>s1 s2 f. vector_space_with (+) (0::'b) (-) uminus s1 \<and> vector_space_with (+) (0::'c) (-) uminus s2 \<and> module_hom_with (+) (0::'b) (-) uminus s1 (+) (0::'c) (-) uminus s2 f) = (\<lambda>scale\<^sub>1 scale\<^sub>2 f. vector_space_with (+) (0::'b) (-) uminus scale\<^sub>1 \<and> vector_space_with (+) (0::'c) (-) uminus scale\<^sub>2 \<and> module_hom_with (+) (0::'b) (-) uminus scale\<^sub>1 (+) (0::'c) (-) uminus scale\<^sub>2 f)
[PROOF STEP]
..


[STATEMENT]
lemma
  "((\<lambda>x::real. (x^2 - 1) / abs (x - 1)) \<longlongrightarrow> 2) (at_right 1)"
  "((\<lambda>x::real. (x^2 - 1) / abs (x - 1)) \<longlongrightarrow> -2) (at_left 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (x\<^sup>2 - 1) / \<bar>x - 1\<bar>) \<longlongrightarrow> 2) (at_right 1) &&& ((\<lambda>x. (x\<^sup>2 - 1) / \<bar>x - 1\<bar>) \<longlongrightarrow> - 2) (at_left 1)
[PROOF STEP]
by real_asymp+