[STATEMENT]
lemma index_eq_nextl_le_states: "card (UNIV // eq_nextl) \<le> card (states M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (UNIV // eq_nextl) \<le> card (states M)
[PROOF STEP]
apply (rule surj_card_le [where f = left_lang, OF finite])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV // eq_nextl \<subseteq> left_lang ` states M
[PROOF STEP]
apply (auto simp: quotient_def eq_nextl_class_in_left_lang_im)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma max_prop:
  fixes XS::"('a BC) set"
  assumes "XS \<noteq> {}"
    and "finite XS"
  shows "MAX XS \<in> XS"
    and "\<forall>b'\<in>XS. length b' \<le> length (MAX XS)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MAX XS \<in> XS &&& \<forall>b'\<in>XS. length b' \<le> length (MAX XS)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. MAX XS \<in> XS
 2. \<forall>b'\<in>XS. length b' \<le> length (MAX XS)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
XS \<noteq> {}
finite XS
[PROOF STEP]
have "\<exists>xs\<in>XS. \<forall>ys\<in>XS. length ys \<le> length xs"
[PROOF STATE]
proof (prove)
using this:
XS \<noteq> {}
finite XS

goal (1 subgoal):
 1. \<exists>xs\<in>XS. \<forall>ys\<in>XS. length ys \<le> length xs
[PROOF STEP]
using max_ex[of XS]
[PROOF STATE]
proof (prove)
using this:
XS \<noteq> {}
finite XS
\<lbrakk>XS \<noteq> {}; finite XS\<rbrakk> \<Longrightarrow> \<exists>xs\<in>XS. \<forall>ys\<in>XS. length ys \<le> length xs

goal (1 subgoal):
 1. \<exists>xs\<in>XS. \<forall>ys\<in>XS. length ys \<le> length xs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>xs\<in>XS. \<forall>ys\<in>XS. length ys \<le> length xs

goal (2 subgoals):
 1. MAX XS \<in> XS
 2. \<forall>b'\<in>XS. length b' \<le> length (MAX XS)
[PROOF STEP]
with MAX_def[of XS]
[PROOF STATE]
proof (chain)
picking this:
MAX XS = (SOME b. max_cond XS b)
\<exists>xs\<in>XS. \<forall>ys\<in>XS. length ys \<le> length xs
[PROOF STEP]
show "MAX XS \<in> XS" and "\<forall>b'\<in>XS. length b' \<le> length (MAX XS)"
[PROOF STATE]
proof (prove)
using this:
MAX XS = (SOME b. max_cond XS b)
\<exists>xs\<in>XS. \<forall>ys\<in>XS. length ys \<le> length xs

goal (1 subgoal):
 1. MAX XS \<in> XS &&& \<forall>b'\<in>XS. length b' \<le> length (MAX XS)
[PROOF STEP]
using someI_ex[of "\<lambda>b. b \<in> XS \<and> (\<forall>b'\<in>XS. length b' \<le> length b)"]
[PROOF STATE]
proof (prove)
using this:
MAX XS = (SOME b. max_cond XS b)
\<exists>xs\<in>XS. \<forall>ys\<in>XS. length ys \<le> length xs
\<exists>x. max_cond XS x \<Longrightarrow> max_cond XS (SOME x. max_cond XS x)

goal (1 subgoal):
 1. MAX XS \<in> XS &&& \<forall>b'\<in>XS. length b' \<le> length (MAX XS)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
MAX XS \<in> XS
\<forall>b'\<in>XS. length b' \<le> length (MAX XS)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sgn1_eq_1_sub_sgn2: "sgn1  = (\<lambda> x. 1 - (sgn2 x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn1 = (\<lambda>x. 1 - sgn2 x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. sgn1 x = 1 - sgn2 x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. sgn1 x = 1 - sgn2 x
[PROOF STEP]
show "sgn1 x = 1 - sgn2 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn1 x = 1 - sgn2 x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sgn1 x = 1 - sgn2 x
[PROOF STEP]
have "1- sgn2 x = 1 - (1 - x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - sgn2 x = 1 - (1 - x)
[PROOF STEP]
by (simp add: sgn2_eq_1_sub_arg)
[PROOF STATE]
proof (state)
this:
1 - sgn2 x = 1 - (1 - x)

goal (1 subgoal):
 1. sgn1 x = 1 - sgn2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 - sgn2 x = 1 - (1 - x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 - sgn2 x = 1 - (1 - x)

goal (1 subgoal):
 1. sgn1 x = 1 - sgn2 x
[PROOF STEP]
by (simp add: sgn1_def, cases x, auto)
[PROOF STATE]
proof (state)
this:
sgn1 x = 1 - sgn2 x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sgn1 x = 1 - sgn2 x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integer_eqI:
  "int_of_integer k = int_of_integer l \<Longrightarrow> k = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_integer k = int_of_integer l \<Longrightarrow> k = l
[PROOF STEP]
using integer_eq_iff [of k l]
[PROOF STATE]
proof (prove)
using this:
(k = l) = (int_of_integer k = int_of_integer l)

goal (1 subgoal):
 1. int_of_integer k = int_of_integer l \<Longrightarrow> k = l
[PROOF STEP]
by simp


[STATEMENT]
lemma minus_add_cancel [simp]: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> - x + (x + y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> - x + (x + y) = y
[PROOF STEP]
by (simp add: add_assoc [symmetric])


[STATEMENT]
lemma enn2real_of_nat[simp]: "enn2real (of_nat n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (of_nat n) = real n
[PROOF STEP]
by (auto simp: enn2real_def)


[STATEMENT]
lemma qtable_join_fixed:
  assumes "qtable n A P Q1 X" "qtable n B P Q2 Y" "\<not> b \<Longrightarrow> B \<subseteq> A" "C = A \<union> B"
  "\<And>x. wf_tuple n C x \<Longrightarrow> P x \<Longrightarrow> P (restrict A x) \<and> P (restrict B x)"
  shows "qtable n C P (\<lambda>x. Q1 (restrict A x) \<and> (if b then Q2 (restrict B x) else \<not> Q2 (restrict B x))) (join X b Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qtable n C P (\<lambda>x. Q1 (restrict A x) \<and> (if b then Q2 (restrict B x) else \<not> Q2 (restrict B x))) (join X b Y)
[PROOF STEP]
by (rule qtable_join[OF assms]) auto


[STATEMENT]
lemma map_pmf_comp: "map_pmf f (map_pmf g M) = map_pmf (\<lambda>x. f (g x)) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_pmf f (map_pmf g M) = map_pmf (\<lambda>x. f (g x)) M
[PROOF STEP]
using map_pmf_compose[of f g]
[PROOF STATE]
proof (prove)
using this:
map_pmf (f \<circ> g) = map_pmf f \<circ> map_pmf g

goal (1 subgoal):
 1. map_pmf f (map_pmf g M) = map_pmf (\<lambda>x. f (g x)) M
[PROOF STEP]
by (simp add: comp_def)


[STATEMENT]
lemma inverts_mat_sym:
  fixes A B:: "complex mat"
  assumes "inverts_mat A B" and "dim_row B = dim_col A" and "square_mat B"
  shows "inverts_mat B A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
define n where d0:"n = dim_row B"
[PROOF STATE]
proof (state)
this:
n = dim_row B

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
have "A * B = 1\<^sub>m (dim_row A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B = 1\<^sub>m (dim_row A)
[PROOF STEP]
using assms(1) inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
inverts_mat A B
inverts_mat ?A ?B \<equiv> ?A * ?B = 1\<^sub>m (dim_row ?A)

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

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A * B = 1\<^sub>m (dim_row A)

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
have "dim_col B = dim_col (A * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col B = dim_col (A * B)
[PROOF STEP]
using times_mat_def
[PROOF STATE]
proof (prove)
using this:
?A * ?B \<equiv> mat (dim_row ?A) (dim_col ?B) (\<lambda>(i, j). row ?A i \<bullet> col ?B j)

goal (1 subgoal):
 1. dim_col B = dim_col (A * B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col B = dim_col (A * B)

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A * B = 1\<^sub>m (dim_row A)
dim_col B = dim_col (A * B)
[PROOF STEP]
have "dim_col B = dim_row A"
[PROOF STATE]
proof (prove)
using this:
A * B = 1\<^sub>m (dim_row A)
dim_col B = dim_col (A * B)

goal (1 subgoal):
 1. dim_col B = dim_row A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col B = dim_row A

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dim_col B = dim_row A
[PROOF STEP]
have c0:"A \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
dim_col B = dim_row A

goal (1 subgoal):
 1. A \<in> carrier_mat n n
[PROOF STEP]
using assms(2,3) d0
[PROOF STATE]
proof (prove)
using this:
dim_col B = dim_row A
dim_row B = dim_col A
square_mat B
n = dim_row B

goal (1 subgoal):
 1. A \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
have c1:"B \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> carrier_mat n n
[PROOF STEP]
using assms(3) d0
[PROOF STATE]
proof (prove)
using this:
square_mat B
n = dim_row B

goal (1 subgoal):
 1. B \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat n n

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
have f0:"A * B = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B = 1\<^sub>m n
[PROOF STEP]
using inverts_mat_def c0 c1 assms(1)
[PROOF STATE]
proof (prove)
using this:
inverts_mat ?A ?B \<equiv> ?A * ?B = 1\<^sub>m (dim_row ?A)
A \<in> carrier_mat n n
B \<in> carrier_mat n n
inverts_mat A B

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

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
have f1:"det B \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det B \<noteq> 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det B = 0 \<Longrightarrow> False
[PROOF STEP]
assume "det B = 0"
[PROOF STATE]
proof (state)
this:
det B = 0

goal (1 subgoal):
 1. det B = 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
det B = 0
[PROOF STEP]
have "\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
det B = 0

goal (1 subgoal):
 1. \<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n
[PROOF STEP]
using det_0_iff_vec_prod_zero assms(3) c1
[PROOF STATE]
proof (prove)
using this:
det B = 0
?A \<in> carrier_mat ?n ?n \<Longrightarrow> (det ?A = (0::?'a)) = (\<exists>v. v \<in> carrier_vec ?n \<and> v \<noteq> 0\<^sub>v ?n \<and> ?A *\<^sub>v v = 0\<^sub>v ?n)
square_mat B
B \<in> carrier_mat n n

goal (1 subgoal):
 1. \<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. det B = 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n
[PROOF STEP]
obtain v where d1:"v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. (\<And>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. det B = 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n
[PROOF STEP]
have d2:"dim_vec v = n"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. dim_vec v = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_vec v = n

goal (1 subgoal):
 1. det B = 0 \<Longrightarrow> False
[PROOF STEP]
have "B * |v\<rangle> = |0\<^sub>v n\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * |v\<rangle> = |0\<^sub>v n\<rangle>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
 2. dim_row (B * |v\<rangle>) = dim_row |0\<^sub>v n\<rangle>
 3. dim_col (B * |v\<rangle>) = dim_col |0\<^sub>v n\<rangle>
[PROOF STEP]
show "dim_row (B * |v\<rangle>) = dim_row |0\<^sub>v n\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (B * |v\<rangle>) = dim_row |0\<^sub>v n\<rangle>
[PROOF STEP]
using ket_vec_def d0
[PROOF STATE]
proof (prove)
using this:
|?v\<rangle> \<equiv> mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)
n = dim_row B

goal (1 subgoal):
 1. dim_row (B * |v\<rangle>) = dim_row |0\<^sub>v n\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row (B * |v\<rangle>) = dim_row |0\<^sub>v n\<rangle>

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
 2. dim_col (B * |v\<rangle>) = dim_col |0\<^sub>v n\<rangle>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
 2. dim_col (B * |v\<rangle>) = dim_col |0\<^sub>v n\<rangle>
[PROOF STEP]
show "dim_col (B * |v\<rangle>) = dim_col |0\<^sub>v n\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (B * |v\<rangle>) = dim_col |0\<^sub>v n\<rangle>
[PROOF STEP]
using ket_vec_def d0
[PROOF STATE]
proof (prove)
using this:
|?v\<rangle> \<equiv> mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)
n = dim_row B

goal (1 subgoal):
 1. dim_col (B * |v\<rangle>) = dim_col |0\<^sub>v n\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col (B * |v\<rangle>) = dim_col |0\<^sub>v n\<rangle>

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
[PROOF STEP]
assume "i < dim_row |0\<^sub>v n\<rangle>" and "j < dim_col |0\<^sub>v n\<rangle>"
[PROOF STATE]
proof (state)
this:
i < dim_row |0\<^sub>v n\<rangle>
j < dim_col |0\<^sub>v n\<rangle>

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row |0\<^sub>v n\<rangle>
j < dim_col |0\<^sub>v n\<rangle>
[PROOF STEP]
have f2:"i < n \<and> j = 0"
[PROOF STATE]
proof (prove)
using this:
i < dim_row |0\<^sub>v n\<rangle>
j < dim_col |0\<^sub>v n\<rangle>

goal (1 subgoal):
 1. i < n \<and> j = 0
[PROOF STEP]
using ket_vec_def
[PROOF STATE]
proof (prove)
using this:
i < dim_row |0\<^sub>v n\<rangle>
j < dim_col |0\<^sub>v n\<rangle>
|?v\<rangle> \<equiv> mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)

goal (1 subgoal):
 1. i < n \<and> j = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i < n \<and> j = 0

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i < n \<and> j = 0

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
[PROOF STEP]
have "vec (dim_row B) (($) v) = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (dim_row B) (($) v) = v
[PROOF STEP]
using d0 d1
[PROOF STATE]
proof (prove)
using this:
n = dim_row B
v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. vec (dim_row B) (($) v) = v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec (dim_row B) (($) v) = v

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vec (dim_row B) (($) v) = v

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
[PROOF STEP]
have "(B *\<^sub>v v) $ i = (\<Sum>ia = 0..<dim_row B. row B i $ ia * v $ ia)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (B *\<^sub>v v) $ i = (\<Sum>ia = 0..<dim_row B. row B i $ ia * v $ ia)
[PROOF STEP]
using d0 d2 f2
[PROOF STATE]
proof (prove)
using this:
n = dim_row B
dim_vec v = n
i < n \<and> j = 0

goal (1 subgoal):
 1. (B *\<^sub>v v) $ i = (\<Sum>ia = 0..<dim_row B. row B i $ ia * v $ ia)
[PROOF STEP]
by (auto simp add: scalar_prod_def)
[PROOF STATE]
proof (state)
this:
(B *\<^sub>v v) $ i = (\<Sum>ia = 0..<dim_row B. row B i $ ia * v $ ia)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row |0\<^sub>v n\<rangle>; j < dim_col |0\<^sub>v n\<rangle>\<rbrakk> \<Longrightarrow> (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
i < n \<and> j = 0
vec (dim_row B) (($) v) = v
(B *\<^sub>v v) $ i = (\<Sum>ia = 0..<dim_row B. row B i $ ia * v $ ia)
[PROOF STEP]
show "(B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
i < n \<and> j = 0
vec (dim_row B) (($) v) = v
(B *\<^sub>v v) $ i = (\<Sum>ia = 0..<dim_row B. row B i $ ia * v $ ia)

goal (1 subgoal):
 1. (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
[PROOF STEP]
using ket_vec_def d0 d1 times_mat_def mult_mat_vec_def
[PROOF STATE]
proof (prove)
using this:
i < n \<and> j = 0
vec (dim_row B) (($) v) = v
(B *\<^sub>v v) $ i = (\<Sum>ia = 0..<dim_row B. row B i $ ia * v $ ia)
|?v\<rangle> \<equiv> mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)
n = dim_row B
v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n
?A * ?B \<equiv> mat (dim_row ?A) (dim_col ?B) (\<lambda>(i, j). row ?A i \<bullet> col ?B j)
?A *\<^sub>v ?v \<equiv> vec (dim_row ?A) (\<lambda>i. row ?A i \<bullet> ?v)

goal (1 subgoal):
 1. (B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)
[PROOF STEP]
by (auto simp add: scalar_prod_def)
[PROOF STATE]
proof (state)
this:
(B * |v\<rangle>) $$ (i, j) = |0\<^sub>v n\<rangle> $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
B * |v\<rangle> = |0\<^sub>v n\<rangle>

goal (1 subgoal):
 1. det B = 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
B * |v\<rangle> = |0\<^sub>v n\<rangle>

goal (1 subgoal):
 1. det B = 0 \<Longrightarrow> False
[PROOF STEP]
have "|v\<rangle> \<in> carrier_mat n 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |v\<rangle> \<in> carrier_mat n 1
[PROOF STEP]
using d2 ket_vec_def
[PROOF STATE]
proof (prove)
using this:
dim_vec v = n
|?v\<rangle> \<equiv> mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)

goal (1 subgoal):
 1. |v\<rangle> \<in> carrier_mat n 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
|v\<rangle> \<in> carrier_mat n 1

goal (1 subgoal):
 1. det B = 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
B * |v\<rangle> = |0\<^sub>v n\<rangle>
|v\<rangle> \<in> carrier_mat n 1
[PROOF STEP]
have "(A * B) * |v\<rangle> = A * |0\<^sub>v n\<rangle>"
[PROOF STATE]
proof (prove)
using this:
B * |v\<rangle> = |0\<^sub>v n\<rangle>
|v\<rangle> \<in> carrier_mat n 1

goal (1 subgoal):
 1. A * B * |v\<rangle> = A * |0\<^sub>v n\<rangle>
[PROOF STEP]
using c0 c1
[PROOF STATE]
proof (prove)
using this:
B * |v\<rangle> = |0\<^sub>v n\<rangle>
|v\<rangle> \<in> carrier_mat n 1
A \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. A * B * |v\<rangle> = A * |0\<^sub>v n\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A * B * |v\<rangle> = A * |0\<^sub>v n\<rangle>

goal (1 subgoal):
 1. det B = 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A * B * |v\<rangle> = A * |0\<^sub>v n\<rangle>
[PROOF STEP]
have f3:"|v\<rangle> = A * |0\<^sub>v n\<rangle>"
[PROOF STATE]
proof (prove)
using this:
A * B * |v\<rangle> = A * |0\<^sub>v n\<rangle>

goal (1 subgoal):
 1. |v\<rangle> = A * |0\<^sub>v n\<rangle>
[PROOF STEP]
using d2 f0 ket_vec_def
[PROOF STATE]
proof (prove)
using this:
A * B * |v\<rangle> = A * |0\<^sub>v n\<rangle>
dim_vec v = n
A * B = 1\<^sub>m n
|?v\<rangle> \<equiv> mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)

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

goal (1 subgoal):
 1. det B = 0 \<Longrightarrow> False
[PROOF STEP]
have "v = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = 0\<^sub>v n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (0\<^sub>v n) \<Longrightarrow> v $ i = 0\<^sub>v n $ i
 2. dim_vec v = dim_vec (0\<^sub>v n)
[PROOF STEP]
show "dim_vec v = dim_vec (0\<^sub>v n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec v = dim_vec (0\<^sub>v n)
[PROOF STEP]
using d2
[PROOF STATE]
proof (prove)
using this:
dim_vec v = n

goal (1 subgoal):
 1. dim_vec v = dim_vec (0\<^sub>v n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_vec v = dim_vec (0\<^sub>v n)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (0\<^sub>v n) \<Longrightarrow> v $ i = 0\<^sub>v n $ i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < dim_vec (0\<^sub>v n) \<Longrightarrow> v $ i = 0\<^sub>v n $ i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < dim_vec (0\<^sub>v n) \<Longrightarrow> v $ i = 0\<^sub>v n $ i
[PROOF STEP]
assume f4:"i < dim_vec (0\<^sub>v n)"
[PROOF STATE]
proof (state)
this:
i < dim_vec (0\<^sub>v n)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (0\<^sub>v n) \<Longrightarrow> v $ i = 0\<^sub>v n $ i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_vec (0\<^sub>v n)
[PROOF STEP]
have "|v\<rangle> $$ (i,0) = v $ i"
[PROOF STATE]
proof (prove)
using this:
i < dim_vec (0\<^sub>v n)

goal (1 subgoal):
 1. |v\<rangle> $$ (i, 0) = v $ i
[PROOF STEP]
using d2 ket_vec_def
[PROOF STATE]
proof (prove)
using this:
i < dim_vec (0\<^sub>v n)
dim_vec v = n
|?v\<rangle> \<equiv> mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)

goal (1 subgoal):
 1. |v\<rangle> $$ (i, 0) = v $ i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
|v\<rangle> $$ (i, 0) = v $ i

goal (1 subgoal):
 1. \<And>i. i < dim_vec (0\<^sub>v n) \<Longrightarrow> v $ i = 0\<^sub>v n $ i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
|v\<rangle> $$ (i, 0) = v $ i

goal (1 subgoal):
 1. \<And>i. i < dim_vec (0\<^sub>v n) \<Longrightarrow> v $ i = 0\<^sub>v n $ i
[PROOF STEP]
have "(A * |0\<^sub>v n\<rangle>) $$ (i, 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A * |0\<^sub>v n\<rangle>) $$ (i, 0) = 0
[PROOF STEP]
using ket_vec_def times_mat_def scalar_prod_def f4 c0
[PROOF STATE]
proof (prove)
using this:
|?v\<rangle> \<equiv> mat (dim_vec ?v) 1 (\<lambda>(i, j). ?v $ i)
?A * ?B \<equiv> mat (dim_row ?A) (dim_col ?B) (\<lambda>(i, j). row ?A i \<bullet> col ?B j)
?v \<bullet> ?w \<equiv> \<Sum>i = 0..<dim_vec ?w. ?v $ i * ?w $ i
i < dim_vec (0\<^sub>v n)
A \<in> carrier_mat n n

goal (1 subgoal):
 1. (A * |0\<^sub>v n\<rangle>) $$ (i, 0) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(A * |0\<^sub>v n\<rangle>) $$ (i, 0) = 0

goal (1 subgoal):
 1. \<And>i. i < dim_vec (0\<^sub>v n) \<Longrightarrow> v $ i = 0\<^sub>v n $ i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
|v\<rangle> $$ (i, 0) = v $ i
(A * |0\<^sub>v n\<rangle>) $$ (i, 0) = 0
[PROOF STEP]
show "v $ i = 0\<^sub>v n $ i"
[PROOF STATE]
proof (prove)
using this:
|v\<rangle> $$ (i, 0) = v $ i
(A * |0\<^sub>v n\<rangle>) $$ (i, 0) = 0

goal (1 subgoal):
 1. v $ i = 0\<^sub>v n $ i
[PROOF STEP]
using f3 f4
[PROOF STATE]
proof (prove)
using this:
|v\<rangle> $$ (i, 0) = v $ i
(A * |0\<^sub>v n\<rangle>) $$ (i, 0) = 0
|v\<rangle> = A * |0\<^sub>v n\<rangle>
i < dim_vec (0\<^sub>v n)

goal (1 subgoal):
 1. v $ i = 0\<^sub>v n $ i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v $ i = 0\<^sub>v n $ i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v = 0\<^sub>v n

goal (1 subgoal):
 1. det B = 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v = 0\<^sub>v n
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
v = 0\<^sub>v n

goal (1 subgoal):
 1. False
[PROOF STEP]
using d1
[PROOF STATE]
proof (prove)
using this:
v = 0\<^sub>v n
v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> B *\<^sub>v v = 0\<^sub>v n

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
det B \<noteq> 0

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
have f5:"adj_mat B \<in> carrier_mat n n \<and> B * adj_mat B = det B \<cdot>\<^sub>m 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adj_mat B \<in> carrier_mat n n \<and> B * adj_mat B = det B \<cdot>\<^sub>m 1\<^sub>m n
[PROOF STEP]
using c1 adj_mat
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
?A \<in> carrier_mat ?n ?n \<Longrightarrow> adj_mat ?A \<in> carrier_mat ?n ?n
?A \<in> carrier_mat ?n ?n \<Longrightarrow> ?A * adj_mat ?A = det ?A \<cdot>\<^sub>m 1\<^sub>m ?n
?A \<in> carrier_mat ?n ?n \<Longrightarrow> adj_mat ?A * ?A = det ?A \<cdot>\<^sub>m 1\<^sub>m ?n

goal (1 subgoal):
 1. adj_mat B \<in> carrier_mat n n \<and> B * adj_mat B = det B \<cdot>\<^sub>m 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adj_mat B \<in> carrier_mat n n \<and> B * adj_mat B = det B \<cdot>\<^sub>m 1\<^sub>m n

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
adj_mat B \<in> carrier_mat n n \<and> B * adj_mat B = det B \<cdot>\<^sub>m 1\<^sub>m n
[PROOF STEP]
have c2:"((1/det B) \<cdot>\<^sub>m adj_mat B) \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
adj_mat B \<in> carrier_mat n n \<and> B * adj_mat B = det B \<cdot>\<^sub>m 1\<^sub>m n

goal (1 subgoal):
 1. 1 / det B \<cdot>\<^sub>m adj_mat B \<in> carrier_mat n n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / det B \<cdot>\<^sub>m adj_mat B \<in> carrier_mat n n

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
have f6:"B * ((1/det B) \<cdot>\<^sub>m adj_mat B) = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * (1 / det B \<cdot>\<^sub>m adj_mat B) = 1\<^sub>m n
[PROOF STEP]
using c1 f1 f5 mult_smult_distrib[of "B"]
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
det B \<noteq> 0
adj_mat B \<in> carrier_mat n n \<and> B * adj_mat B = det B \<cdot>\<^sub>m 1\<^sub>m n
\<lbrakk>B \<in> carrier_mat ?nr ?n; ?B \<in> carrier_mat ?n ?nc\<rbrakk> \<Longrightarrow> B * (?k \<cdot>\<^sub>m ?B) = ?k \<cdot>\<^sub>m (B * ?B)

goal (1 subgoal):
 1. B * (1 / det B \<cdot>\<^sub>m adj_mat B) = 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B * (1 / det B \<cdot>\<^sub>m adj_mat B) = 1\<^sub>m n

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B * (1 / det B \<cdot>\<^sub>m adj_mat B) = 1\<^sub>m n
[PROOF STEP]
have "A = (A * B) * ((1/det B) \<cdot>\<^sub>m adj_mat B)"
[PROOF STATE]
proof (prove)
using this:
B * (1 / det B \<cdot>\<^sub>m adj_mat B) = 1\<^sub>m n

goal (1 subgoal):
 1. A = A * B * (1 / det B \<cdot>\<^sub>m adj_mat B)
[PROOF STEP]
using c0 c1 c2
[PROOF STATE]
proof (prove)
using this:
B * (1 / det B \<cdot>\<^sub>m adj_mat B) = 1\<^sub>m n
A \<in> carrier_mat n n
B \<in> carrier_mat n n
1 / det B \<cdot>\<^sub>m adj_mat B \<in> carrier_mat n n

goal (1 subgoal):
 1. A = A * B * (1 / det B \<cdot>\<^sub>m adj_mat B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A = A * B * (1 / det B \<cdot>\<^sub>m adj_mat B)

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A = A * B * (1 / det B \<cdot>\<^sub>m adj_mat B)
[PROOF STEP]
have "A = (1/det B) \<cdot>\<^sub>m adj_mat B"
[PROOF STATE]
proof (prove)
using this:
A = A * B * (1 / det B \<cdot>\<^sub>m adj_mat B)

goal (1 subgoal):
 1. A = 1 / det B \<cdot>\<^sub>m adj_mat B
[PROOF STEP]
using f0 c2
[PROOF STATE]
proof (prove)
using this:
A = A * B * (1 / det B \<cdot>\<^sub>m adj_mat B)
A * B = 1\<^sub>m n
1 / det B \<cdot>\<^sub>m adj_mat B \<in> carrier_mat n n

goal (1 subgoal):
 1. A = 1 / det B \<cdot>\<^sub>m adj_mat B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = 1 / det B \<cdot>\<^sub>m adj_mat B

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A = 1 / det B \<cdot>\<^sub>m adj_mat B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A = 1 / det B \<cdot>\<^sub>m adj_mat B

goal (1 subgoal):
 1. inverts_mat B A
[PROOF STEP]
using c0 c1 f6 inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
A = 1 / det B \<cdot>\<^sub>m adj_mat B
A \<in> carrier_mat n n
B \<in> carrier_mat n n
B * (1 / det B \<cdot>\<^sub>m adj_mat B) = 1\<^sub>m n
inverts_mat ?A ?B \<equiv> ?A * ?B = 1\<^sub>m (dim_row ?A)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_imp_no_prime_divisors:
  assumes "is_unit x" "prime_elem p"
  shows   "\<not>p dvd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> p dvd x
[PROOF STEP]
using unit_imp_no_irreducible_divisors[OF assms(1) prime_elem_imp_irreducible[OF assms(2)]]
[PROOF STATE]
proof (prove)
using this:
\<not> p dvd x

goal (1 subgoal):
 1. \<not> p dvd x
[PROOF STEP]
.


[STATEMENT]
lemma clI:
  assumes "x \<in> carrier"
  assumes "rank_of (insert x X) = rank_of X"
  shows "x \<in> cl X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> cl X
[PROOF STEP]
unfolding cl_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {x \<in> carrier. rank_of (insert x X) = rank_of X}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier
rank_of (insert x X) = rank_of X

goal (1 subgoal):
 1. x \<in> {x \<in> carrier. rank_of (insert x X) = rank_of X}
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_clauses:
  shows "sum f {} = 0"
    and "finite S \<Longrightarrow> sum f (insert x S) = (if x \<in> S then sum f S else f x + sum f S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {} = (0::'a) &&& (finite S \<Longrightarrow> sum f (insert x S) = (if x \<in> S then sum f S else f x + sum f S))
[PROOF STEP]
by (auto simp add: insert_absorb)


[STATEMENT]
theorem WPO_NS_subst: "(s,t) \<in> WPO_NS \<Longrightarrow> (s \<cdot> \<sigma>, t \<cdot> \<sigma>) \<in> WPO_NS" for \<sigma>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s, t) \<in> WPO_NS \<Longrightarrow> (s \<cdot> \<sigma>, t \<cdot> \<sigma>) \<in> WPO_NS
[PROOF STEP]
using wpo_stable
[PROOF STATE]
proof (prove)
using this:
(?s \<succ> ?t \<longrightarrow> ?s \<cdot> ?\<delta> \<succ> ?t \<cdot> ?\<delta>) \<and> (?s \<succeq> ?t \<longrightarrow> ?s \<cdot> ?\<delta> \<succeq> ?t \<cdot> ?\<delta>)

goal (1 subgoal):
 1. (s, t) \<in> WPO_NS \<Longrightarrow> (s \<cdot> \<sigma>, t \<cdot> \<sigma>) \<in> WPO_NS
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_of_vec_vec: "poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))
[PROOF STEP]
proof (induct n arbitrary:f)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. poly_of_vec (vec 0 f) = Poly (rev (map f [0..<0]))
 2. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>f. poly_of_vec (vec 0 f) = Poly (rev (map f [0..<0]))
 2. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_vec (vec 0 f) = Poly (rev (map f [0..<0]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly_of_vec (vec 0 f) = Poly (rev (map f [0..<0]))

goal (1 subgoal):
 1. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
poly_of_vec (vec n ?f) = Poly (rev (map ?f [0..<n]))

goal (1 subgoal):
 1. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
have "map f [0..<Suc n] = f 0 # map (f \<circ> Suc) [0..<n]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f [0..<Suc n] = f 0 # map (f \<circ> Suc) [0..<n]
[PROOF STEP]
by (simp add: map_upt_Suc del: upt_Suc)
[PROOF STATE]
proof (state)
this:
map f [0..<Suc n] = f 0 # map (f \<circ> Suc) [0..<n]

goal (1 subgoal):
 1. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map f [0..<Suc n] = f 0 # map (f \<circ> Suc) [0..<n]

goal (1 subgoal):
 1. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
have "Poly (rev \<dots>) = Poly (rev (map (f \<circ> Suc) [0..<n])) + monom (f 0) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly (rev (f 0 # map (f \<circ> Suc) [0..<n])) = Poly (rev (map (f \<circ> Suc) [0..<n])) + monom (f 0) n
[PROOF STEP]
by (simp add: Poly_snoc smult_monom)
[PROOF STATE]
proof (state)
this:
Poly (rev (f 0 # map (f \<circ> Suc) [0..<n])) = Poly (rev (map (f \<circ> Suc) [0..<n])) + monom (f 0) n

goal (1 subgoal):
 1. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Poly (rev (f 0 # map (f \<circ> Suc) [0..<n])) = Poly (rev (map (f \<circ> Suc) [0..<n])) + monom (f 0) n

goal (1 subgoal):
 1. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
have "\<dots> = poly_of_vec (vec n (f \<circ> Suc)) + monom (f 0) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly (rev (map (f \<circ> Suc) [0..<n])) + monom (f 0) n = poly_of_vec (vec n (f \<circ> Suc)) + monom (f 0) n
[PROOF STEP]
by (fold Suc, simp)
[PROOF STATE]
proof (state)
this:
Poly (rev (map (f \<circ> Suc) [0..<n])) + monom (f 0) n = poly_of_vec (vec n (f \<circ> Suc)) + monom (f 0) n

goal (1 subgoal):
 1. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Poly (rev (map (f \<circ> Suc) [0..<n])) + monom (f 0) n = poly_of_vec (vec n (f \<circ> Suc)) + monom (f 0) n

goal (1 subgoal):
 1. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
have "\<dots> = poly_of_vec (vec (Suc n) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_vec (vec n (f \<circ> Suc)) + monom (f 0) n = poly_of_vec (vec (Suc n) f)
[PROOF STEP]
apply (unfold poly_of_vec_def Let_def dim_vec sum.lessThan_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. monom (vec n (f \<circ> Suc) $ (n - Suc i)) i) + monom (f 0) n = (\<Sum>i<n. monom (vec (Suc n) f $ (Suc n - Suc i)) i) + monom (vec (Suc n) f $ (Suc n - Suc n)) n
[PROOF STEP]
by (auto simp add: Suc_diff_Suc)
[PROOF STATE]
proof (state)
this:
poly_of_vec (vec n (f \<circ> Suc)) + monom (f 0) n = poly_of_vec (vec (Suc n) f)

goal (1 subgoal):
 1. \<And>n f. (\<And>f. poly_of_vec (vec n f) = Poly (rev (map f [0..<n]))) \<Longrightarrow> poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Poly (rev (map f [0..<Suc n])) = poly_of_vec (vec (Suc n) f)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Poly (rev (map f [0..<Suc n])) = poly_of_vec (vec (Suc n) f)

goal (1 subgoal):
 1. poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
poly_of_vec (vec (Suc n) f) = Poly (rev (map f [0..<Suc n]))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_transfer_operator_intg:
  assumes "integrable M (\<lambda>x. f (T x) * g x)" and
          [measurable]: "f \<in> borel_measurable M" "g \<in> borel_measurable M"
  shows "integrable M (\<lambda>x. f x * real_transfer_operator g x)"
        "(\<integral> x. f x * real_transfer_operator g x \<partial>M) = (\<integral> x. f (T x) * g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x) &&& LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
define fp where "fp = (\<lambda>x. max (f x) 0)"
[PROOF STATE]
proof (state)
this:
fp = (\<lambda>x. max (f x) 0)

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
define fm where "fm = (\<lambda>x. max (-f x) 0)"
[PROOF STATE]
proof (state)
this:
fm = (\<lambda>x. max (- f x) 0)

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have [measurable]: "fp \<in> borel_measurable M" "fm \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fp \<in> borel_measurable M &&& fm \<in> borel_measurable M
[PROOF STEP]
unfolding fp_def fm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. max (f x) 0) \<in> borel_measurable M &&& (\<lambda>x. max (- f x) 0) \<in> borel_measurable M
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
fp \<in> borel_measurable M
fm \<in> borel_measurable M

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "(\<integral>\<^sup>+ x. norm(fp (T x) * g x) \<partial>M) \<le> (\<integral>\<^sup>+ x. norm(f (T x) * g x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (fp (T x) * g x)) \<partial>M \<le> \<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M
[PROOF STEP]
by (simp add: fp_def nn_integral_mono)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (fp (T x) * g x)) \<partial>M \<le> \<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (fp (T x) * g x)) \<partial>M \<le> \<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "... < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M < \<infinity>
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. f (T x) * g x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M < \<infinity>
[PROOF STEP]
by (simp add: integrable_iff_bounded)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M < \<infinity>

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (norm (fp (T x) * g x)) \<partial>M < \<infinity>
[PROOF STEP]
have "(\<integral>\<^sup>+ x. norm(fp (T x) * g x) \<partial>M) < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (norm (fp (T x) * g x)) \<partial>M < \<infinity>

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (fp (T x) * g x)) \<partial>M < \<infinity>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (fp (T x) * g x)) \<partial>M < \<infinity>

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (norm (fp (T x) * g x)) \<partial>M < \<infinity>
[PROOF STEP]
have intp: "integrable M (\<lambda>x. fp (T x) * g x)"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (norm (fp (T x) * g x)) \<partial>M < \<infinity>

goal (1 subgoal):
 1. integrable M (\<lambda>x. fp (T x) * g x)
[PROOF STEP]
by (simp add: integrableI_bounded)
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. fp (T x) * g x)

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. fp (T x) * g x)

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "\<And>x. fp x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 \<le> fp x
[PROOF STEP]
unfolding fp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 \<le> max (f x) 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> fp ?x3

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
integrable M (\<lambda>x. fp (T x) * g x)
0 \<le> fp ?x3
[PROOF STEP]
have Rp: "integrable M (\<lambda>x. fp x * real_transfer_operator g x)"
    "(\<integral> x. fp x * real_transfer_operator g x \<partial>M) = (\<integral> x. fp (T x) * g x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. fp (T x) * g x)
0 \<le> fp ?x3

goal (1 subgoal):
 1. integrable M (\<lambda>x. fp x * real_transfer_operator g x) &&& LINT x|M. fp x * real_transfer_operator g x = LINT x|M. fp (T x) * g x
[PROOF STEP]
using real_transfer_operator_intg_fpos
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. fp (T x) * g x)
0 \<le> fp ?x3
\<lbrakk>integrable M (\<lambda>x. ?f (T x) * ?g x); \<And>x. 0 \<le> ?f x; ?f \<in> borel_measurable M; ?g \<in> borel_measurable M\<rbrakk> \<Longrightarrow> integrable M (\<lambda>x. ?f x * real_transfer_operator ?g x)
\<lbrakk>integrable M (\<lambda>x. ?f (T x) * ?g x); \<And>x. 0 \<le> ?f x; ?f \<in> borel_measurable M; ?g \<in> borel_measurable M\<rbrakk> \<Longrightarrow> LINT x|M. ?f x * real_transfer_operator ?g x = LINT x|M. ?f (T x) * ?g x

goal (1 subgoal):
 1. integrable M (\<lambda>x. fp x * real_transfer_operator g x) &&& LINT x|M. fp x * real_transfer_operator g x = LINT x|M. fp (T x) * g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. fp x * real_transfer_operator g x)
LINT x|M. fp x * real_transfer_operator g x = LINT x|M. fp (T x) * g x

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "(\<integral>\<^sup>+ x. norm(fm (T x) * g x) \<partial>M) \<le> (\<integral>\<^sup>+ x. norm(f (T x) * g x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (fm (T x) * g x)) \<partial>M \<le> \<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M
[PROOF STEP]
by (simp add: fm_def nn_integral_mono)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (fm (T x) * g x)) \<partial>M \<le> \<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (fm (T x) * g x)) \<partial>M \<le> \<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "... < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M < \<infinity>
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. f (T x) * g x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M < \<infinity>
[PROOF STEP]
by (simp add: integrable_iff_bounded)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (f (T x) * g x)) \<partial>M < \<infinity>

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (norm (fm (T x) * g x)) \<partial>M < \<infinity>
[PROOF STEP]
have "(\<integral>\<^sup>+ x. norm(fm (T x) * g x) \<partial>M) < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (norm (fm (T x) * g x)) \<partial>M < \<infinity>

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (fm (T x) * g x)) \<partial>M < \<infinity>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (fm (T x) * g x)) \<partial>M < \<infinity>

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (norm (fm (T x) * g x)) \<partial>M < \<infinity>
[PROOF STEP]
have intm: "integrable M (\<lambda>x. fm (T x) * g x)"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (norm (fm (T x) * g x)) \<partial>M < \<infinity>

goal (1 subgoal):
 1. integrable M (\<lambda>x. fm (T x) * g x)
[PROOF STEP]
by (simp add: integrableI_bounded)
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. fm (T x) * g x)

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. fm (T x) * g x)

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "\<And>x. fm x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 \<le> fm x
[PROOF STEP]
unfolding fm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 \<le> max (- f x) 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> fm ?x3

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
integrable M (\<lambda>x. fm (T x) * g x)
0 \<le> fm ?x3
[PROOF STEP]
have Rm: "integrable M (\<lambda>x. fm x * real_transfer_operator g x)"
    "(\<integral> x. fm x * real_transfer_operator g x \<partial>M) = (\<integral> x. fm (T x) * g x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. fm (T x) * g x)
0 \<le> fm ?x3

goal (1 subgoal):
 1. integrable M (\<lambda>x. fm x * real_transfer_operator g x) &&& LINT x|M. fm x * real_transfer_operator g x = LINT x|M. fm (T x) * g x
[PROOF STEP]
using real_transfer_operator_intg_fpos
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. fm (T x) * g x)
0 \<le> fm ?x3
\<lbrakk>integrable M (\<lambda>x. ?f (T x) * ?g x); \<And>x. 0 \<le> ?f x; ?f \<in> borel_measurable M; ?g \<in> borel_measurable M\<rbrakk> \<Longrightarrow> integrable M (\<lambda>x. ?f x * real_transfer_operator ?g x)
\<lbrakk>integrable M (\<lambda>x. ?f (T x) * ?g x); \<And>x. 0 \<le> ?f x; ?f \<in> borel_measurable M; ?g \<in> borel_measurable M\<rbrakk> \<Longrightarrow> LINT x|M. ?f x * real_transfer_operator ?g x = LINT x|M. ?f (T x) * ?g x

goal (1 subgoal):
 1. integrable M (\<lambda>x. fm x * real_transfer_operator g x) &&& LINT x|M. fm x * real_transfer_operator g x = LINT x|M. fm (T x) * g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. fm x * real_transfer_operator g x)
LINT x|M. fm x * real_transfer_operator g x = LINT x|M. fm (T x) * g x

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "integrable M (\<lambda>x. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x)
[PROOF STEP]
using Rp(1) Rm(1) integrable_diff
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. fp x * real_transfer_operator g x)
integrable M (\<lambda>x. fm x * real_transfer_operator g x)
\<lbrakk>?f integrable_on ?S; ?g integrable_on ?S\<rbrakk> \<Longrightarrow> (\<lambda>x. ?f x - ?g x) integrable_on ?S

goal (1 subgoal):
 1. integrable M (\<lambda>x. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x)

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x)

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have *: "\<And>x. f x * real_transfer_operator g x = fp x * real_transfer_operator g x - fm x * real_transfer_operator g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. f x * real_transfer_operator g x = fp x * real_transfer_operator g x - fm x * real_transfer_operator g x
[PROOF STEP]
unfolding fp_def fm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. f x * real_transfer_operator g x = max (f x) 0 * real_transfer_operator g x - max (- f x) 0 * real_transfer_operator g x
[PROOF STEP]
by (simp add: max_def)
[PROOF STATE]
proof (state)
this:
f ?x3 * real_transfer_operator g ?x3 = fp ?x3 * real_transfer_operator g ?x3 - fm ?x3 * real_transfer_operator g ?x3

goal (2 subgoals):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
 2. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
integrable M (\<lambda>x. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x)
f ?x3 * real_transfer_operator g ?x3 = fp ?x3 * real_transfer_operator g ?x3 - fm ?x3 * real_transfer_operator g ?x3
[PROOF STEP]
show "integrable M (\<lambda>x. f x * real_transfer_operator g x)"
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x)
f ?x3 * real_transfer_operator g ?x3 = fp ?x3 * real_transfer_operator g ?x3 - fm ?x3 * real_transfer_operator g ?x3

goal (1 subgoal):
 1. integrable M (\<lambda>x. f x * real_transfer_operator g x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. f x * real_transfer_operator g x)

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "(\<integral> x. f x * real_transfer_operator g x \<partial>M) = (\<integral> x. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
f ?x3 * real_transfer_operator g ?x3 = fp ?x3 * real_transfer_operator g ?x3 - fm ?x3 * real_transfer_operator g ?x3

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LINT x|M. f x * real_transfer_operator g x = LINT x|M. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|M. f x * real_transfer_operator g x = LINT x|M. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "... = (\<integral> x. fp x * real_transfer_operator g x \<partial>M) - (\<integral> x. fm x * real_transfer_operator g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x = (LINT x|M. fp x * real_transfer_operator g x) - (LINT x|M. fm x * real_transfer_operator g x)
[PROOF STEP]
using Rp(1) Rm(1)
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. fp x * real_transfer_operator g x)
integrable M (\<lambda>x. fm x * real_transfer_operator g x)

goal (1 subgoal):
 1. LINT x|M. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x = (LINT x|M. fp x * real_transfer_operator g x) - (LINT x|M. fm x * real_transfer_operator g x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LINT x|M. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x = (LINT x|M. fp x * real_transfer_operator g x) - (LINT x|M. fm x * real_transfer_operator g x)

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|M. fp x * real_transfer_operator g x - fm x * real_transfer_operator g x = (LINT x|M. fp x * real_transfer_operator g x) - (LINT x|M. fm x * real_transfer_operator g x)

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "... = (\<integral> x. fp (T x) * g x \<partial>M) - (\<integral> x. fm (T x) * g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|M. fp x * real_transfer_operator g x) - (LINT x|M. fm x * real_transfer_operator g x) = (LINT x|M. fp (T x) * g x) - (LINT x|M. fm (T x) * g x)
[PROOF STEP]
using Rp(2) Rm(2)
[PROOF STATE]
proof (prove)
using this:
LINT x|M. fp x * real_transfer_operator g x = LINT x|M. fp (T x) * g x
LINT x|M. fm x * real_transfer_operator g x = LINT x|M. fm (T x) * g x

goal (1 subgoal):
 1. (LINT x|M. fp x * real_transfer_operator g x) - (LINT x|M. fm x * real_transfer_operator g x) = (LINT x|M. fp (T x) * g x) - (LINT x|M. fm (T x) * g x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(LINT x|M. fp x * real_transfer_operator g x) - (LINT x|M. fm x * real_transfer_operator g x) = (LINT x|M. fp (T x) * g x) - (LINT x|M. fm (T x) * g x)

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(LINT x|M. fp x * real_transfer_operator g x) - (LINT x|M. fm x * real_transfer_operator g x) = (LINT x|M. fp (T x) * g x) - (LINT x|M. fm (T x) * g x)

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "... = (\<integral> x. fp (T x) * g x - fm (T x) * g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|M. fp (T x) * g x) - (LINT x|M. fm (T x) * g x) = LINT x|M. fp (T x) * g x - fm (T x) * g x
[PROOF STEP]
using intm intp
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. fm (T x) * g x)
integrable M (\<lambda>x. fp (T x) * g x)

goal (1 subgoal):
 1. (LINT x|M. fp (T x) * g x) - (LINT x|M. fm (T x) * g x) = LINT x|M. fp (T x) * g x - fm (T x) * g x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(LINT x|M. fp (T x) * g x) - (LINT x|M. fm (T x) * g x) = LINT x|M. fp (T x) * g x - fm (T x) * g x

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(LINT x|M. fp (T x) * g x) - (LINT x|M. fm (T x) * g x) = LINT x|M. fp (T x) * g x - fm (T x) * g x

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
have "... = (\<integral> x. f (T x) * g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. fp (T x) * g x - fm (T x) * g x = LINT x|M. f (T x) * g x
[PROOF STEP]
unfolding fp_def fm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. max (f (T x)) 0 * g x - max (- f (T x)) 0 * g x = LINT x|M. f (T x) * g x
[PROOF STEP]
by (metis (no_types, opaque_lifting) diff_0 diff_zero max.commute
    max_def minus_minus mult.commute neg_le_iff_le right_diff_distrib)
[PROOF STATE]
proof (state)
this:
LINT x|M. fp (T x) * g x - fm (T x) * g x = LINT x|M. f (T x) * g x

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
show "(\<integral> x. f x * real_transfer_operator g x \<partial>M) = (\<integral> x. f (T x) * g x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x

goal (1 subgoal):
 1. LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LINT x|M. f x * real_transfer_operator g x = LINT x|M. f (T x) * g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_prime_factors:
  "prime p \<Longrightarrow> prime_factors p = {p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime p \<Longrightarrow> prime_factors p = {p}
[PROOF STEP]
by (drule prime_factorization_prime) simp


[STATEMENT]
lemma lcoset_inj_on: "inj ((+o) (a::'a::group_add))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj ((+o) a)
[PROOF STEP]
using lcoset_eq_reps inj_onI[of UNIV "(+o) a"]
[PROOF STATE]
proof (prove)
using this:
?a +o ?A = ?a +o ?B \<Longrightarrow> ?A = ?B
(\<And>x y. \<lbrakk>x \<in> UNIV; y \<in> UNIV; a +o x = a +o y\<rbrakk> \<Longrightarrow> x = y) \<Longrightarrow> inj ((+o) a)

goal (1 subgoal):
 1. inj ((+o) a)
[PROOF STEP]
by auto


[STATEMENT]
lemma subst_lift2[simp]: "(lift (lift t 0) 0)[x/Suc 0] = lift t 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lift (lift t 0) 0[x/Suc 0] = lift t 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lift (lift t 0) 0[x/Suc 0] = lift t 0
[PROOF STEP]
have "lift (lift t 0) 0 = lift (lift t 0) (Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lift (lift t 0) 0 = lift (lift t 0) (Suc 0)
[PROOF STEP]
using lift_lift
[PROOF STATE]
proof (prove)
using this:
?i < ?k + 1 \<Longrightarrow> lift (lift ?t ?i) (Suc ?k) = lift (lift ?t ?k) ?i

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

goal (1 subgoal):
 1. lift (lift t 0) 0[x/Suc 0] = lift t 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
lift (lift t 0) 0 = lift (lift t 0) (Suc 0)

goal (1 subgoal):
 1. lift (lift t 0) 0[x/Suc 0] = lift t 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lift (lift t 0) 0[x/Suc 0] = lift t 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irreducible_m_dvdm_prod_list_connect:
  assumes irr: "irreducible_m a"
  and dvd: "a dvdm (prod_list xs)"
shows "\<exists> b \<in> set xs. a dvdm b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
let ?A="(of_int_poly a)::'a mod_ring poly"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
let ?XS="(map of_int_poly xs)::'a mod_ring poly list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
let ?XS1 = "(of_int_poly (prod_list xs))::'a mod_ring poly"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
have [transfer_rule]: "MP_Rel a ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MP_Rel a (of_int_poly a)
[PROOF STEP]
by (simp add: MP_Rel_def Mp_f_representative)
[PROOF STATE]
proof (state)
this:
MP_Rel a (of_int_poly a)

goal (1 subgoal):
 1. \<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
have [transfer_rule]: "MP_Rel (prod_list xs) ?XS1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MP_Rel (prod_list xs) (of_int_poly (prod_list xs))
[PROOF STEP]
by (simp add: MP_Rel_def Mp_f_representative)
[PROOF STATE]
proof (state)
this:
MP_Rel (prod_list xs) (of_int_poly (prod_list xs))

goal (1 subgoal):
 1. \<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
have [transfer_rule]: "list_all2 MP_Rel xs ?XS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 MP_Rel xs (map of_int_poly xs)
[PROOF STEP]
by (simp add: MP_Rel_def Mp_f_representative list_all2_conv_all_nth)
[PROOF STATE]
proof (state)
this:
list_all2 MP_Rel xs (map of_int_poly xs)

goal (1 subgoal):
 1. \<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
have A: "?A dvd ?XS1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_poly a dvd of_int_poly (prod_list xs)
[PROOF STEP]
using dvd
[PROOF STATE]
proof (prove)
using this:
a dvdm prod_list xs

goal (1 subgoal):
 1. of_int_poly a dvd of_int_poly (prod_list xs)
[PROOF STEP]
by transfer
[PROOF STATE]
proof (state)
this:
of_int_poly a dvd of_int_poly (prod_list xs)

goal (1 subgoal):
 1. \<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
have "\<exists> b \<in> set ?XS. ?A dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b\<in>set (map of_int_poly xs). of_int_poly a dvd b
[PROOF STEP]
by (rule irreducible_dvd_prod_list, insert irr, transfer, auto simp add: A)
[PROOF STATE]
proof (state)
this:
\<exists>b\<in>set (map of_int_poly xs). of_int_poly a dvd b

goal (1 subgoal):
 1. \<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
from this[untransferred]
[PROOF STATE]
proof (chain)
picking this:
\<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>b\<in>set xs. a dvdm b

goal (1 subgoal):
 1. \<exists>b\<in>set xs. a dvdm b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<exists>b\<in>set xs. a dvdm b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma not_in_member[rule_format]: "member a b \<longrightarrow> x \<notin> dom (Cp b) \<longrightarrow> x \<notin> dom (Cp a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. member a b \<longrightarrow> x \<notin> dom (Cp b) \<longrightarrow> x \<notin> dom (Cp a)
[PROOF STEP]
by (induct b)(simp_all add: dom_def Cp.simps)


[STATEMENT]
lemma closed_hfm_Conj[simp]:
  "closed_hfm (HConj A B) \<longleftrightarrow> closed_hfm A \<and> closed_hfm B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_hfm (A HAND B) = (closed_hfm A \<and> closed_hfm B)
[PROOF STEP]
unfolding HConj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_hfm (HNeg (A HIMP HNeg B)) = (closed_hfm A \<and> closed_hfm B)
[PROOF STEP]
by simp


[STATEMENT]
lemma cspan_singleton_scaleC[simp]: "(a::complex)\<noteq>0 \<Longrightarrow> cspan { a *\<^sub>C \<psi> } = cspan {\<psi>}"
  for \<psi>::"'a::complex_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> cspan {a *\<^sub>C \<psi>} = cspan {\<psi>}
[PROOF STEP]
by (smt complex_vector.dependent_single complex_vector.independent_insert
      complex_vector.scale_eq_0_iff complex_vector.span_base complex_vector.span_redundant
      complex_vector.span_scale doubleton_eq_iff insert_absorb insert_absorb2 insert_commute
      singletonI)


[STATEMENT]
lemma restrictI: "\<forall>x\<in>S. s1 x = s2 x \<Longrightarrow> restrict S s1 = restrict S s2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s1 = s2 on S \<Longrightarrow> restrict S s1 = restrict S s2
[PROOF STEP]
unfolding restrict_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s1 = s2 on S \<Longrightarrow> (\<lambda>x. if x \<in> S then Some (s1 x) else None) = (\<lambda>x. if x \<in> S then Some (s2 x) else None)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma snth_as_fct:
  fixes b
  assumes "M = bernoulli_stream p"
  shows "to_stream -` {w\<in> space M. snth w i = b} = {X::nat\<Rightarrow>bool. X i = b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_stream -` {w \<in> space M. w !! i = b} = {X. X i = b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. to_stream -` {w \<in> space M. w !! i = b} = {X. X i = b}
[PROOF STEP]
let ?S = "{w\<in> space M. snth w i = b}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. to_stream -` {w \<in> space M. w !! i = b} = {X. X i = b}
[PROOF STEP]
let ?PM = "(\<lambda>i::nat. (measure_pmf (bernoulli_pmf p)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. to_stream -` {w \<in> space M. w !! i = b} = {X. X i = b}
[PROOF STEP]
have isps: "product_prob_space ?PM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_prob_space (\<lambda>i. measure_pmf (bernoulli_pmf p))
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
this:
product_prob_space (\<lambda>i. measure_pmf (bernoulli_pmf p))

goal (1 subgoal):
 1. to_stream -` {w \<in> space M. w !! i = b} = {X. X i = b}
[PROOF STEP]
let ?Z = "{X::nat\<Rightarrow>bool. X i = b}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. to_stream -` {w \<in> space M. w !! i = b} = {X. X i = b}
[PROOF STEP]
show "to_stream -`?S = ?Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_stream -` {w \<in> space M. w !! i = b} = {X. X i = b}
[PROOF STEP]
by (simp add: assms bernoulli_stream_space to_stream_def)
[PROOF STATE]
proof (state)
this:
to_stream -` {w \<in> space M. w !! i = b} = {X. X i = b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_psubstAbs_vsubstAbs_compose:
assumes "wlsAbs (us,s) A" and "wlsEnv rho"
shows "((A $[y1 // y]_ys) $[rho]) = (A $[(rho [y \<leftarrow> ((Var ys y1) #[rho])]_ys)])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $[y1 // y]_ys $[rho] = A $[rho [y \<leftarrow> Var ys y1 #[rho]]_ys]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
wlsEnv rho

goal (1 subgoal):
 1. A $[y1 // y]_ys $[rho] = A $[rho [y \<leftarrow> Var ys y1 #[rho]]_ys]
[PROOF STEP]
by(simp add: psubstAbs_vsubstAbs_compose)


[STATEMENT]
lemma lubI:
  assumes A: "S \<subseteq> A" "L \<in> A" and r: "\<forall>x \<in> S. (x, L) \<in> r"
     and clo: "\<And>z. \<lbrakk>z \<in> A; (\<forall>y \<in> S. (y, z) \<in> r)\<rbrakk> \<Longrightarrow> (L, z) \<in> r"
   shows "L = lub S cl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L = lub S cl
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. L = lub S cl
[PROOF STEP]
obtain L where "isLub S cl L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>L. isLub S cl L \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using CL_imp_ex_isLub assms(1)
[PROOF STATE]
proof (prove)
using this:
?S \<subseteq> A \<Longrightarrow> \<exists>L. isLub ?S cl L
S \<subseteq> A

goal (1 subgoal):
 1. (\<And>L. isLub S cl L \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isLub S cl L

goal (1 subgoal):
 1. L = lub S cl
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isLub S cl L
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isLub S cl L

goal (1 subgoal):
 1. L = lub S cl
[PROOF STEP]
by (simp add: antisymE A clo lub_in_lattice lub_least lub_upper r)
[PROOF STATE]
proof (state)
this:
L = lub S cl

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<bar> ln 2 - 544531980202654583340825686620847 / 785593587443817081832229725798400 \<bar> < (inverse (2^51) :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>ln 2 - 544531980202654583340825686620847 / 785593587443817081832229725798400\<bar> < inverse (2 ^ 51)
[PROOF STEP]
by (approximation 60)