[STATEMENT]
lemma comm_monoid: "comm_monoid R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.comm_monoid R
[PROOF STEP]
unfolding R_m_def residue_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.comm_monoid \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>
[PROOF STEP]
apply (rule comm_monoidI)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>
 2. \<one>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>
 3. \<And>x y z. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; z \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> z = x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> (y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> z)
 4. \<And>x. x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr> \<Longrightarrow> \<one>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> x = x
 5. \<And>x y. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y = y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> x
[PROOF STEP]
using m_gt_one
[PROOF STATE]
proof (prove)
using this:
1 < m

goal (5 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>
 2. \<one>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>
 3. \<And>x y z. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; z \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> z = x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> (y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> z)
 4. \<And>x. x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr> \<Longrightarrow> \<one>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> x = x
 5. \<And>x y. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y = y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> x
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y z. \<lbrakk>1 < m; 0 \<le> x; x < m; 0 \<le> y; y < m; 0 \<le> z; z < m\<rbrakk> \<Longrightarrow> x * y mod m * z mod m = x * (y * z mod m) mod m
 2. \<And>x y. \<lbrakk>1 < m; 0 \<le> x; x < m; 0 \<le> y; y < m\<rbrakk> \<Longrightarrow> x * y mod m = y * x mod m
[PROOF STEP]
apply (metis mod_mult_right_eq mult.assoc mult.commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>1 < m; 0 \<le> x; x < m; 0 \<le> y; y < m\<rbrakk> \<Longrightarrow> x * y mod m = y * x mod m
[PROOF STEP]
apply (metis mult.commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vangle_commute: "vangle u v = vangle v u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vangle u v = vangle v u
[PROOF STEP]
by (simp add: vangle_def inner_commute mult.commute)


[STATEMENT]
lemma union_le_diff_plus: "P \<subseteq># M \<Longrightarrow> N < P \<Longrightarrow> M - P + N < M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<subseteq># M; N < P\<rbrakk> \<Longrightarrow> M - P + N < M
[PROOF STEP]
by (drule subset_mset.diff_add[symmetric]) (metis union_le_mono2)


[STATEMENT]
lemma section_closed[intro, simp]: "section s Ds S \<Longrightarrow> closed {x \<in> S. s x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. section s Ds S \<Longrightarrow> closed {x \<in> S. s x = 0}
[PROOF STEP]
by (auto intro!: closed_levelset_within simp: section_def
      intro!: has_derivative_continuous_on has_derivative_at_withinI[where s=S])


[STATEMENT]
lemma aug_commute:"\<lbrakk>commute_bpp f (aug_pm_set z i A);
     x \<in> addition_set f (aug_pm_set z i A);
     y \<in> addition_set f (aug_pm_set z i A)\<rbrakk> \<Longrightarrow> x \<^sub>f+ y = y \<^sub>f+ x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>commute_bpp f (aug_pm_set z i A); x \<in> addition_set f (aug_pm_set z i A); y \<in> addition_set f (aug_pm_set z i A)\<rbrakk> \<Longrightarrow> x \<^sub>f+ y = y \<^sub>f+ x
[PROOF STEP]
apply (simp add: commute_bpp_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "ipset_from_cidr (ipv4addr_of_dotdecimal (192,168,0,42)) 16 =
          {ipv4addr_of_dotdecimal (192,168,0,0) .. ipv4addr_of_dotdecimal (192,168,255,255)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipset_from_cidr (ipv4addr_of_dotdecimal (192, 168, 0, 42)) 16 = {ipv4addr_of_dotdecimal (192, 168, 0, 0)..ipv4addr_of_dotdecimal (192, 168, 255, 255)}
[PROOF STEP]
by(simp add: ipset_from_cidr_alt mask_eq ipv4addr_of_dotdecimal.simps ipv4addr_of_nat_def)


[STATEMENT]
lemma  det_rows_mul:
  "det((\<chi> i. c i *s a i)::'a::comm_ring_1^'n^'n) =
    prod (\<lambda>i. c i) (UNIV:: 'n set) * det((\<chi> i. a i)::'a^'n^'n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (\<chi>i. c i *s a i) = prod c UNIV * det (\<chi>i. a i)
[PROOF STEP]
proof (simp add: det_def sum_distrib_left cong add: prod.cong, rule sum.cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
let ?U = "UNIV :: 'n set"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
let ?PU = "{p. p permutes ?U}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
assume pU: "p \<in> ?PU"
[PROOF STATE]
proof (state)
this:
p \<in> {p. p permutes UNIV}

goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
let ?s = "of_int (sign p)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
from pU
[PROOF STATE]
proof (chain)
picking this:
p \<in> {p. p permutes UNIV}
[PROOF STEP]
have p: "p permutes ?U"
[PROOF STATE]
proof (prove)
using this:
p \<in> {p. p permutes UNIV}

goal (1 subgoal):
 1. p permutes UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p permutes UNIV

goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
have "prod (\<lambda>i. c i * a i $ p i) ?U = prod c ?U * prod (\<lambda>i. a i $ p i) ?U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>UNIV. c i * a i $ p i) = prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i)
[PROOF STEP]
unfolding prod.distrib
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i) = prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>UNIV. c i * a i $ p i) = prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i)

goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>i\<in>UNIV. c i * a i $ p i) = prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i)
[PROOF STEP]
show "?s * (\<Prod>xa\<in>?U. c xa * a xa $ p xa) =
    prod c ?U * (?s* (\<Prod>xa\<in>?U. a xa $ p xa))"
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i\<in>UNIV. c i * a i $ p i) = prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i)

goal (1 subgoal):
 1. of_int (sign p) * (\<Prod>xa\<in>UNIV. c xa * a xa $ p xa) = prod c UNIV * (of_int (sign p) * (\<Prod>xa\<in>UNIV. a xa $ p xa))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
of_int (sign p) * (\<Prod>xa\<in>UNIV. c xa * a xa $ p xa) = prod c UNIV * (of_int (sign p) * (\<Prod>xa\<in>UNIV. a xa $ p xa))

goal (1 subgoal):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
[PROOF STEP]
qed rule


[STATEMENT]
lemma subarray_append: "\<lbrakk> i \<le> j; j \<le> k \<rbrakk> \<Longrightarrow> subarray i j a h @ subarray j k a h = subarray i k a h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> subarray i j a h @ subarray j k a h = subarray i k a h
[PROOF STEP]
unfolding subarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> nths' i j (Array.get h a) @ nths' j k (Array.get h a) = nths' i k (Array.get h a)
[PROOF STEP]
by (simp add: nths'_append)


[STATEMENT]
lemma iarray_to_matrix_matrix_to_iarray:
  fixes A::"'a^'columns::{mod_type}^'rows::{mod_type}"
  shows "iarray_to_matrix (matrix_to_iarray A)=A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iarray_to_matrix (matrix_to_iarray A) = A
[PROOF STEP]
unfolding matrix_to_iarray_def iarray_to_matrix_def o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i j. IArray (map (\<lambda>x. vec_to_iarray (A $ mod_type_class.from_nat x)) [0..<CARD('rows)]) !! mod_type_class.to_nat i !! mod_type_class.to_nat j) = A
[PROOF STEP]
by (vector, auto, metis IArray.sub_def vec_to_iarray_nth')


[STATEMENT]
lemma univ_second_countable:
  obtains \<B> :: "'a::second_countable_topology set set"
  where "countable \<B>" "\<And>C. C \<in> \<B> \<Longrightarrow> open C"
       "\<And>S. open S \<Longrightarrow> \<exists>U. U \<subseteq> \<B> \<and> S = \<Union>U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<B>. \<lbrakk>countable \<B>; \<And>C. C \<in> \<B> \<Longrightarrow> open C; \<And>S. open S \<Longrightarrow> \<exists>U\<subseteq>\<B>. S = \<Union> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis ex_countable_basis topological_basis_def)


[STATEMENT]
lemma path_connectedin_euclidean [simp]:
   "path_connectedin euclidean S \<longleftrightarrow> path_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connectedin euclidean S = path_connected S
[PROOF STEP]
by (auto simp: path_connectedin_def path_connected_space_iff_path_component path_connected_component)


[STATEMENT]
lemma tlookup_none:
     "sortedTree h t & (tlookup h k t = None) --> (\<forall>x\<in>setOf t. h x ~= k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sortedTree h t \<and> tlookup h k t = None \<longrightarrow> (\<forall>x\<in>setOf t. h x \<noteq> k)
[PROOF STEP]
by (induct t, auto)


[STATEMENT]
lemma mult_imp_less_div_pos: "0 < y \<Longrightarrow> z * y < x \<Longrightarrow> z < x / y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) < y; z * y < x\<rbrakk> \<Longrightarrow> z < x / y
[PROOF STEP]
by(simp add:field_simps)


[STATEMENT]
lemma homeomorphic_space_refl: "X homeomorphic_space X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X homeomorphic_space X
[PROOF STEP]
by (meson homeomorphic_maps_id homeomorphic_space_def)


[STATEMENT]
lemma dim_col_transfer_rule:
  "HMA_M A (A' :: 'a ^ 'nc ^ 'nr) \<Longrightarrow> (=) (dim_col A) (CARD('nc))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HMA_M A A' \<Longrightarrow> dim_col A = CARD('nc)
[PROOF STEP]
unfolding HMA_M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = from_hma\<^sub>m A' \<Longrightarrow> dim_col A = CARD('nc)
[PROOF STEP]
by auto


[STATEMENT]
lemma lsu_one: "\<nu>\<^sup>\<natural> 1 \<le> (1::'a::unital_quantale)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu>\<^sup>\<natural> (1::'a) \<le> (1::'a)
[PROOF STEP]
unfolding lsu_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<top> \<rightarrow> (1::'a) \<le> (1::'a)
[PROOF STEP]
using bres_canc1 dual_order.trans le_top
[PROOF STATE]
proof (prove)
using this:
?x \<cdot> (?x \<rightarrow> ?y) \<le> ?y
\<lbrakk>?b \<le> ?a; ?c \<le> ?b\<rbrakk> \<Longrightarrow> ?c \<le> ?a
?x \<le> \<top> \<cdot> ?x

goal (1 subgoal):
 1. \<top> \<rightarrow> (1::'a) \<le> (1::'a)
[PROOF STEP]
by blast


[STATEMENT]
lemma finite_subint1: "finite (subint1 G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (subint1 G)
[PROOF STEP]
apply (subst subint1_def2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (SIGMA I:{I. is_iface G I}. set (isuperIfs (the (iface G I))))
[PROOF STEP]
apply (rule finite_SigmaI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite {I. is_iface G I}
 2. \<And>I. I \<in> {I. is_iface G I} \<Longrightarrow> finite (set (isuperIfs (the (iface G I))))
[PROOF STEP]
apply (rule finite_is_iface)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>I. I \<in> {I. is_iface G I} \<Longrightarrow> finite (set (isuperIfs (the (iface G I))))
[PROOF STEP]
apply (simp (no_asm))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem nn_integral_limsup:
  fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> ennreal"
  assumes [measurable]: "\<And>i. u i \<in> borel_measurable M" "w \<in> borel_measurable M"
  assumes bounds: "\<And>i. AE x in M. u i x \<le> w x" and w: "(\<integral>\<^sup>+x. w x \<partial>M) < \<infinity>"
  shows "limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> (\<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
have bnd: "AE x in M. \<forall>i. u i x \<le> w x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. \<forall>i. u i x \<le> w x
[PROOF STEP]
using bounds
[PROOF STATE]
proof (prove)
using this:
AE x in M. u ?i x \<le> w x

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

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

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w
[PROOF STEP]
by (auto intro!: nn_integral_mono_AE elim: eventually_mono intro: SUP_least)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w

goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w
[PROOF STEP]
have "(\<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M) = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)
[PROOF STEP]
unfolding limsup_INF_SUP
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF n. SUP n\<in>{n..}. u n x) \<partial>M = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)
[PROOF STEP]
using bnd w
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w
AE x in M. \<forall>i. u i x \<le> w x
integral\<^sup>N M w < \<infinity>

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF n. SUP n\<in>{n..}. u n x) \<partial>M = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)
[PROOF STEP]
by (intro nn_integral_monotone_convergence_INF_AE')
       (auto intro!: AE_I2 intro: SUP_least SUP_subset_mono)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)

goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)

goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
have "\<dots> \<ge> limsup (\<lambda>n. integral\<^sup>N M (u n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)
[PROOF STEP]
by (auto simp: limsup_INF_SUP intro!: INF_mono SUP_least exI nn_integral_mono SUP_upper)
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)

goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
finally (xtrans)
[PROOF STATE]
proof (chain)
picking this:
limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M

goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma higher_differentiable_on_compose':
  "higher_differentiable_on S (\<lambda>x. f (g x)) n"
  if "higher_differentiable_on T f n" "higher_differentiable_on S g n"  "g ` S \<subseteq> T" "open S" "open T"
  for g::"_\<Rightarrow>_::euclidean_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higher_differentiable_on S (\<lambda>x. f (g x)) n
[PROOF STEP]
using higher_differentiable_on_compose[of T f n S g] comp_def that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>higher_differentiable_on T f n; higher_differentiable_on S g n; g ` S \<subseteq> T; open S; open T\<rbrakk> \<Longrightarrow> higher_differentiable_on S (f \<circ> g) n
?f \<circ> ?g = (\<lambda>x. ?f (?g x))
higher_differentiable_on T f n
higher_differentiable_on S g n
g ` S \<subseteq> T
open S
open T

goal (1 subgoal):
 1. higher_differentiable_on S (\<lambda>x. f (g x)) n
[PROOF STEP]
by (metis (no_types, lifting) higher_differentiable_on_cong)


[STATEMENT]
lemma floor_less_numeral [simp]: "\<lfloor>x\<rfloor> < numeral v \<longleftrightarrow> x < numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> < numeral v) = (x < numeral v)
[PROOF STEP]
by (simp add: floor_less_iff)


[STATEMENT]
lemma OT_14_P1_sec: "OT_14.adv_P1 (R1_12_0T n) n m1 m2 D \<le> 3 * (adv_OT12 n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OT_14.adv_P1 (R1_12_0T n) n m1 m2 D \<le> 3 * adv_OT12 n
[PROOF STEP]
unfolding OT_14.adv_P1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>spmf (R1_14 (R1_12_0T n) n m1 m2 \<bind> D) True - spmf (funct_OT_14 m1 m2 \<bind> (\<lambda>(o1, o2). S1_14 n m1 o1 \<bind> D)) True\<bar> \<le> 3 * adv_OT12 n
[PROOF STEP]
using reduction_P1 surj_pair
[PROOF STATE]
proof (prove)
using this:
\<bar>spmf (R1_14 ?R1_12_0T ?n ?M (?c0.0, ?c1.0) \<bind> ?D) True - spmf (funct_OT_14 ?M (?c0.0, ?c1.0) \<bind> (\<lambda>(out1, out2). S1_14 ?n ?M out1 \<bind> ?D)) True\<bar> \<le> 3 * adv_OT12 ?n
\<exists>x y. ?p = (x, y)

goal (1 subgoal):
 1. \<bar>spmf (R1_14 (R1_12_0T n) n m1 m2 \<bind> D) True - spmf (funct_OT_14 m1 m2 \<bind> (\<lambda>(o1, o2). S1_14 n m1 o1 \<bind> D)) True\<bar> \<le> 3 * adv_OT12 n
[PROOF STEP]
by metis


[STATEMENT]
lemma dom_S':
 "dom (\<lambda>n. if n : free_tv A Un free_tv t then S n else TVar n) \<subseteq>
  free_tv A Un free_tv t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Type.dom (\<lambda>n. if n \<in> free_tv A \<union> free_tv t then S n else TVar n) \<subseteq> free_tv A \<union> free_tv t
[PROOF STEP]
apply (unfold free_tv_subst dom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n. (if n \<in> free_tv A \<union> free_tv t then S n else TVar n) \<noteq> TVar n} \<subseteq> free_tv A \<union> free_tv t
[PROOF STEP]
apply (simp (no_asm))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n. (n \<in> free_tv A \<longrightarrow> S n \<noteq> TVar n) \<and> (n \<in> free_tv t \<longrightarrow> S n \<noteq> TVar n) \<and> (n \<in> free_tv A \<or> n \<in> free_tv t)} \<subseteq> free_tv A \<union> free_tv t
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mset_ecl_and_mset_lit:
  assumes "L \<in> (cl_ecl C)"
  assumes "finite (cl_ecl C)"
  shows "(mset_lit (subst_lit L \<sigma>)) \<in># (mset_ecl (C,\<sigma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
from assms(1) assms(2)
[PROOF STATE]
proof (chain)
picking this:
L \<in> cl_ecl C
finite (cl_ecl C)
[PROOF STEP]
have "L \<in># (mset_set (cl_ecl C))"
[PROOF STATE]
proof (prove)
using this:
L \<in> cl_ecl C
finite (cl_ecl C)

goal (1 subgoal):
 1. L \<in># mset_set (cl_ecl C)
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
L \<in># mset_set (cl_ecl C)

goal (1 subgoal):
 1. mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
L \<in># mset_set (cl_ecl C)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
L \<in># mset_set (cl_ecl C)

goal (1 subgoal):
 1. mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. L \<in># mset_set (cl_ecl C) \<Longrightarrow> mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
have f1: "mset_set (cl_ecl C) - {#L#} + {#L#} = mset_set (cl_ecl C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_set (cl_ecl C) - {#L#} + {#L#} = mset_set (cl_ecl C)
[PROOF STEP]
by (meson \<open>L \<in># mset_set (cl_ecl C)\<close> insert_DiffM2)
[PROOF STATE]
proof (state)
this:
mset_set (cl_ecl C) - {#L#} + {#L#} = mset_set (cl_ecl C)

goal (1 subgoal):
 1. L \<in># mset_set (cl_ecl C) \<Longrightarrow> mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
have "count {#mset_lit (subst_lit L \<sigma>)#} (mset_lit (subst_lit L \<sigma>)) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count {#mset_lit (subst_lit L \<sigma>)#} (mset_lit (subst_lit L \<sigma>)) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count {#mset_lit (subst_lit L \<sigma>)#} (mset_lit (subst_lit L \<sigma>)) = 1

goal (1 subgoal):
 1. L \<in># mset_set (cl_ecl C) \<Longrightarrow> mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
count {#mset_lit (subst_lit L \<sigma>)#} (mset_lit (subst_lit L \<sigma>)) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
count {#mset_lit (subst_lit L \<sigma>)#} (mset_lit (subst_lit L \<sigma>)) = 1

goal (1 subgoal):
 1. mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
by (metis (no_types, lifting) f1 image_mset_add_mset insert_iff mset_ecl.simps set_mset_add_mset_insert union_mset_add_mset_right)
[PROOF STATE]
proof (state)
this:
mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_divisor_exists_strong:
  fixes m :: int
  assumes "m > 1" "\<not>prime m"
  shows   "\<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < m
\<not> prime m
[PROOF STEP]
obtain n k where nk: "n * k > 1" "n \<ge> 0" "m = n * k" "n \<noteq> 1" "n \<noteq> 0" "k \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m

goal (1 subgoal):
 1. (\<And>n k. \<lbrakk>1 < n * k; 0 \<le> n; m = n * k; n \<noteq> 1; n \<noteq> 0; k \<noteq> 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m
1 < m
\<not> prime m

goal (1 subgoal):
 1. (\<And>n k. \<lbrakk>1 < n * k; 0 \<le> n; m = n * k; n \<noteq> 1; n \<noteq> 0; k \<noteq> 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding prime_int_iff dvd_def
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> (1 < m \<and> (\<forall>ma. 0 \<le> ma \<and> (\<exists>k. m = ma * k) \<longrightarrow> ma = 1 \<or> ma = m))
1 < m
\<not> (1 < m \<and> (\<forall>ma. 0 \<le> ma \<and> (\<exists>k. m = ma * k) \<longrightarrow> ma = 1 \<or> ma = m))

goal (1 subgoal):
 1. (\<And>n k. \<lbrakk>1 < n * k; 0 \<le> n; m = n * k; n \<noteq> 1; n \<noteq> 0; k \<noteq> 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from nk
[PROOF STATE]
proof (chain)
picking this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
[PROOF STEP]
have "n > 1"
[PROOF STATE]
proof (prove)
using this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1

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

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from nk assms
[PROOF STATE]
proof (chain)
picking this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
1 < m
\<not> prime m
[PROOF STEP]
have "n * k > 0"
[PROOF STATE]
proof (prove)
using this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
1 < m
\<not> prime m

goal (1 subgoal):
 1. 0 < n * k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < n * k

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with \<open>n \<ge> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<le> n
0 < n * k
[PROOF STEP]
have "k > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> n
0 < n * k

goal (1 subgoal):
 1. 0 < k
[PROOF STEP]
using zero_less_mult_pos
[PROOF STATE]
proof (prove)
using this:
0 \<le> n
0 < n * k
\<lbrakk>(0::?'a) < ?a * ?b; (0::?'a) < ?a\<rbrakk> \<Longrightarrow> (0::?'a) < ?b

goal (1 subgoal):
 1. 0 < k
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 < k

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with \<open>k \<noteq> 1\<close>
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 1
0 < k
[PROOF STEP]
have "k > 1"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 1
0 < k

goal (1 subgoal):
 1. 1 < k
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
1 < k

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from nk
[PROOF STATE]
proof (chain)
picking this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
[PROOF STEP]
have "n > 1"
[PROOF STATE]
proof (prove)
using this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1

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

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from \<open>k > 1\<close> nk
[PROOF STATE]
proof (chain)
picking this:
1 < k
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
[PROOF STEP]
have "n < m" "k < m"
[PROOF STATE]
proof (prove)
using this:
1 < k
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1

goal (1 subgoal):
 1. n < m &&& k < m
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
n < m
k < m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with nk \<open>k > 1\<close> \<open>n > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
1 < k
1 < n
n < m
k < m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
1 < k
1 < n
n < m
k < m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma east_west_on_equator:
  shows "proj2_incident east equator" and "proj2_incident west equator"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_incident east equator &&& proj2_incident west equator
[PROOF STEP]
unfolding east_def and west_def and equator_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_incident (proj2_abs (vector [1, 0, 1])) (proj2_line_abs (vector [0, 1, 0])) &&& proj2_incident (proj2_abs (vector [- 1, 0, 1])) (proj2_line_abs (vector [0, 1, 0]))
[PROOF STEP]
using compass_non_zero
[PROOF STATE]
proof (prove)
using this:
vector [1, 0, 1] \<noteq> 0
vector [- 1, 0, 1] \<noteq> 0
vector [0, 1, 1] \<noteq> 0
vector [0, - 1, 1] \<noteq> 0
vector [0, 1, 0] \<noteq> 0
vector [1, 0, 0] \<noteq> 0

goal (1 subgoal):
 1. proj2_incident (proj2_abs (vector [1, 0, 1])) (proj2_line_abs (vector [0, 1, 0])) &&& proj2_incident (proj2_abs (vector [- 1, 0, 1])) (proj2_line_abs (vector [0, 1, 0]))
[PROOF STEP]
by (simp_all add: proj2_incident_abs inner_vec_def vector_def sum_3)


[STATEMENT]
lemma case_sum_rule:
  "\<lbrakk> \<And>x. v=Inl x \<Longrightarrow> <P> fl x <Q>;
     \<And>x. v=Inr x \<Longrightarrow> <P> fr x <Q> \<rbrakk>
  \<Longrightarrow> <P> case_sum fl fr v <Q>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. v = Inl x \<Longrightarrow> <P> fl x <Q>; \<And>x. v = Inr x \<Longrightarrow> <P> fr x <Q>\<rbrakk> \<Longrightarrow> <P> case v of Inl x \<Rightarrow> fl x | Inr x \<Rightarrow> fr x <Q>
[PROOF STEP]
by (auto split: sum.split)


[STATEMENT]
lemma vimage_eq_imp_vcomp:
  assumes "r `\<^sub>\<circ> A = s `\<^sub>\<circ> B"
  shows "(t \<circ>\<^sub>\<circ> r) `\<^sub>\<circ> A = (t \<circ>\<^sub>\<circ> s) `\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t \<circ>\<^sub>\<circ> r) `\<^sub>\<circ> A = (t \<circ>\<^sub>\<circ> s) `\<^sub>\<circ> B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r `\<^sub>\<circ> A = s `\<^sub>\<circ> B

goal (1 subgoal):
 1. (t \<circ>\<^sub>\<circ> r) `\<^sub>\<circ> A = (t \<circ>\<^sub>\<circ> s) `\<^sub>\<circ> B
[PROOF STEP]
by (metis vcomp_vimage)


[STATEMENT]
lemma emeasure_cond_pmf:
  fixes p A
  defines "q \<equiv> cond_pmf p A"
  assumes "set_pmf p \<inter> A \<noteq> {}"
  shows "emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A
[PROOF STEP]
note [transfer_rule] = cond_pmf.transfer[OF assms(2), folded q_def]
[PROOF STATE]
proof (state)
this:
pmf_as_measure.cr_pmf (uniform_measure (measure_pmf p) A) q

goal (1 subgoal):
 1. emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A
[PROOF STEP]
interpret pmf_as_measure
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A
[PROOF STEP]
by transfer simp
[PROOF STATE]
proof (state)
this:
emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nn_integral_measurable_subprob_algebra2:
  assumes f[measurable]: "(\<lambda>(x, y). f x y) \<in> borel_measurable (M \<Otimes>\<^sub>M N)"
  assumes N[measurable]: "L \<in> measurable M (subprob_algebra N)"
  shows "(\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
note nn_integral_measurable_subprob_algebra[measurable]
[PROOF STATE]
proof (state)
this:
?f \<in> borel_measurable ?N \<Longrightarrow> (\<lambda>M. integral\<^sup>N M ?f) \<in> borel_measurable (subprob_algebra ?N)

goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
note measurable_distr2[measurable]
[PROOF STATE]
proof (state)
this:
\<lbrakk>(\<lambda>(x, y). ?f x y) \<in> ?L \<Otimes>\<^sub>M ?M \<rightarrow>\<^sub>M ?N; ?g \<in> ?L \<rightarrow>\<^sub>M subprob_algebra ?M\<rbrakk> \<Longrightarrow> (\<lambda>x. distr (?g x) ?N (?f x)) \<in> ?L \<rightarrow>\<^sub>M subprob_algebra ?N

goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
have "(\<lambda>x. integral\<^sup>N (distr (L x) (M \<Otimes>\<^sub>M N) (\<lambda>y. (x, y))) (\<lambda>(x, y). f x y)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<integral>\<^sup>+ (x, y). f x y \<partial>distr (L x) (M \<Otimes>\<^sub>M N) (Pair x)) \<in> borel_measurable M
[PROOF STEP]
by measurable
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<integral>\<^sup>+ (x, y). f x y \<partial>distr (L x) (M \<Otimes>\<^sub>M N) (Pair x)) \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. \<integral>\<^sup>+ (x, y). f x y \<partial>distr (L x) (M \<Otimes>\<^sub>M N) (Pair x)) \<in> borel_measurable M
[PROOF STEP]
show "(\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<integral>\<^sup>+ (x, y). f x y \<partial>distr (L x) (M \<Otimes>\<^sub>M N) (Pair x)) \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
by (rule measurable_cong[THEN iffD1, rotated])
       (simp add: nn_integral_distr)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wn_triangle3:
  assumes z: "z \<in> interior(convex hull {a,b,c})"
      and "0 < Im((b-a) * cnj (b-z))"
          "0 < Im((c-b) * cnj (c-z))"
          "0 < Im((a-c) * cnj (a-z))"
    shows "winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
have znot[simp]: "z \<notin> closed_segment a b" "z \<notin> closed_segment b c" "z \<notin> closed_segment c a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> closed_segment a b &&& z \<notin> closed_segment b c &&& z \<notin> closed_segment c a
[PROOF STEP]
using z interior_of_triangle [of a b c]
[PROOF STATE]
proof (prove)
using this:
z \<in> interior (convex hull {a, b, c})
DIM(complex) = 2 \<Longrightarrow> interior (convex hull {a, b, c}) = convex hull {a, b, c} - (closed_segment a b \<union> closed_segment b c \<union> closed_segment c a)

goal (1 subgoal):
 1. z \<notin> closed_segment a b &&& z \<notin> closed_segment b c &&& z \<notin> closed_segment c a
[PROOF STEP]
by (auto simp: closed_segment_def)
[PROOF STATE]
proof (state)
this:
z \<notin> closed_segment a b
z \<notin> closed_segment b c
z \<notin> closed_segment c a

goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
have gt0: "0 < Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z \<in> interior (convex hull {a, b, c})
0 < Im ((b - a) * cnj (b - z))
0 < Im ((c - b) * cnj (c - z))
0 < Im ((a - c) * cnj (a - z))

goal (1 subgoal):
 1. 0 < Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z)
[PROOF STEP]
by (simp add: winding_number_linepath_pos_lt path_image_join winding_number_join_pos_combined)
[PROOF STATE]
proof (state)
this:
0 < Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z)

goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
have lt2: "Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2
[PROOF STEP]
using winding_number_lt_half_linepath [of _ a b]
[PROOF STATE]
proof (prove)
using this:
?z \<notin> closed_segment a b \<Longrightarrow> \<bar>Re (winding_number (linepath a b) ?z)\<bar> < 1 / 2

goal (1 subgoal):
 1. Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2
[PROOF STEP]
using winding_number_lt_half_linepath [of _ b c]
[PROOF STATE]
proof (prove)
using this:
?z \<notin> closed_segment a b \<Longrightarrow> \<bar>Re (winding_number (linepath a b) ?z)\<bar> < 1 / 2
?z \<notin> closed_segment b c \<Longrightarrow> \<bar>Re (winding_number (linepath b c) ?z)\<bar> < 1 / 2

goal (1 subgoal):
 1. Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2
[PROOF STEP]
using winding_number_lt_half_linepath [of _ c a] znot
[PROOF STATE]
proof (prove)
using this:
?z \<notin> closed_segment a b \<Longrightarrow> \<bar>Re (winding_number (linepath a b) ?z)\<bar> < 1 / 2
?z \<notin> closed_segment b c \<Longrightarrow> \<bar>Re (winding_number (linepath b c) ?z)\<bar> < 1 / 2
?z \<notin> closed_segment c a \<Longrightarrow> \<bar>Re (winding_number (linepath c a) ?z)\<bar> < 1 / 2
z \<notin> closed_segment a b
z \<notin> closed_segment b c
z \<notin> closed_segment c a

goal (1 subgoal):
 1. Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2
[PROOF STEP]
by (fastforce simp add: winding_number_join path_image_join)
[PROOF STATE]
proof (state)
this:
Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2

goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
by (rule winding_number_eq_1) (simp_all add: path_image_join gt0 lt2)
[PROOF STATE]
proof (state)
this:
winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma union_le_diff_plus: "P \<subseteq># M \<Longrightarrow> N < P \<Longrightarrow> M - P + N < M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<subseteq># M; N < P\<rbrakk> \<Longrightarrow> M - P + N < M
[PROOF STEP]
by (drule subset_mset.diff_add[symmetric]) (metis union_le_mono2)


[STATEMENT]
lemma pmf_prob_code_alt_finite:
  "finite A \<Longrightarrow> pmf_prob p A = (\<Sum>x\<in>A. pmf p x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> pmf_prob p A = sum (pmf p) A
[PROOF STEP]
by (simp add: pmf_prob_pmf_set_integral pmf_set_integral_code_alt_finite)


[STATEMENT]
lemma (in complete_boolean_algebra) meet_shunt: "x \<sqinter> y = \<bottom> \<longleftrightarrow> x \<le> -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<sqinter> y = \<bottom>) = (x \<le> - y)
[PROOF STEP]
by (metis bot_least inf_absorb2 inf_compl_bot_left2 shunt1 sup_absorb1)


[STATEMENT]
lemma filtermap_ln_at_top: "filtermap (ln::real \<Rightarrow> real) at_top = at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap ln at_top = at_top
[PROOF STEP]
by (intro filtermap_fun_inverse[of exp] exp_at_top ln_at_top) auto


[STATEMENT]
lemma UNION_subsetD: "\<lbrakk> (\<Union>x\<in>A. f x) \<subseteq> B; a \<in> A \<rbrakk> \<Longrightarrow> f a \<subseteq> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<Union> (f ` A) \<subseteq> B; a \<in> A\<rbrakk> \<Longrightarrow> f a \<subseteq> B
[PROOF STEP]
by blast


[STATEMENT]
lemma [rel2p]: "rel2p (\<langle>A\<rangle>set_rel) = rel_set (rel2p A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel2p (\<langle>A\<rangle>set_rel) = rel_set (rel2p A)
[PROOF STEP]
unfolding set_rel_def rel_set_def rel2p_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. (x, y) \<in> {(Aa, B). (\<forall>x\<in>Aa. \<exists>y\<in>B. (x, y) \<in> A) \<and> (\<forall>y\<in>B. \<exists>x\<in>Aa. (x, y) \<in> A)}) = (\<lambda>Aa B. (\<forall>x\<in>Aa. \<exists>y\<in>B. (x, y) \<in> A) \<and> (\<forall>y\<in>B. \<exists>x\<in>Aa. (x, y) \<in> A))
[PROOF STEP]
by blast


[STATEMENT]
lemma smcf_const_is_semifunctor'[smc_cs_intros]:
  assumes "semicategory \<alpha> \<CC>"
    and "semicategory \<alpha> \
"
    and "f : a \<mapsto>\<^bsub>\
\<^esub> a"
    and "f \<circ>\<^sub>A\<^bsub>\
\<^esub> f = f"
    and "\<AA> = \<CC>"
    and "\<BB> = \
"
  shows "smcf_const \<CC> \
 a f : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dghm_const \<CC> \
 a f : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
using assms(1-4)
[PROOF STATE]
proof (prove)
using this:
semicategory \<alpha> \<CC>
semicategory \<alpha> \

f : a \<mapsto>\<^bsub>\
\<^esub> a
f \<circ>\<^sub>A\<^bsub>\
\<^esub> f = f

goal (1 subgoal):
 1. dghm_const \<CC> \
 a f : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
unfolding assms(5,6)
[PROOF STATE]
proof (prove)
using this:
semicategory \<alpha> \<CC>
semicategory \<alpha> \

f : a \<mapsto>\<^bsub>\
\<^esub> a
f \<circ>\<^sub>A\<^bsub>\
\<^esub> f = f

goal (1 subgoal):
 1. dghm_const \<CC> \
 a f : \<CC> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \

[PROOF STEP]
by (rule smcf_const_is_semifunctor)


[STATEMENT]
lemma fds_nth_power_eq_0:
  assumes "n < 2 ^ k" "fds_nth f 1 = 0"
  shows   "fds_nth (f ^ k) n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (f ^ k) n = (0::'a)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
n < 2 ^ k

goal (1 subgoal):
 1. fds_nth (f ^ k) n = (0::'a)
[PROOF STEP]
proof (induction k arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. n < 2 ^ 0 \<Longrightarrow> fds_nth (f ^ 0) n = (0::'a)
 2. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n < 2 ^ 0

goal (2 subgoals):
 1. \<And>n. n < 2 ^ 0 \<Longrightarrow> fds_nth (f ^ 0) n = (0::'a)
 2. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
n < 2 ^ 0

goal (1 subgoal):
 1. fds_nth (f ^ 0) n = (0::'a)
[PROOF STEP]
by (simp add: one_fds_def)
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ 0) n = (0::'a)

goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
case (Suc k n)
[PROOF STATE]
proof (state)
this:
?n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) ?n = (0::'a)
n < 2 ^ Suc k

goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
have "fds_nth (f ^ Suc k) n = dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (f ^ Suc k) n = dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n
[PROOF STEP]
by (subst power_Suc2) (simp add: fds_nth_mult dirichlet_prod_commutes)
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ Suc k) n = dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n

goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ Suc k) n = dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n

goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n = (0::'a)
[PROOF STEP]
unfolding dirichlet_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. fds_nth (f ^ k) d * fds_nth f (n div d)) = (0::'a)
[PROOF STEP]
proof (intro sum.neutral ballI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {d. d dvd n} \<Longrightarrow> fds_nth (f ^ k) x * fds_nth f (n div x) = (0::'a)
[PROOF STEP]
fix d
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {d. d dvd n} \<Longrightarrow> fds_nth (f ^ k) x * fds_nth f (n div x) = (0::'a)
[PROOF STEP]
assume d: "d \<in> {d. d dvd n}"
[PROOF STATE]
proof (state)
this:
d \<in> {d. d dvd n}

goal (1 subgoal):
 1. \<And>x. x \<in> {d. d dvd n} \<Longrightarrow> fds_nth (f ^ k) x * fds_nth f (n div x) = (0::'a)
[PROOF STEP]
show "fds_nth (f ^ k) d * fds_nth f (n div d) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
proof (cases "d < 2 ^ k")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
 2. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
d < 2 ^ k

goal (2 subgoals):
 1. d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
 2. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
d < 2 ^ k

goal (1 subgoal):
 1. fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
using Suc.IH[of d]
[PROOF STATE]
proof (prove)
using this:
d < 2 ^ k
d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d = (0::'a)

goal (1 subgoal):
 1. fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> d < 2 ^ k

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
hence "(n div d) * 2 ^ k \<le> (n div d) * d"
[PROOF STATE]
proof (prove)
using this:
\<not> d < 2 ^ k

goal (1 subgoal):
 1. n div d * 2 ^ k \<le> n div d * d
[PROOF STEP]
by (intro mult_left_mono) auto
[PROOF STATE]
proof (state)
this:
n div d * 2 ^ k \<le> n div d * d

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n div d * 2 ^ k \<le> n div d * d

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
from d
[PROOF STATE]
proof (chain)
picking this:
d \<in> {d. d dvd n}
[PROOF STEP]
have "(n div d) * d = n"
[PROOF STATE]
proof (prove)
using this:
d \<in> {d. d dvd n}

goal (1 subgoal):
 1. n div d * d = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n div d * d = n

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n div d * d = n

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
?n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) ?n = (0::'a)
n < 2 ^ Suc k
[PROOF STEP]
have "n < 2 * 2 ^ k"
[PROOF STATE]
proof (prove)
using this:
?n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) ?n = (0::'a)
n < 2 ^ Suc k

goal (1 subgoal):
 1. n < 2 * 2 ^ k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n < 2 * 2 ^ k

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
n div d * 2 ^ k < 2 * 2 ^ k
[PROOF STEP]
have "n div d \<le> 1"
[PROOF STATE]
proof (prove)
using this:
n div d * 2 ^ k < 2 * 2 ^ k

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

goal (1 subgoal):
 1. \<not> d < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
with assms(2)
[PROOF STATE]
proof (chain)
picking this:
fds_nth f 1 = (0::'a)
n div d \<le> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fds_nth f 1 = (0::'a)
n div d \<le> 1

goal (1 subgoal):
 1. fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)
[PROOF STEP]
by (cases "n div d") simp_all
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ k) d * fds_nth f (n div d) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dirichlet_prod (fds_nth (f ^ k)) (fds_nth f) n = (0::'a)

goal (1 subgoal):
 1. \<And>k n. \<lbrakk>\<And>n. n < 2 ^ k \<Longrightarrow> fds_nth (f ^ k) n = (0::'a); n < 2 ^ Suc k\<rbrakk> \<Longrightarrow> fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fds_nth (f ^ Suc k) n = (0::'a)

goal (1 subgoal):
 1. fds_nth (f ^ Suc k) n = (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fds_nth (f ^ Suc k) n = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjugate_subinf: "residuated f \<Longrightarrow> conjugate f (x \<sqinter> y) \<le> conjugate f x \<sqinter> conjugate f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residuated f \<Longrightarrow> conjugate f (x \<sqinter> y) \<le> conjugate f x \<sqinter> conjugate f y
[PROOF STEP]
by (auto simp: conj_iso)


[STATEMENT]
lemma converse_br_sv_iff[simp]:
  "single_valued (converse (br \<alpha> I)) \<longleftrightarrow> inj_on \<alpha> (Collect I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_valued ((br \<alpha> I)\<inverse>) = inj_on \<alpha> (Collect I)
[PROOF STEP]
by (auto intro!: inj_onI single_valuedI dest: single_valuedD inj_onD
    simp: br_def) []


[STATEMENT]
lemma path_components_of_maximal:
   "\<lbrakk>C \<in> path_components_of X; path_connectedin X S; ~disjnt C S\<rbrakk> \<Longrightarrow> S \<subseteq> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>C \<in> path_components_of X; path_connectedin X S; \<not> disjnt C S\<rbrakk> \<Longrightarrow> S \<subseteq> C
[PROOF STEP]
apply (auto simp: path_components_of_def path_component_of_equiv)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>path_connectedin X S; \<not> disjnt (path_component_of_set X x) S; x \<in> topspace X; C = path_component_of_set X x; xa \<in> S\<rbrakk> \<Longrightarrow> xa \<in> topspace X
 2. \<And>x xa. \<lbrakk>path_connectedin X S; \<not> disjnt (path_component_of_set X x) S; x \<in> topspace X; C = path_component_of_set X x; xa \<in> S\<rbrakk> \<Longrightarrow> path_component_of X x = path_component_of X xa
[PROOF STEP]
using path_component_of_maximal path_connectedin_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>path_connectedin ?X ?s; ?x \<in> ?s\<rbrakk> \<Longrightarrow> ?s \<subseteq> path_component_of_set ?X ?x
path_connectedin ?X ?S \<equiv> ?S \<subseteq> topspace ?X \<and> path_connected_space (subtopology ?X ?S)

goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>path_connectedin X S; \<not> disjnt (path_component_of_set X x) S; x \<in> topspace X; C = path_component_of_set X x; xa \<in> S\<rbrakk> \<Longrightarrow> xa \<in> topspace X
 2. \<And>x xa. \<lbrakk>path_connectedin X S; \<not> disjnt (path_component_of_set X x) S; x \<in> topspace X; C = path_component_of_set X x; xa \<in> S\<rbrakk> \<Longrightarrow> path_component_of X x = path_component_of X xa
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>path_connectedin X S; \<not> disjnt (path_component_of_set X x) S; x \<in> topspace X; C = path_component_of_set X x; xa \<in> S\<rbrakk> \<Longrightarrow> path_component_of X x = path_component_of X xa
[PROOF STEP]
by (meson disjnt_subset2 path_component_of_disjoint path_component_of_equiv path_component_of_maximal)


[STATEMENT]
lemma simple_integral_PInf:
  "simple_function M f \<Longrightarrow> integral\<^sup>S M f \<noteq> \<infinity> \<Longrightarrow> emeasure M (f -` {\<infinity>} \<inter> space M) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>simple_function M f; integral\<^sup>S M f \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> emeasure M (f -` {\<infinity>} \<inter> space M) = 0
[PROOF STEP]
by (rule nn_integral_PInf) (auto simp: nn_integral_eq_simple_integral borel_measurable_simple_function)


[STATEMENT]
lemma plus_in_intervalE:
  fixes xy :: "'a :: linordered_ab_group_add"
  assumes "xy \<in>\<^sub>i X + Y"
  obtains x y where "xy = x + y" "x \<in>\<^sub>i X" "y \<in>\<^sub>i Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>xy = x + y; x \<in>\<^sub>i X; y \<in>\<^sub>i Y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xy \<in>\<^sub>i X + Y

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>xy = x + y; x \<in>\<^sub>i X; y \<in>\<^sub>i Y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding set_of_plus set_plus_def
[PROOF STATE]
proof (prove)
using this:
xy \<in> {c. \<exists>a\<in>set_of X. \<exists>b\<in>set_of Y. c = a + b}

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>xy = x + y; x \<in>\<^sub>i X; y \<in>\<^sub>i Y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma floor_less_numeral [simp]: "\<lfloor>x\<rfloor> < numeral v \<longleftrightarrow> x < numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> < numeral v) = (x < numeral v)
[PROOF STEP]
by (simp add: floor_less_iff)


[STATEMENT]
lemma DirProds_one':
  "i\<in>I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> i = \<one>\<^bsub>G i\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> i = \<one>\<^bsub>G i\<^esub>
[PROOF STEP]
unfolding DirProds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> I \<Longrightarrow> \<one>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> i = \<one>\<^bsub>G i\<^esub>
[PROOF STEP]
by simp


[STATEMENT]
lemma Fr_ClBr: "Br_1 \<B> \<Longrightarrow> \<forall>A. Fr(A) = (Cl(A) \<and> Br(A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Br_1 \<B> \<Longrightarrow> \<forall>A. (\<forall>w. \<F> A w = A w) = ((\<forall>w. \<C> A w = A w) \<and> (\<forall>w. \<B> A w = A w))
[PROOF STEP]
by (metis BF_rel Br_fr_def CF_rel Cl_fr_def eq_ext' join_def meet_def)


[STATEMENT]
theorem kac_formula_nonergodic:
  assumes A_meas [measurable]: "A \<in> sets M"
  shows "(\<integral>\<^sup>+y. return_time_function A y \<partial>M) = emeasure M (\<Union>n. (T^^n)--`A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
define f where "f = (\<lambda>(x::'a). 1::ennreal)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>x. 1)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
have "\<And>x. induced_function A f x = return_time_function A x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. induced_function A f x = of_nat (return_time_function A x)
[PROOF STEP]
unfolding induced_function_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<Sum>i<return_time_function A x. 1) = of_nat (return_time_function A x)
[PROOF STEP]
by (simp add:)
[PROOF STATE]
proof (state)
this:
induced_function A f ?x3 = of_nat (return_time_function A ?x3)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
induced_function A f ?x3 = of_nat (return_time_function A ?x3)
[PROOF STEP]
have "(\<integral>\<^sup>+y. return_time_function A y \<partial>M) = (\<integral>\<^sup>+y. induced_function A f y \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
induced_function A f ?x3 = of_nat (return_time_function A ?x3)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = integral\<^sup>N M (induced_function A f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = integral\<^sup>N M (induced_function A f)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = integral\<^sup>N M (induced_function A f)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
have "... = (\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
by (rule induced_function_nn_integral) (auto simp add: f_def)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
have "... = emeasure M (\<Union>n. (T^^n)--`A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
using f_def
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>x. 1)

goal (1 subgoal):
 1. set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = emeasure M (\<Union>n. (T ^^ n) --` A)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. of_nat (return_time_function A x) \<partial>M = emeasure M (\<Union>n. (T ^^ n) --` A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  I_ZmX_carrier:
  shows "I_ZmX \<in> carrier_mat 4 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I_ZmX \<in> carrier_mat 4 4
[PROOF STEP]
using tensor_mat_carrier ZmX_carrier
[PROOF STATE]
proof (prove)
using this:
?U \<Otimes> ?V \<in> carrier_mat (dim_row ?U * dim_row ?V) (dim_col ?U * dim_col ?V)
ZmX \<in> carrier_mat 2 2

goal (1 subgoal):
 1. I_ZmX \<in> carrier_mat 4 4
[PROOF STEP]
unfolding I_ZmX_def
[PROOF STATE]
proof (prove)
using this:
?U \<Otimes> ?V \<in> carrier_mat (dim_row ?U * dim_row ?V) (dim_col ?U * dim_col ?V)
ZmX \<in> carrier_mat 2 2

goal (1 subgoal):
 1. 1\<^sub>m 2 \<Otimes> ZmX \<in> carrier_mat 4 4
[PROOF STEP]
by auto


[STATEMENT]
lemma memb_sorted_correct :
  "sorted xs \<Longrightarrow> memb_sorted xs x \<longleftrightarrow> x \<in> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted xs \<Longrightarrow> memb_sorted xs x = (x \<in> set xs)
[PROOF STEP]
by (induct xs) (auto simp add: Ball_def)


[STATEMENT]
lemma (in Corps) mprod_mprodR:"\<lbrakk>\<forall>j \<le> n. e j \<in> Zset; \<forall>j \<le> n. 0 \<le> (e j);
 \<forall>j \<le> n. f j \<in> ((carrier K) - {\<zero>})\<rbrakk> \<Longrightarrow>
              mprod_exp K e f n = mprod_expR K (nat o e) f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K - {\<zero>}\<rbrakk> \<Longrightarrow> mprod_exp K e f n = mprod_expR K (nat \<circ> e) f n
[PROOF STEP]
apply (cut_tac field_is_ring)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K - {\<zero>}; Ring K\<rbrakk> \<Longrightarrow> mprod_exp K e f n = mprod_expR K (nat \<circ> e) f n
[PROOF STEP]
apply (simp add:mprod_exp_def mprod_expR_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> e\<Pi>\<^bsub>K,n\<^esub> (\<lambda>j. f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup>) = e\<Pi>\<^bsub>K,n\<^esub> (\<lambda>j. f j^\<^bsup>K nat (e j)\<^esup>)
[PROOF STEP]
apply (rule Ring.nprod_eq, assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup> \<in> carrier K
 2. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j^\<^bsup>K nat (e j)\<^esup> \<in> carrier K
 3. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup> = f j^\<^bsup>K nat (e j)\<^esup>
[PROOF STEP]
apply (rule allI, rule impI, simp add:npowf_mem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j^\<^bsup>K nat (e j)\<^esup> \<in> carrier K
 2. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup> = f j^\<^bsup>K nat (e j)\<^esup>
[PROOF STEP]
apply (rule allI, rule impI, rule Ring.npClose, assumption+, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup> = f j^\<^bsup>K nat (e j)\<^esup>
[PROOF STEP]
apply (rule allI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. \<lbrakk>\<forall>j\<le>n. e j \<in> Zset; \<forall>j\<le>n. 0 \<le> e j; \<forall>j\<le>n. f j \<in> carrier K \<and> f j \<noteq> \<zero>; Ring K; j \<le> n\<rbrakk> \<Longrightarrow> f j\<^bsub>K\<^esub>\<^bsup>e j\<^esup> = f j^\<^bsup>K nat (e j)\<^esup>
[PROOF STEP]
apply (simp add:npowf_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma to_Zp_ominus:
  assumes "a \<in> \<O>\<^sub>p"
  shows "to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> (to_Zp a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> to_Zp a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> to_Zp a
[PROOF STEP]
have "\<ominus>a \<in> \<O>\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<ominus> a \<in> \<O>\<^sub>p
[PROOF STEP]
by (simp add: val_ring_subring assms subringE(5))
[PROOF STATE]
proof (state)
this:
\<ominus> a \<in> \<O>\<^sub>p

goal (1 subgoal):
 1. to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> to_Zp a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<ominus> a \<in> \<O>\<^sub>p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<ominus> a \<in> \<O>\<^sub>p

goal (1 subgoal):
 1. to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> to_Zp a
[PROOF STEP]
by (metis (no_types, lifting) Zp.domain_axioms Zp.nonzero_one_closed assms
        cring.cring_simprules(3) domain.axioms(1) frac_uminus image_iff inc_to_Zp local.inc_def)
[PROOF STATE]
proof (state)
this:
to_Zp (\<ominus> a) = \<ominus>\<^bsub>Z\<^sub>p\<^esub> to_Zp a

goal:
No subgoals!
[PROOF STEP]
qed


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

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

goal (2 subgoals):
 1. \<And>B. \<lbrakk>\<Prod>\<^sub># {#} dvd \<Prod>\<^sub># B; \<And>p. p \<in># {#} \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> {#} \<subseteq># B
 2. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<Prod>\<^sub># {#} dvd \<Prod>\<^sub># B
?p1 \<in># {#} \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1

goal (1 subgoal):
 1. {#} \<subseteq># B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{#} \<subseteq># B

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
case (add p A B)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># ?B1; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># ?B1 \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># ?B1
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
hence p: "prime p"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># ?B1; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># ?B1 \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># ?B1
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1

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

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
define B' where "B' = B - {#p#}"
[PROOF STATE]
proof (state)
this:
B' = B - {#p#}

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
from add.prems
[PROOF STATE]
proof (chain)
picking this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1
[PROOF STEP]
have "p dvd prod_mset B"
[PROOF STATE]
proof (prove)
using this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1

goal (1 subgoal):
 1. p dvd \<Prod>\<^sub># B
[PROOF STEP]
by (simp add: dvd_mult_left)
[PROOF STATE]
proof (state)
this:
p dvd \<Prod>\<^sub># B

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
with add.prems
[PROOF STATE]
proof (chain)
picking this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1
p dvd \<Prod>\<^sub># B
[PROOF STEP]
have "p \<in># B"
[PROOF STATE]
proof (prove)
using this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1
p dvd \<Prod>\<^sub># B

goal (1 subgoal):
 1. p \<in># B
[PROOF STEP]
by (subst (asm) (2) prime_dvd_prod_mset_primes_iff) simp_all
[PROOF STATE]
proof (state)
this:
p \<in># B

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
hence B: "B = B' + {#p#}"
[PROOF STATE]
proof (prove)
using this:
p \<in># B

goal (1 subgoal):
 1. B = B' + {#p#}
[PROOF STEP]
by (simp add: B'_def)
[PROOF STATE]
proof (state)
this:
B = B' + {#p#}

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
from add.prems p
[PROOF STATE]
proof (chain)
picking this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1
prime p
[PROOF STEP]
have "A \<subseteq># B'"
[PROOF STATE]
proof (prove)
using this:
\<Prod>\<^sub># (add_mset p A) dvd \<Prod>\<^sub># B
?p1 \<in># add_mset p A \<Longrightarrow> prime ?p1
?p1 \<in># B \<Longrightarrow> prime ?p1
prime p

goal (1 subgoal):
 1. A \<subseteq># B'
[PROOF STEP]
by (intro add.IH) (simp_all add: B)
[PROOF STATE]
proof (state)
this:
A \<subseteq># B'

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>B. \<lbrakk>\<Prod>\<^sub># A dvd \<Prod>\<^sub># B; \<And>p. p \<in># A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> A \<subseteq># B; \<Prod>\<^sub># (add_mset x A) dvd \<Prod>\<^sub># B; \<And>p. p \<in># add_mset x A \<Longrightarrow> prime p; \<And>p. p \<in># B \<Longrightarrow> prime p\<rbrakk> \<Longrightarrow> add_mset x A \<subseteq># B
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
A \<subseteq># B'

goal (1 subgoal):
 1. add_mset p A \<subseteq># B
[PROOF STEP]
by (simp add: B)
[PROOF STATE]
proof (state)
this:
add_mset p A \<subseteq># B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strict_mono_on_mono_on_conv: "
  strict_mono_on f (A::'a::linorder set) = (mono_on f A \<and> inj_on f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SetInterval2.strict_mono_on f A = (SetInterval2.mono_on f A \<and> inj_on f A)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. SetInterval2.strict_mono_on f A \<Longrightarrow> SetInterval2.mono_on f A \<and> inj_on f A
 2. SetInterval2.mono_on f A \<and> inj_on f A \<Longrightarrow> SetInterval2.strict_mono_on f A
[PROOF STEP]
apply (frule strict_mono_on_imp_mono_on)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>SetInterval2.strict_mono_on f A; SetInterval2.mono_on f A\<rbrakk> \<Longrightarrow> SetInterval2.mono_on f A \<and> inj_on f A
 2. SetInterval2.mono_on f A \<and> inj_on f A \<Longrightarrow> SetInterval2.strict_mono_on f A
[PROOF STEP]
apply (frule strict_mono_on_imp_inj_on)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>SetInterval2.strict_mono_on f A; SetInterval2.mono_on f A; inj_on f A\<rbrakk> \<Longrightarrow> SetInterval2.mono_on f A \<and> inj_on f A
 2. SetInterval2.mono_on f A \<and> inj_on f A \<Longrightarrow> SetInterval2.strict_mono_on f A
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SetInterval2.mono_on f A \<and> inj_on f A \<Longrightarrow> SetInterval2.strict_mono_on f A
[PROOF STEP]
apply (erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>SetInterval2.mono_on f A; inj_on f A\<rbrakk> \<Longrightarrow> SetInterval2.strict_mono_on f A
[PROOF STEP]
apply (unfold inj_on_def mono_on_def strict_mono_on_def, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>\<forall>a\<in>A. \<forall>b\<in>A. a \<le> b \<longrightarrow> f a \<le> f b; \<forall>x\<in>A. \<forall>y\<in>A. f x = f y \<longrightarrow> x = y; a \<in> A; b \<in> A; a < b\<rbrakk> \<Longrightarrow> f a < f b
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma edges_less_eq_linorder: "is_linorder_rel edges_less_eq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_linorder_rel edges_less_eq
[PROOF STEP]
unfolding edges_less_eq_def is_linorder_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. fst (snd x) \<le> fst (snd y) \<or> fst (snd y) \<le> fst (snd x)) \<and> (\<forall>x y z. fst (snd x) \<le> fst (snd y) \<longrightarrow> fst (snd y) \<le> fst (snd z) \<longrightarrow> fst (snd x) \<le> fst (snd z))
[PROOF STEP]
by (metis linear order_trans)


[STATEMENT]
lemma unity_root_cong:
  assumes "[m = n] (mod int k)"
  shows   "unity_root k m = unity_root k n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root k m = unity_root k n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unity_root k m = unity_root k n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
[m = n] (mod int k)
[PROOF STEP]
have "m mod int k = n mod int k"
[PROOF STATE]
proof (prove)
using this:
[m = n] (mod int k)

goal (1 subgoal):
 1. m mod int k = n mod int k
[PROOF STEP]
by (auto simp: cong_def)
[PROOF STATE]
proof (state)
this:
m mod int k = n mod int k

goal (1 subgoal):
 1. unity_root k m = unity_root k n
[PROOF STEP]
hence "unity_root k (m mod int k) = unity_root k (n mod int k)"
[PROOF STATE]
proof (prove)
using this:
m mod int k = n mod int k

goal (1 subgoal):
 1. unity_root k (m mod int k) = unity_root k (n mod int k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unity_root k (m mod int k) = unity_root k (n mod int k)

goal (1 subgoal):
 1. unity_root k m = unity_root k n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
unity_root k (m mod int k) = unity_root k (n mod int k)

goal (1 subgoal):
 1. unity_root k m = unity_root k n
[PROOF STEP]
by (simp add: unity_root_mod)
[PROOF STATE]
proof (state)
this:
unity_root k m = unity_root k n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_rows_le_dim_columns:
  fixes A :: "real^'n^'m"
  shows "dim(rows A) \<le> dim(columns A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (rows A) \<le> dim (columns A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim (rows A) \<le> dim (columns A)
[PROOF STEP]
have "dim (span (rows A)) \<le> dim (span (columns A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
obtain B where "independent B" "span(rows A) \<subseteq> span B"
              and B: "B \<subseteq> span(rows A)""card B = dim (span(rows A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>independent B; span (rows A) \<subseteq> span B; B \<subseteq> span (rows A); card B = dim (span (rows A))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using basis_exists [of "span(rows A)"]
[PROOF STATE]
proof (prove)
using this:
(\<And>B. \<lbrakk>B \<subseteq> span (rows A); independent B; span (rows A) \<subseteq> span B; card B = dim (span (rows A))\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>independent B; span (rows A) \<subseteq> span B; B \<subseteq> span (rows A); card B = dim (span (rows A))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
independent B
span (rows A) \<subseteq> span B
B \<subseteq> span (rows A)
card B = dim (span (rows A))

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
with span_subspace
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?A \<subseteq> ?B; ?B \<subseteq> span ?A; subspace ?B\<rbrakk> \<Longrightarrow> span ?A = ?B
independent B
span (rows A) \<subseteq> span B
B \<subseteq> span (rows A)
card B = dim (span (rows A))
[PROOF STEP]
have eq: "span B = span(rows A)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<subseteq> ?B; ?B \<subseteq> span ?A; subspace ?B\<rbrakk> \<Longrightarrow> span ?A = ?B
independent B
span (rows A) \<subseteq> span B
B \<subseteq> span (rows A)
card B = dim (span (rows A))

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

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
span B = span (rows A)
[PROOF STEP]
have inj: "inj_on ((*v) A) (span B)"
[PROOF STATE]
proof (prove)
using this:
span B = span (rows A)

goal (1 subgoal):
 1. inj_on ((*v) A) (span B)
[PROOF STEP]
by (simp add: inj_on_def matrix_vector_mul_injective_on_rowspace)
[PROOF STATE]
proof (state)
this:
inj_on ((*v) A) (span B)

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on ((*v) A) (span B)
[PROOF STEP]
have ind: "independent ((*v) A ` B)"
[PROOF STATE]
proof (prove)
using this:
inj_on ((*v) A) (span B)

goal (1 subgoal):
 1. independent ((*v) A ` B)
[PROOF STEP]
by (rule linear_independent_injective_image [OF Finite_Cartesian_Product.matrix_vector_mul_linear \<open>independent B\<close>])
[PROOF STATE]
proof (state)
this:
independent ((*v) A ` B)

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
have "dim (span (rows A)) \<le> card ((*v) A ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (span (rows A)) \<le> card ((*v) A ` B)
[PROOF STEP]
unfolding B(2)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card B \<le> card ((*v) A ` B)
[PROOF STEP]
using inj
[PROOF STATE]
proof (prove)
using this:
inj_on ((*v) A) (span B)

goal (1 subgoal):
 1. card B \<le> card ((*v) A ` B)
[PROOF STEP]
by (auto simp: card_image inj_on_subset span_superset)
[PROOF STATE]
proof (state)
this:
dim (span (rows A)) \<le> card ((*v) A ` B)

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dim (span (rows A)) \<le> card ((*v) A ` B)

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
have "\<dots> \<le> dim (span (columns A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((*v) A ` B) \<le> dim (span (columns A))
[PROOF STEP]
using _ ind
[PROOF STATE]
proof (prove)
using this:
PROP ?psi \<Longrightarrow> PROP ?psi
independent ((*v) A ` B)

goal (1 subgoal):
 1. card ((*v) A ` B) \<le> dim (span (columns A))
[PROOF STEP]
by (rule independent_card_le_dim) (auto intro!: matrix_vector_mult_in_columnspace)
[PROOF STATE]
proof (state)
this:
card ((*v) A ` B) \<le> dim (span (columns A))

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim (span (rows A)) \<le> dim (span (columns A))

goal (1 subgoal):
 1. dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dim (span (rows A)) \<le> dim (span (columns A))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dim (span (rows A)) \<le> dim (span (columns A))

goal (1 subgoal):
 1. dim (rows A) \<le> dim (columns A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dim (span (rows A)) \<le> dim (span (columns A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim (span (rows A)) \<le> dim (span (columns A))

goal (1 subgoal):
 1. dim (rows A) \<le> dim (columns A)
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
dim (rows A) \<le> dim (columns A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma select_append:
  assumes "\<forall>y\<in>set ys. \<forall>z\<in>set zs. y \<le> z"
  shows   "k < length ys \<Longrightarrow> select k (ys @ zs) = select k ys"
    and   "k \<in> {length ys..<length ys + length zs} \<Longrightarrow>
             select k (ys @ zs) = select (k - length ys) zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k < length ys \<Longrightarrow> select k (ys @ zs) = select k ys) &&& (k \<in> {length ys..<length ys + length zs} \<Longrightarrow> select k (ys @ zs) = select (k - length ys) zs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>set ys. \<forall>z\<in>set zs. y \<le> z

goal (1 subgoal):
 1. (k < length ys \<Longrightarrow> select k (ys @ zs) = select k ys) &&& (k \<in> {length ys..<length ys + length zs} \<Longrightarrow> select k (ys @ zs) = select (k - length ys) zs)
[PROOF STEP]
by (simp_all add: select_def sort_append nth_append)


[STATEMENT]
lemma approx_loc_conv_all_nth:
  "approx_loc G hp loc LT =
  (length loc = length LT \<and> (\<forall>n < length loc. approx_val G hp (loc!n) (LT!n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. approx_loc G hp loc LT = (length loc = length LT \<and> (\<forall>n<length loc. approx_val G hp (loc ! n) (LT ! n)))
[PROOF STEP]
by (simp add: approx_loc_def list_all2_conv_all_nth)