[STATEMENT]
lemma primitive_root_unityD: assumes "primitive_root_unity k x"
  shows "k \<noteq> 0" "x^k = 1" "k' \<noteq> 0 \<Longrightarrow> x^k' = 1 \<Longrightarrow> k \<le> k'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<noteq> 0 &&& x ^ k = (1::'a) &&& (\<lbrakk>k' \<noteq> 0; x ^ k' = (1::'a)\<rbrakk> \<Longrightarrow> k \<le> k')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. k \<noteq> 0
 2. x ^ k = (1::'a)
 3. \<lbrakk>k' \<noteq> 0; x ^ k' = (1::'a)\<rbrakk> \<Longrightarrow> k \<le> k'
[PROOF STEP]
note * = assms[unfolded primitive_root_unity_def]
[PROOF STATE]
proof (state)
this:
k \<noteq> 0 \<and> x ^ k = (1::'a) \<and> (\<forall>k'<k. k' \<noteq> 0 \<longrightarrow> x ^ k' \<noteq> (1::'a))

goal (3 subgoals):
 1. k \<noteq> 0
 2. x ^ k = (1::'a)
 3. \<lbrakk>k' \<noteq> 0; x ^ k' = (1::'a)\<rbrakk> \<Longrightarrow> k \<le> k'
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 0 \<and> x ^ k = (1::'a) \<and> (\<forall>k'<k. k' \<noteq> 0 \<longrightarrow> x ^ k' \<noteq> (1::'a))
[PROOF STEP]
have **: "k' < k \<Longrightarrow> k' \<noteq> 0 \<Longrightarrow> x ^ k' \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0 \<and> x ^ k = (1::'a) \<and> (\<forall>k'<k. k' \<noteq> 0 \<longrightarrow> x ^ k' \<noteq> (1::'a))

goal (1 subgoal):
 1. \<lbrakk>k' < k; k' \<noteq> 0\<rbrakk> \<Longrightarrow> x ^ k' \<noteq> (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>k' < k; k' \<noteq> 0\<rbrakk> \<Longrightarrow> x ^ k' \<noteq> (1::'a)

goal (3 subgoals):
 1. k \<noteq> 0
 2. x ^ k = (1::'a)
 3. \<lbrakk>k' \<noteq> 0; x ^ k' = (1::'a)\<rbrakk> \<Longrightarrow> k \<le> k'
[PROOF STEP]
show "k \<noteq> 0" "x^k = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<noteq> 0 &&& x ^ k = (1::'a)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0 \<and> x ^ k = (1::'a) \<and> (\<forall>k'<k. k' \<noteq> 0 \<longrightarrow> x ^ k' \<noteq> (1::'a))

goal (1 subgoal):
 1. k \<noteq> 0 &&& x ^ k = (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<noteq> 0
x ^ k = (1::'a)

goal (1 subgoal):
 1. \<lbrakk>k' \<noteq> 0; x ^ k' = (1::'a)\<rbrakk> \<Longrightarrow> k \<le> k'
[PROOF STEP]
show "k' \<noteq> 0 \<Longrightarrow> x^k' = 1 \<Longrightarrow> k \<le> k'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k' \<noteq> 0; x ^ k' = (1::'a)\<rbrakk> \<Longrightarrow> k \<le> k'
[PROOF STEP]
using **
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>k' < k; k' \<noteq> 0\<rbrakk> \<Longrightarrow> x ^ k' \<noteq> (1::'a)

goal (1 subgoal):
 1. \<lbrakk>k' \<noteq> 0; x ^ k' = (1::'a)\<rbrakk> \<Longrightarrow> k \<le> k'
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<lbrakk>k' \<noteq> 0; x ^ k' = (1::'a)\<rbrakk> \<Longrightarrow> k \<le> k'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_pairs_filter_subset: "A \<subseteq> B \<Longrightarrow> {p . p \<in> A \<times> A \<and> P p} \<subseteq> {p. p \<in> B \<times> B \<and> P p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B \<Longrightarrow> {p \<in> A \<times> A. P p} \<subseteq> {p \<in> B \<times> B. P p}
[PROOF STEP]
by (intro subsetI) blast


[STATEMENT]
lemma swap_col_to_front_det: "A \<in> carrier_mat n n \<Longrightarrow> I < n \<Longrightarrow> det (swap_col_to_front A I)
  = (-1)^I * det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A
[PROOF STEP]
proof (induct I arbitrary: A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
 2. \<And>I A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A; A \<in> carrier_mat n n; Suc I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
case (Suc I A)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front ?A I) = (- (1::'a)) ^ I * det ?A
A \<in> carrier_mat n n
Suc I < n

goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
 2. \<And>I A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A; A \<in> carrier_mat n n; Suc I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
from Suc(3)
[PROOF STATE]
proof (chain)
picking this:
Suc I < n
[PROOF STEP]
have I: "I < n"
[PROOF STATE]
proof (prove)
using this:
Suc I < n

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

goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
 2. \<And>I A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A; A \<in> carrier_mat n n; Suc I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
let ?I = "Suc I"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
 2. \<And>I A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A; A \<in> carrier_mat n n; Suc I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
let ?A = "swapcols I ?I A"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
 2. \<And>I A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A; A \<in> carrier_mat n n; Suc I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
have AA: "?A \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swapcols I (Suc I) A \<in> carrier_mat n n
[PROOF STEP]
using Suc(2)
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

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

goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
 2. \<And>I A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A; A \<in> carrier_mat n n; Suc I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
have "det (swap_col_to_front A (Suc I)) = det (swap_col_to_front ?A I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (swap_col_to_front A (Suc I)) = det (swap_col_to_front (swapcols I (Suc I) A) I)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (swap_col_to_front A (Suc I)) = det (swap_col_to_front (swapcols I (Suc I) A) I)

goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
 2. \<And>I A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A; A \<in> carrier_mat n n; Suc I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (swap_col_to_front A (Suc I)) = det (swap_col_to_front (swapcols I (Suc I) A) I)

goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
 2. \<And>I A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A; A \<in> carrier_mat n n; Suc I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
have "\<dots> = (-1)^I * det ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (swap_col_to_front (swapcols I (Suc I) A) I) = (- (1::'a)) ^ I * det (swapcols I (Suc I) A)
[PROOF STEP]
by (rule Suc(1)[OF AA I])
[PROOF STATE]
proof (state)
this:
det (swap_col_to_front (swapcols I (Suc I) A) I) = (- (1::'a)) ^ I * det (swapcols I (Suc I) A)

goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
 2. \<And>I A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A; A \<in> carrier_mat n n; Suc I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (swap_col_to_front (swapcols I (Suc I) A) I) = (- (1::'a)) ^ I * det (swapcols I (Suc I) A)

goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
 2. \<And>I A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A; A \<in> carrier_mat n n; Suc I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
have "det ?A = -1 * det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (swapcols I (Suc I) A) = - (1::'a) * det A
[PROOF STEP]
using det_swapcols[OF I Suc(3) _ Suc(2)]
[PROOF STATE]
proof (prove)
using this:
I \<noteq> Suc I \<Longrightarrow> det (swapcols I (Suc I) A) = - det A

goal (1 subgoal):
 1. det (swapcols I (Suc I) A) = - (1::'a) * det A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (swapcols I (Suc I) A) = - (1::'a) * det A

goal (2 subgoals):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
 2. \<And>I A. \<lbrakk>\<And>A. \<lbrakk>A \<in> carrier_mat n n; I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A I) = (- (1::'a)) ^ I * det A; A \<in> carrier_mat n n; Suc I < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ I * (- (1::'a) * det A)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ I * (- (1::'a) * det A)

goal (1 subgoal):
 1. det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (swap_col_to_front A (Suc I)) = (- (1::'a)) ^ Suc I * det A

goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<in> carrier_mat n n; 0 < n\<rbrakk> \<Longrightarrow> det (swap_col_to_front A 0) = (- (1::'a)) ^ 0 * det A
[PROOF STEP]
qed simp


[STATEMENT]
theorem Least_equality' [backward1]:
  "P (x::('a::order)) \<Longrightarrow> \<forall>y. P y \<longrightarrow> x \<le> y \<Longrightarrow> Least P = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P x; \<forall>y. P y \<longrightarrow> x \<le> y\<rbrakk> \<Longrightarrow> Least P = x
[PROOF STEP]
by (simp add: Least_equality)


[STATEMENT]
lemma hcomplex_hcnj_mult: "\<And>w z. hcnj (w * z) = hcnj w * hcnj z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w z. hcnj (w * z) = hcnj w * hcnj z
[PROOF STEP]
by transfer (rule complex_cnj_mult)


[STATEMENT]
lemma bounded_inner_imp_bdd_above:
  assumes "bounded s"
    shows "bdd_above ((\<lambda>x. x \<bullet> a) ` s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above ((\<lambda>x. x \<bullet> a) ` s)
[PROOF STEP]
by (simp add: assms bounded_imp_bdd_above bounded_linear_image bounded_linear_inner_left)


[STATEMENT]
lemma equivalence:
  assumes gr:"graph G" and m:"maintainedA {reflexivity_rule I,transitive_rule I,symmetry_rule I} G"
  shows "equiv (vertices G) (getRel I G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv (vertices G) (getRel I G)
[PROOF STEP]
proof(rule equivI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. refl_on (vertices G) (getRel I G)
 2. sym (getRel I G)
 3. trans (getRel I G)
[PROOF STEP]
show "refl_on (vertices G) (getRel I G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl_on (vertices G) (getRel I G)
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
maintainedA {reflexivity_rule I, transitive_rule I, symmetry_rule I} G

goal (1 subgoal):
 1. refl_on (vertices G) (getRel I G)
[PROOF STEP]
by(intro reflexivity_rule[OF gr],auto)
[PROOF STATE]
proof (state)
this:
refl_on (vertices G) (getRel I G)

goal (2 subgoals):
 1. sym (getRel I G)
 2. trans (getRel I G)
[PROOF STEP]
show "sym (getRel I G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym (getRel I G)
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
maintainedA {reflexivity_rule I, transitive_rule I, symmetry_rule I} G

goal (1 subgoal):
 1. sym (getRel I G)
[PROOF STEP]
by(intro symmetry_rule[OF gr],auto)
[PROOF STATE]
proof (state)
this:
sym (getRel I G)

goal (1 subgoal):
 1. trans (getRel I G)
[PROOF STEP]
show "trans (getRel I G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (getRel I G)
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
maintainedA {reflexivity_rule I, transitive_rule I, symmetry_rule I} G

goal (1 subgoal):
 1. trans (getRel I G)
[PROOF STEP]
by(intro transitive_rule[OF gr],auto)
[PROOF STATE]
proof (state)
this:
trans (getRel I G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma primepowI:
  "prime p \<Longrightarrow> k > 0 \<Longrightarrow> p ^ k = n \<Longrightarrow> primepow n \<and> aprimedivisor n = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; 0 < k; p ^ k = n\<rbrakk> \<Longrightarrow> primepow n \<and> aprimedivisor n = p
[PROOF STEP]
unfolding primepow_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; 0 < k; p ^ k = n\<rbrakk> \<Longrightarrow> (\<exists>p k. prime p \<and> 0 < k \<and> n = p ^ k) \<and> aprimedivisor n = p
[PROOF STEP]
by (auto simp: aprimedivisor_prime_power)


[STATEMENT]
lemma scale_eq_0_iff [simp]: "scale a x = 0 \<longleftrightarrow> a = 0 \<or> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *s x = (0::'b)) = (a = (0::'a) \<or> x = (0::'b))
[PROOF STEP]
by (metis scale_left_commute right_inverse scale_one scale_scale scale_zero_left)


[STATEMENT]
lemma split_list_last_prop_iff:
  "(\<exists>x \<in> set xs. P x) \<longleftrightarrow>
   (\<exists>ys x zs. xs = ys@x#zs \<and> P x \<and> (\<forall>z \<in> set zs. \<not> P z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x\<in>set xs. P x) = (\<exists>ys x zs. xs = ys @ x # zs \<and> P x \<and> (\<forall>z\<in>set zs. \<not> P z))
[PROOF STEP]
by rule (erule split_list_last_prop, auto)


[STATEMENT]
lemma Lcm_fin_dvd_iff:
  "Lcm\<^sub>f\<^sub>i\<^sub>n A dvd b  \<longleftrightarrow> (\<forall>a\<in>A. a dvd b)" if "finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Lcm\<^sub>f\<^sub>i\<^sub>n A dvd b) = (\<forall>a\<in>A. a dvd b)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. (Lcm\<^sub>f\<^sub>i\<^sub>n A dvd b) = (\<forall>a\<in>A. a dvd b)
[PROOF STEP]
by (auto intro: Lcm_fin_least dvd_Lcm_fin dvd_trans [of _ "Lcm\<^sub>f\<^sub>i\<^sub>n A" b])


[STATEMENT]
lemma word_rsplit_0:
  "word_rsplit (0 :: machine_word) = replicate (word_bits div 8) (0 :: 8 word)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_rsplit 0 = replicate (word_bits div 8) 0
[PROOF STEP]
by (simp add: word_rsplit_def bin_rsplit_def word_bits_def word_size_def Cons_replicate_eq)


[STATEMENT]
lemma het_gt_0I: assumes a: "a \<in> set xs" and b: "b \<in> set xs" and neq: "a \<noteq> b"
  shows "het xs > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < het xs
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < het xs \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> 0 < het xs

goal (1 subgoal):
 1. \<not> 0 < het xs \<Longrightarrow> False
[PROOF STEP]
hence "het xs = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < het xs

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

goal (1 subgoal):
 1. \<not> 0 < het xs \<Longrightarrow> False
[PROOF STEP]
from this[unfolded het_def]
[PROOF STATE]
proof (chain)
picking this:
length (list_neq xs (mean xs)) = 0
[PROOF STEP]
have "list_neq xs (mean xs) = []"
[PROOF STATE]
proof (prove)
using this:
length (list_neq xs (mean xs)) = 0

goal (1 subgoal):
 1. list_neq xs (mean xs) = []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
list_neq xs (mean xs) = []

goal (1 subgoal):
 1. \<not> 0 < het xs \<Longrightarrow> False
[PROOF STEP]
from arg_cong[OF this, of set]
[PROOF STATE]
proof (chain)
picking this:
set (list_neq xs (mean xs)) = set []
[PROOF STEP]
have mean: "\<And> x. x \<in> set xs \<Longrightarrow> x = mean xs"
[PROOF STATE]
proof (prove)
using this:
set (list_neq xs (mean xs)) = set []

goal (1 subgoal):
 1. \<And>x. x \<in> set xs \<Longrightarrow> x = mean xs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> set xs \<Longrightarrow> ?x = mean xs

goal (1 subgoal):
 1. \<not> 0 < het xs \<Longrightarrow> False
[PROOF STEP]
from mean[OF a] mean[OF b] neq
[PROOF STATE]
proof (chain)
picking this:
a = mean xs
b = mean xs
a \<noteq> b
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
a = mean xs
b = mean xs
a \<noteq> b

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invfun_inj:"\<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B\<rbrakk>
                      \<Longrightarrow>  inj_on (invfun A B f) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B\<rbrakk> \<Longrightarrow> inj_on (f\<inverse>\<^bsub>B,A\<^esub>) B
[PROOF STEP]
apply (simp add:inj_on_def [of "invfun A B f" "B"] )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B\<rbrakk> \<Longrightarrow> \<forall>x\<in>B. \<forall>y\<in>B. (f\<inverse>\<^bsub>B,A\<^esub>) x = (f\<inverse>\<^bsub>B,A\<^esub>) y \<longrightarrow> x = y
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B; x \<in> B; y \<in> B; (f\<inverse>\<^bsub>B,A\<^esub>) x = (f\<inverse>\<^bsub>B,A\<^esub>) y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (frule_tac b = y in invfun_r [of "f" "A" "B"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B; x \<in> B; y \<in> B; (f\<inverse>\<^bsub>B,A\<^esub>) x = (f\<inverse>\<^bsub>B,A\<^esub>) y; f ((f\<inverse>\<^bsub>B,A\<^esub>) y) = y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (frule_tac b = x in invfun_r [of "f" "A" "B"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; surj_to f A B; x \<in> B; y \<in> B; (f\<inverse>\<^bsub>B,A\<^esub>) x = (f\<inverse>\<^bsub>B,A\<^esub>) y; f ((f\<inverse>\<^bsub>B,A\<^esub>) y) = y; f ((f\<inverse>\<^bsub>B,A\<^esub>) x) = x\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma beukers_integral3_le: "beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)
[PROOF STEP]
have "beukers_integral3 = enn2real beukers_nn_integral3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.beukers_integral3 = enn2real local.beukers_nn_integral3
[PROOF STEP]
by (rule beukers_integral3_conv_nn_integral)
[PROOF STATE]
proof (state)
this:
local.beukers_integral3 = enn2real local.beukers_nn_integral3

goal (1 subgoal):
 1. local.beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.beukers_integral3 = enn2real local.beukers_nn_integral3

goal (1 subgoal):
 1. local.beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)
[PROOF STEP]
have "\<dots> \<le> enn2real (ennreal (2 * (1 / 27) ^ n * Re (zeta 3)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real local.beukers_nn_integral3 \<le> enn2real (ennreal (2 * (1 / 27) ^ n * Re (zeta 3)))
[PROOF STEP]
by (intro enn2real_mono beukers_nn_integral3_le) auto
[PROOF STATE]
proof (state)
this:
enn2real local.beukers_nn_integral3 \<le> enn2real (ennreal (2 * (1 / 27) ^ n * Re (zeta 3)))

goal (1 subgoal):
 1. local.beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
enn2real local.beukers_nn_integral3 \<le> enn2real (ennreal (2 * (1 / 27) ^ n * Re (zeta 3)))

goal (1 subgoal):
 1. local.beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)
[PROOF STEP]
have "\<dots> = 2 * (1 / 27) ^ n * Re (zeta 3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (ennreal (2 * (1 / 27) ^ n * Re (zeta 3))) = 2 * (1 / 27) ^ n * Re (zeta 3)
[PROOF STEP]
using Re_zeta_ge_1[of 3]
[PROOF STATE]
proof (prove)
using this:
1 < 3 \<Longrightarrow> 1 \<le> Re (zeta (complex_of_real 3))

goal (1 subgoal):
 1. enn2real (ennreal (2 * (1 / 27) ^ n * Re (zeta 3))) = 2 * (1 / 27) ^ n * Re (zeta 3)
[PROOF STEP]
by (intro enn2real_ennreal mult_nonneg_nonneg) auto
[PROOF STATE]
proof (state)
this:
enn2real (ennreal (2 * (1 / 27) ^ n * Re (zeta 3))) = 2 * (1 / 27) ^ n * Re (zeta 3)

goal (1 subgoal):
 1. local.beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)

goal (1 subgoal):
 1. local.beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.beukers_integral3 \<le> 2 * (1 / 27) ^ n * Re (zeta 3)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closure_open_segment [simp]:
  "closure (open_segment a b) = (if a = b then {} else closed_segment a b)"
    for a :: "'a::euclidean_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (open_segment a b) = (if a = b then {} else closed_segment a b)
[PROOF STEP]
proof (cases "a = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = b \<Longrightarrow> closure (open_segment a b) = (if a = b then {} else closed_segment a b)
 2. a \<noteq> b \<Longrightarrow> closure (open_segment a b) = (if a = b then {} else closed_segment a b)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = b

goal (2 subgoals):
 1. a = b \<Longrightarrow> closure (open_segment a b) = (if a = b then {} else closed_segment a b)
 2. a \<noteq> b \<Longrightarrow> closure (open_segment a b) = (if a = b then {} else closed_segment a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = b

goal (1 subgoal):
 1. closure (open_segment a b) = (if a = b then {} else closed_segment a b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
closure (open_segment a b) = (if a = b then {} else closed_segment a b)

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> closure (open_segment a b) = (if a = b then {} else closed_segment a b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> closure (open_segment a b) = (if a = b then {} else closed_segment a b)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> closure (open_segment a b) = (if a = b then {} else closed_segment a b)
[PROOF STEP]
have "closure ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1}) = (\<lambda>u. u *\<^sub>R (b - a)) ` closure {0<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1}) = (\<lambda>u. u *\<^sub>R (b - a)) ` closure {0<..<1}
[PROOF STEP]
apply (rule closure_injective_linear_image [symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. linear (\<lambda>u. u *\<^sub>R (b - a))
 2. inj (\<lambda>u. u *\<^sub>R (b - a))
[PROOF STEP]
apply (use False in \<open>auto intro!: injI\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
closure ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1}) = (\<lambda>u. u *\<^sub>R (b - a)) ` closure {0<..<1}

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> closure (open_segment a b) = (if a = b then {} else closed_segment a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closure ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1}) = (\<lambda>u. u *\<^sub>R (b - a)) ` closure {0<..<1}
[PROOF STEP]
have "closure
     ((\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1}) =
    (\<lambda>x. (1 - x) *\<^sub>R a + x *\<^sub>R b) ` closure {0<..<1}"
[PROOF STATE]
proof (prove)
using this:
closure ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1}) = (\<lambda>u. u *\<^sub>R (b - a)) ` closure {0<..<1}

goal (1 subgoal):
 1. closure ((\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1}) = (\<lambda>x. (1 - x) *\<^sub>R a + x *\<^sub>R b) ` closure {0<..<1}
[PROOF STEP]
using closure_translation [of a "((\<lambda>x. x *\<^sub>R b - x *\<^sub>R a) ` {0<..<1})"]
[PROOF STATE]
proof (prove)
using this:
closure ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1}) = (\<lambda>u. u *\<^sub>R (b - a)) ` closure {0<..<1}
closure ((+) a ` (\<lambda>x. x *\<^sub>R b - x *\<^sub>R a) ` {0<..<1}) = (+) a ` closure ((\<lambda>x. x *\<^sub>R b - x *\<^sub>R a) ` {0<..<1})

goal (1 subgoal):
 1. closure ((\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1}) = (\<lambda>x. (1 - x) *\<^sub>R a + x *\<^sub>R b) ` closure {0<..<1}
[PROOF STEP]
by (simp add: segment_eq_compose field_simps scaleR_diff_left scaleR_diff_right image_image)
[PROOF STATE]
proof (state)
this:
closure ((\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1}) = (\<lambda>x. (1 - x) *\<^sub>R a + x *\<^sub>R b) ` closure {0<..<1}

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> closure (open_segment a b) = (if a = b then {} else closed_segment a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closure ((\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1}) = (\<lambda>x. (1 - x) *\<^sub>R a + x *\<^sub>R b) ` closure {0<..<1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closure ((\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1}) = (\<lambda>x. (1 - x) *\<^sub>R a + x *\<^sub>R b) ` closure {0<..<1}

goal (1 subgoal):
 1. closure (open_segment a b) = (if a = b then {} else closed_segment a b)
[PROOF STEP]
by (simp add: segment_image_interval closure_greaterThanLessThan [symmetric] del: closure_greaterThanLessThan)
[PROOF STATE]
proof (state)
this:
closure (open_segment a b) = (if a = b then {} else closed_segment a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abstr_id3:
  "clock_numbering v \<Longrightarrow> abstr cc M v (v c1) (v c2) = M (v c1) (v c2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>c. 0 < v c \<Longrightarrow> abstr cc M v (v c1) (v c2) = M (v c1) (v c2)
[PROOF STEP]
proof goal_cases
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>c. 0 < v c \<Longrightarrow> abstr cc M v (v c1) (v c2) = M (v c1) (v c2)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
\<forall>c. 0 < v c

goal (1 subgoal):
 1. \<forall>c. 0 < v c \<Longrightarrow> abstr cc M v (v c1) (v c2) = M (v c1) (v c2)
[PROOF STEP]
have "\<And>c. v c = 0 \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c. v c = 0 \<Longrightarrow> False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. v c = 0 \<Longrightarrow> False
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. v c = 0 \<Longrightarrow> False
[PROOF STEP]
assume "v c = 0"
[PROOF STATE]
proof (state)
this:
v c = 0

goal (1 subgoal):
 1. \<And>c. v c = 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v c = 0

goal (1 subgoal):
 1. \<And>c. v c = 0 \<Longrightarrow> False
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
\<forall>c. 0 < v c
[PROOF STEP]
have "v c > 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>c. 0 < v c

goal (1 subgoal):
 1. 0 < v c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < v c

goal (1 subgoal):
 1. \<And>c. v c = 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v c = 0
0 < v c
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
v c = 0
0 < v c

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v ?c = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. \<forall>c. 0 < v c \<Longrightarrow> abstr cc M v (v c1) (v c2) = M (v c1) (v c2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v ?c = 0 \<Longrightarrow> False
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
v ?c = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. abstr cc M v (v c1) (v c2) = M (v c1) (v c2)
[PROOF STEP]
by ((induction cc), auto, fastforce)
[PROOF STATE]
proof (state)
this:
abstr cc M v (v c1) (v c2) = M (v c1) (v c2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjugate_char_2:
  "conjugate f g \<longleftrightarrow> f bot = bot \<and> g bot = bot \<and> (\<forall>x y . f x \<sqinter> y \<le> f(x \<sqinter> g y) \<and> g y \<sqinter> x \<le> g(y \<sqinter> f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate f g = (f bot = bot \<and> g bot = bot \<and> (\<forall>x y. f x \<sqinter> y \<le> f (x \<sqinter> g y) \<and> g y \<sqinter> x \<le> g (y \<sqinter> f x)))
[PROOF STEP]
by (simp add: conjugate_char_2_pp)


[STATEMENT]
lemma ninv_hom:"\<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}\<rbrakk> \<Longrightarrow>
                        ninv n f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}\<rbrakk> \<Longrightarrow> ninv n f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}
[PROOF STEP]
apply (rule Pi_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}; x \<in> {i. i \<le> n}\<rbrakk> \<Longrightarrow> ninv n f x \<in> {i. i \<le> n}
[PROOF STEP]
apply (simp add:ninv_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}; x \<le> n\<rbrakk> \<Longrightarrow> (SOME xa. xa \<le> n \<and> x = f xa) \<le> n
[PROOF STEP]
apply (frule inj_surj[of f n], assumption+,
       frule_tac x = x in funcset_mem[of f "{i. i \<le> n}" "{i. i \<le> n}"],
       simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}; x \<le> n; f ` {i. i \<le> n} = {i. i \<le> n}; f x \<in> {i. i \<le> n}\<rbrakk> \<Longrightarrow> (SOME xa. xa \<le> n \<and> x = f xa) \<le> n
[PROOF STEP]
apply (frule sym, thin_tac "f ` {i. i \<le> n} = {i. i \<le> n}",
       cut_tac a = x and A = "{i. i \<le> n}" and B = "f ` {i. i \<le> n}" in
       eq_set_inc, simp, assumption,
       thin_tac "f x \<in> {i. i \<le> n}", thin_tac "{i. i \<le> n} = f ` {i. i \<le> n}",
       simp add:image_def, rule someI2_ex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}; x \<le> n; \<exists>xa\<le>n. x = f xa\<rbrakk> \<Longrightarrow> \<exists>a\<le>n. x = f a
 2. \<And>x xa. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}; x \<le> n; \<exists>xa\<le>n. x = f xa; xa \<le> n \<and> x = f xa\<rbrakk> \<Longrightarrow> xa \<le> n
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma match_concat :
  fixes   bss :: "'b list list"
  defines eq_len: "eq_len \<equiv> \<lambda>xs ys. length xs = length ys"
  shows   "\<forall>as::'a list. length as = length (concat bss)
                \<longrightarrow> (\<exists>css::'a list list. as = concat css \<and> list_all2 eq_len css bss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>as. length as = length (concat bss) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css bss)
[PROOF STEP]
proof (induct bss)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>as. length as = length (concat []) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css [])
 2. \<And>a bss. \<forall>as. length as = length (concat bss) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css bss) \<Longrightarrow> \<forall>as. length as = length (concat (a # bss)) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css (a # bss))
[PROOF STEP]
from eq_len
[PROOF STATE]
proof (chain)
picking this:
eq_len \<equiv> \<lambda>xs ys. length xs = length ys
[PROOF STEP]
show "\<forall>as. length as = length (concat [])
                \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css [])"
[PROOF STATE]
proof (prove)
using this:
eq_len \<equiv> \<lambda>xs ys. length xs = length ys

goal (1 subgoal):
 1. \<forall>as. length as = length (concat []) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css [])
[PROOF STEP]
by   simp
[PROOF STATE]
proof (state)
this:
\<forall>as. length as = length (concat []) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css [])

goal (1 subgoal):
 1. \<And>a bss. \<forall>as. length as = length (concat bss) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css bss) \<Longrightarrow> \<forall>as. length as = length (concat (a # bss)) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css (a # bss))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a bss. \<forall>as. length as = length (concat bss) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css bss) \<Longrightarrow> \<forall>as. length as = length (concat (a # bss)) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css (a # bss))
[PROOF STEP]
fix fs :: "'b list" and fss :: "'b list list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a bss. \<forall>as. length as = length (concat bss) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css bss) \<Longrightarrow> \<forall>as. length as = length (concat (a # bss)) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css (a # bss))
[PROOF STEP]
assume prevcase: "\<forall>as. length as = length (concat fss)
                         \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css fss)"
[PROOF STATE]
proof (state)
this:
\<forall>as. length as = length (concat fss) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css fss)

goal (1 subgoal):
 1. \<And>a bss. \<forall>as. length as = length (concat bss) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css bss) \<Longrightarrow> \<forall>as. length as = length (concat (a # bss)) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css (a # bss))
[PROOF STEP]
have "\<And>as. length as = length (concat (fs # fss))
             \<Longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css (fs # fss))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>as. length as = length (concat (fs # fss)) \<Longrightarrow> \<exists>css. as = concat css \<and> list_all2 eq_len css (fs # fss)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>as. length as = length (concat (fs # fss)) \<Longrightarrow> as = concat (?css as) \<and> list_all2 eq_len (?css as) (fs # fss)
[PROOF STEP]
fix as :: "'a list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>as. length as = length (concat (fs # fss)) \<Longrightarrow> as = concat (?css as) \<and> list_all2 eq_len (?css as) (fs # fss)
[PROOF STEP]
assume as: "length as = length (concat (fs#fss))"
[PROOF STATE]
proof (state)
this:
length as = length (concat (fs # fss))

goal (1 subgoal):
 1. \<And>as. length as = length (concat (fs # fss)) \<Longrightarrow> as = concat (?css as) \<and> list_all2 eq_len (?css as) (fs # fss)
[PROOF STEP]
define xs ys where "xs = take (length fs) as" and "ys = drop (length fs) as"
[PROOF STATE]
proof (state)
this:
xs = take (length fs) as
ys = drop (length fs) as

goal (1 subgoal):
 1. \<And>as. length as = length (concat (fs # fss)) \<Longrightarrow> as = concat (?css as) \<and> list_all2 eq_len (?css as) (fs # fss)
[PROOF STEP]
define gss where "gss = (SOME css. ys = concat css \<and> list_all2 eq_len css fss)"
[PROOF STATE]
proof (state)
this:
gss = (SOME css. ys = concat css \<and> list_all2 eq_len css fss)

goal (1 subgoal):
 1. \<And>as. length as = length (concat (fs # fss)) \<Longrightarrow> as = concat (?css as) \<and> list_all2 eq_len (?css as) (fs # fss)
[PROOF STEP]
define hss where "hss = xs # gss"
[PROOF STATE]
proof (state)
this:
hss = xs # gss

goal (1 subgoal):
 1. \<And>as. length as = length (concat (fs # fss)) \<Longrightarrow> as = concat (?css as) \<and> list_all2 eq_len (?css as) (fs # fss)
[PROOF STEP]
with xs_def ys_def as gss_def eq_len prevcase
[PROOF STATE]
proof (chain)
picking this:
xs = take (length fs) as
ys = drop (length fs) as
length as = length (concat (fs # fss))
gss = (SOME css. ys = concat css \<and> list_all2 eq_len css fss)
eq_len \<equiv> \<lambda>xs ys. length xs = length ys
\<forall>as. length as = length (concat fss) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css fss)
hss = xs # gss
[PROOF STEP]
show "as = concat hss \<and> list_all2 eq_len hss (fs#fss)"
[PROOF STATE]
proof (prove)
using this:
xs = take (length fs) as
ys = drop (length fs) as
length as = length (concat (fs # fss))
gss = (SOME css. ys = concat css \<and> list_all2 eq_len css fss)
eq_len \<equiv> \<lambda>xs ys. length xs = length ys
\<forall>as. length as = length (concat fss) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css fss)
hss = xs # gss

goal (1 subgoal):
 1. as = concat hss \<and> list_all2 eq_len hss (fs # fss)
[PROOF STEP]
using someI_ex[of "\<lambda>css. ys = concat css \<and> list_all2 eq_len css fss"]
[PROOF STATE]
proof (prove)
using this:
xs = take (length fs) as
ys = drop (length fs) as
length as = length (concat (fs # fss))
gss = (SOME css. ys = concat css \<and> list_all2 eq_len css fss)
eq_len \<equiv> \<lambda>xs ys. length xs = length ys
\<forall>as. length as = length (concat fss) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css fss)
hss = xs # gss
\<exists>x. ys = concat x \<and> list_all2 eq_len x fss \<Longrightarrow> ys = concat (SOME x. ys = concat x \<and> list_all2 eq_len x fss) \<and> list_all2 eq_len (SOME x. ys = concat x \<and> list_all2 eq_len x fss) fss

goal (1 subgoal):
 1. as = concat hss \<and> list_all2 eq_len hss (fs # fss)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
as = concat hss \<and> list_all2 eq_len hss (fs # fss)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
length ?as = length (concat (fs # fss)) \<Longrightarrow> \<exists>css. ?as = concat css \<and> list_all2 eq_len css (fs # fss)

goal (1 subgoal):
 1. \<And>a bss. \<forall>as. length as = length (concat bss) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css bss) \<Longrightarrow> \<forall>as. length as = length (concat (a # bss)) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css (a # bss))
[PROOF STEP]
thus "\<forall>as. length as = length (concat (fs # fss))
             \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css (fs # fss))"
[PROOF STATE]
proof (prove)
using this:
length ?as = length (concat (fs # fss)) \<Longrightarrow> \<exists>css. ?as = concat css \<and> list_all2 eq_len css (fs # fss)

goal (1 subgoal):
 1. \<forall>as. length as = length (concat (fs # fss)) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css (fs # fss))
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<forall>as. length as = length (concat (fs # fss)) \<longrightarrow> (\<exists>css. as = concat css \<and> list_all2 eq_len css (fs # fss))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prefix_tl_subset: "prefix xs ys \<Longrightarrow> set (tl xs) \<subseteq> set (tl ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix xs ys \<Longrightarrow> set (tl xs) \<subseteq> set (tl ys)
[PROOF STEP]
by (metis Nil_tl prefix_bot.extremum prefix_def set_mono_prefix tl_append2)


[STATEMENT]
lemma powr_eq_one_iff [simp]:
  "a powr x = 1 \<longleftrightarrow> x = 0" if "a > 1" for a x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a powr x = 1) = (x = 0)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
1 < a

goal (1 subgoal):
 1. (a powr x = 1) = (x = 0)
[PROOF STEP]
by (auto simp: powr_def split: if_splits)


[STATEMENT]
lemma fset_of_list_empty [simp]: "(fset_of_list l = {||}) = (l = [])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fset_of_list l = {||}) = (l = [])
[PROOF STEP]
by (metis fset_of_list.rep_eq fset_of_list_simps(1) set_empty)


[STATEMENT]
lemma subdegree_div':
  fixes   p q :: "'a::division_ring fps"
  assumes "\<exists>k. p = k * q"
  shows   "subdegree (p div q) = subdegree p - subdegree q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdegree (p / q) = subdegree p - subdegree q
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
 2. p \<noteq> 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
 2. p \<noteq> 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
\<exists>k. p = k * q
[PROOF STEP]
obtain k where k: "p = k * q"
[PROOF STATE]
proof (prove)
using this:
\<exists>k. p = k * q

goal (1 subgoal):
 1. (\<And>k. p = k * q \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p = k * q

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
 2. p \<noteq> 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
p = k * q
[PROOF STEP]
have "subdegree (p div q) = subdegree k"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
p = k * q

goal (1 subgoal):
 1. subdegree (p / q) = subdegree k
[PROOF STEP]
by (simp add: fps_divide_times_eq)
[PROOF STATE]
proof (state)
this:
subdegree (p / q) = subdegree k

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
 2. p \<noteq> 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
subdegree (p / q) = subdegree k

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
 2. p \<noteq> 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
[PROOF STEP]
have "k $ subdegree k * q $ subdegree q \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k $ subdegree k * q $ subdegree q \<noteq> (0::'a)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k $ subdegree k * q $ subdegree q = (0::'a) \<Longrightarrow> False
[PROOF STEP]
assume "k $ subdegree k * q $ subdegree q = 0"
[PROOF STATE]
proof (state)
this:
k $ subdegree k * q $ subdegree q = (0::'a)

goal (1 subgoal):
 1. k $ subdegree k * q $ subdegree q = (0::'a) \<Longrightarrow> False
[PROOF STEP]
hence "k $ subdegree k * q $ subdegree q * inverse (q $ subdegree q) = 0"
[PROOF STATE]
proof (prove)
using this:
k $ subdegree k * q $ subdegree q = (0::'a)

goal (1 subgoal):
 1. k $ subdegree k * q $ subdegree q * inverse (q $ subdegree q) = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k $ subdegree k * q $ subdegree q * inverse (q $ subdegree q) = (0::'a)

goal (1 subgoal):
 1. k $ subdegree k * q $ subdegree q = (0::'a) \<Longrightarrow> False
[PROOF STEP]
with False k
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
p = k * q
k $ subdegree k * q $ subdegree q * inverse (q $ subdegree q) = (0::'a)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
p = k * q
k $ subdegree k * q $ subdegree q * inverse (q $ subdegree q) = (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
k $ subdegree k * q $ subdegree q \<noteq> (0::'a)

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
 2. p \<noteq> 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
subdegree (p / q) = subdegree k
k $ subdegree k * q $ subdegree q \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
subdegree (p / q) = subdegree k
k $ subdegree k * q $ subdegree q \<noteq> (0::'a)

goal (1 subgoal):
 1. subdegree (p / q) = subdegree p - subdegree q
[PROOF STEP]
by (simp add: k subdegree_mult')
[PROOF STATE]
proof (state)
this:
subdegree (p / q) = subdegree p - subdegree q

goal (1 subgoal):
 1. p = 0 \<Longrightarrow> subdegree (p / q) = subdegree p - subdegree q
[PROOF STEP]
qed simp


[STATEMENT]
lemma rtrancl_rel_chain:
  "(x, y) \<in> R\<^sup>* \<longleftrightarrow> (\<exists> l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> R\<^sup>*) = (\<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (x, y) \<in> R\<^sup>* \<Longrightarrow> \<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R
 2. \<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R \<Longrightarrow> (x, y) \<in> R\<^sup>*
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
(x, y) \<in> R\<^sup>*

goal (2 subgoals):
 1. (x, y) \<in> R\<^sup>* \<Longrightarrow> \<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R
 2. \<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R \<Longrightarrow> (x, y) \<in> R\<^sup>*
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> R\<^sup>*
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> R\<^sup>*

goal (1 subgoal):
 1. \<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R
[PROOF STEP]
by (induct rule: converse_rtrancl_induct) (auto simp add: rel_chain_Cons)
[PROOF STATE]
proof (state)
this:
\<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R

goal (1 subgoal):
 1. \<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R \<Longrightarrow> (x, y) \<in> R\<^sup>*
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R \<Longrightarrow> (x, y) \<in> R\<^sup>*
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R

goal (1 subgoal):
 1. \<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R \<Longrightarrow> (x, y) \<in> R\<^sup>*
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R
[PROOF STEP]
obtain l where "l \<noteq> []" "hd l = x" "last l = y" "rel_chain l R"
[PROOF STATE]
proof (prove)
using this:
\<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>l \<noteq> []; hd l = x; last l = y; rel_chain l R\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l \<noteq> []
hd l = x
last l = y
rel_chain l R

goal (1 subgoal):
 1. \<exists>l. l \<noteq> [] \<and> hd l = x \<and> last l = y \<and> rel_chain l R \<Longrightarrow> (x, y) \<in> R\<^sup>*
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l \<noteq> []
hd l = x
last l = y
rel_chain l R
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
l \<noteq> []
hd l = x
last l = y
rel_chain l R

goal (1 subgoal):
 1. (x, y) \<in> R\<^sup>*
[PROOF STEP]
by (induct l arbitrary: x) (auto simp add: rel_chain_Cons, force)
[PROOF STATE]
proof (state)
this:
(x, y) \<in> R\<^sup>*

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unifiers_set_zip [simp]:
  assumes "length ss = length ts"
  shows "unifiers (set (zip ss ts)) = {\<sigma>. map (\<lambda>t. t \<cdot> \<sigma>) ss = map (\<lambda>t. t \<cdot> \<sigma>) ts}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unifiers (set (zip ss ts)) = {\<sigma>. map (\<lambda>t. t \<cdot> \<sigma>) ss = map (\<lambda>t. t \<cdot> \<sigma>) ts}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length ss = length ts

goal (1 subgoal):
 1. unifiers (set (zip ss ts)) = {\<sigma>. map (\<lambda>t. t \<cdot> \<sigma>) ss = map (\<lambda>t. t \<cdot> \<sigma>) ts}
[PROOF STEP]
by (induct ss ts rule: list_induct2) (auto simp: unifiers_def)


[STATEMENT]
lemma frrestrictionE[elim!]:
  assumes "x \<in>\<^sub>\<circ> r \<restriction>\<^sup>r\<^sub>\<bullet> A"
  obtains a b where "x = [a, b]\<^sub>\<circ>" and "b \<in>\<^sub>\<circ> A" and "[a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = [a, b]\<^sub>\<circ>; b \<in>\<^sub>\<circ> A; [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> r \<restriction>\<^sup>r\<^sub>\<bullet> A

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = [a, b]\<^sub>\<circ>; b \<in>\<^sub>\<circ> A; [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding frrestriction_def
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> set {[a, b]\<^sub>\<circ> |a b. b \<in>\<^sub>\<circ> A \<and> [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = [a, b]\<^sub>\<circ>; b \<in>\<^sub>\<circ> A; [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma lower_asymptotic_density_finite:
  assumes "finite A"
  shows "lower_asymptotic_density A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower_asymptotic_density A = 0
[PROOF STEP]
using lower_asymptotic_density_in_01(3) upper_asymptotic_density_finite[OF assms] lower_asymptotic_density_le_upper
[PROOF STATE]
proof (prove)
using this:
0 \<le> lower_asymptotic_density ?A
upper_asymptotic_density A = 0
lower_asymptotic_density ?A \<le> upper_asymptotic_density ?A

goal (1 subgoal):
 1. lower_asymptotic_density A = 0
[PROOF STEP]
by (metis antisym_conv)


[STATEMENT]
lemma (in Ring) prod_n_ideal_cont2:"\<lbrakk>\<forall>l\<le> (n::nat). ideal R (J l);
     prime_ideal R P; \<Inter>{X. (\<exists>k\<le> n. X = (J k))} \<subseteq> P\<rbrakk> \<Longrightarrow>
     \<exists>l\<le> n. (J l) \<subseteq> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. ideal R (J l); prime_ideal R P; \<Inter> {X. \<exists>k\<le>n. X = J k} \<subseteq> P\<rbrakk> \<Longrightarrow> \<exists>l\<le>n. J l \<subseteq> P
[PROOF STEP]
apply (frule prod_n_ideal_contTr[of n J])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. ideal R (J l); prime_ideal R P; \<Inter> {X. \<exists>k\<le>n. X = J k} \<subseteq> P; i\<Pi>\<^bsub>R,n\<^esub> J \<subseteq> \<Inter> {X. \<exists>k\<le>n. X = J k}\<rbrakk> \<Longrightarrow> \<exists>l\<le>n. J l \<subseteq> P
[PROOF STEP]
apply (frule_tac A = "i\<Pi>\<^bsub>R,n\<^esub> J" and B = "\<Inter>{X. \<exists>k\<le> n. X = J k}" and C = P
       in subset_trans, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. ideal R (J l); prime_ideal R P; \<Inter> {X. \<exists>k\<le>n. X = J k} \<subseteq> P; i\<Pi>\<^bsub>R,n\<^esub> J \<subseteq> \<Inter> {X. \<exists>k\<le>n. X = J k}; i\<Pi>\<^bsub>R,n\<^esub> J \<subseteq> P\<rbrakk> \<Longrightarrow> \<exists>l\<le>n. J l \<subseteq> P
[PROOF STEP]
apply (thin_tac "\<Inter>{X. \<exists>k\<le> n. X = J k} \<subseteq> P",
       thin_tac "i\<Pi>\<^bsub>R,n\<^esub> J \<subseteq> \<Inter>{X. \<exists>k\<le> n. X = J k}")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. ideal R (J l); prime_ideal R P; i\<Pi>\<^bsub>R,n\<^esub> J \<subseteq> P\<rbrakk> \<Longrightarrow> \<exists>l\<le>n. J l \<subseteq> P
[PROOF STEP]
apply (simp add:ideal_n_prod_prime)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma line_integral_sum_basis:
  assumes "finite (basis::('a::euclidean_space) set)"  "\<forall>b\<in>basis. line_integral_exists F {b} \<gamma>"
  shows "line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>)"
        "line_integral_exists F basis \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>) &&& line_integral_exists F basis \<gamma>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite basis
\<forall>b\<in>basis. line_integral_exists F {b} \<gamma>

goal (1 subgoal):
 1. line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>) &&& line_integral_exists F basis \<gamma>
[PROOF STEP]
proof(induction basis)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>b\<in>{}. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F {} \<gamma> = (\<Sum>b\<in>{}. line_integral F {b} \<gamma>)
 2. \<forall>b\<in>{}. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F {} \<gamma>
 3. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
 4. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral_exists F (insert x Fa) \<gamma>
[PROOF STEP]
show "line_integral F {} \<gamma> = (\<Sum>b\<in>{}. line_integral F {b} \<gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {} \<gamma> = (\<Sum>b\<in>{}. line_integral F {b} \<gamma>)
[PROOF STEP]
by(auto simp add: line_integral_def)
[PROOF STATE]
proof (state)
this:
line_integral F {} \<gamma> = (\<Sum>b\<in>{}. line_integral F {b} \<gamma>)

goal (3 subgoals):
 1. \<forall>b\<in>{}. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F {} \<gamma>
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
 3. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral_exists F (insert x Fa) \<gamma>
[PROOF STEP]
show "\<forall>b\<in>{}. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F {} \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>b\<in>{}. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F {} \<gamma>
[PROOF STEP]
by(simp add: line_integral_exists_def integrable_0)
[PROOF STATE]
proof (state)
this:
\<forall>b\<in>{}. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F {} \<gamma>

goal (2 subgoals):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral_exists F (insert x Fa) \<gamma>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral_exists F (insert x Fa) \<gamma>
[PROOF STEP]
fix basis::"('a::euclidean_space) set"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral_exists F (insert x Fa) \<gamma>
[PROOF STEP]
fix x::"'a::euclidean_space"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral_exists F (insert x Fa) \<gamma>
[PROOF STEP]
fix  \<gamma>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral_exists F (insert x Fa) \<gamma>
[PROOF STEP]
assume ind_hyp: "(\<forall>b\<in>basis. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F basis \<gamma>)"
    "(\<forall>b\<in>basis. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>))"
[PROOF STATE]
proof (state)
this:
\<forall>b\<in>basis. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F basis \<gamma>
\<forall>b\<in>basis. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>)

goal (2 subgoals):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral_exists F (insert x Fa) \<gamma>
[PROOF STEP]
assume step: "finite basis"
    "x \<notin> basis"
    "\<forall>b\<in>insert x basis. line_integral_exists F {b} \<gamma>"
[PROOF STATE]
proof (state)
this:
finite basis
x \<notin> basis
\<forall>b\<in>insert x basis. line_integral_exists F {b} \<gamma>

goal (2 subgoals):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral_exists F (insert x Fa) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite basis
x \<notin> basis
\<forall>b\<in>insert x basis. line_integral_exists F {b} \<gamma>
[PROOF STEP]
have 0: "line_integral_exists F {x} \<gamma>"
[PROOF STATE]
proof (prove)
using this:
finite basis
x \<notin> basis
\<forall>b\<in>insert x basis. line_integral_exists F {b} \<gamma>

goal (1 subgoal):
 1. line_integral_exists F {x} \<gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
line_integral_exists F {x} \<gamma>

goal (2 subgoals):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral_exists F (insert x Fa) \<gamma>
[PROOF STEP]
have 1:"line_integral_exists F basis \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral_exists F basis \<gamma>
[PROOF STEP]
using ind_hyp step
[PROOF STATE]
proof (prove)
using this:
\<forall>b\<in>basis. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F basis \<gamma>
\<forall>b\<in>basis. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>)
finite basis
x \<notin> basis
\<forall>b\<in>insert x basis. line_integral_exists F {b} \<gamma>

goal (1 subgoal):
 1. line_integral_exists F basis \<gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
line_integral_exists F basis \<gamma>

goal (2 subgoals):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral_exists F (insert x Fa) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
line_integral_exists F basis \<gamma>
[PROOF STEP]
show "line_integral_exists F (insert x basis) \<gamma>"
[PROOF STATE]
proof (prove)
using this:
line_integral_exists F basis \<gamma>

goal (1 subgoal):
 1. line_integral_exists F (insert x basis) \<gamma>
[PROOF STEP]
using step(1) step(2) line_integral_sum_gen(2)[OF _ 0 1]
[PROOF STATE]
proof (prove)
using this:
line_integral_exists F basis \<gamma>
finite basis
x \<notin> basis
\<lbrakk>finite ?basis; {x} \<union> basis = ?basis; {x} \<inter> basis = {}\<rbrakk> \<Longrightarrow> line_integral_exists F ?basis \<gamma>

goal (1 subgoal):
 1. line_integral_exists F (insert x basis) \<gamma>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
line_integral_exists F (insert x basis) \<gamma>

goal (1 subgoal):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
[PROOF STEP]
have 3: "finite (insert x basis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (insert x basis)
[PROOF STEP]
using step(1)
[PROOF STATE]
proof (prove)
using this:
finite basis

goal (1 subgoal):
 1. finite (insert x basis)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (insert x basis)

goal (1 subgoal):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
[PROOF STEP]
have "line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>)
[PROOF STEP]
using ind_hyp step
[PROOF STATE]
proof (prove)
using this:
\<forall>b\<in>basis. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F basis \<gamma>
\<forall>b\<in>basis. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>)
finite basis
x \<notin> basis
\<forall>b\<in>insert x basis. line_integral_exists F {b} \<gamma>

goal (1 subgoal):
 1. line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>)

goal (1 subgoal):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral F Fa \<gamma> = (\<Sum>b\<in>Fa. line_integral F {b} \<gamma>); \<forall>b\<in>Fa. line_integral_exists F {b} \<gamma> \<Longrightarrow> line_integral_exists F Fa \<gamma>; \<forall>b\<in>insert x Fa. line_integral_exists F {b} \<gamma>\<rbrakk> \<Longrightarrow> line_integral F (insert x Fa) \<gamma> = (\<Sum>b\<in>insert x Fa. line_integral F {b} \<gamma>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>)
[PROOF STEP]
show "line_integral F (insert x basis) \<gamma> = (\<Sum>b\<in>insert x basis. line_integral F {b} \<gamma>)"
[PROOF STATE]
proof (prove)
using this:
line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>)

goal (1 subgoal):
 1. line_integral F (insert x basis) \<gamma> = (\<Sum>b\<in>insert x basis. line_integral F {b} \<gamma>)
[PROOF STEP]
using step(1) step(2) line_integral_sum_gen(1)[OF 3 0 1]
[PROOF STATE]
proof (prove)
using this:
line_integral F basis \<gamma> = (\<Sum>b\<in>basis. line_integral F {b} \<gamma>)
finite basis
x \<notin> basis
\<lbrakk>{x} \<union> basis = insert x basis; {x} \<inter> basis = {}\<rbrakk> \<Longrightarrow> line_integral F (insert x basis) \<gamma> = line_integral F {x} \<gamma> + line_integral F basis \<gamma>

goal (1 subgoal):
 1. line_integral F (insert x basis) \<gamma> = (\<Sum>b\<in>insert x basis. line_integral F {b} \<gamma>)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
line_integral F (insert x basis) \<gamma> = (\<Sum>b\<in>insert x basis. line_integral F {b} \<gamma>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma perron_frobenius_spectral_type_based:
  assumes "non_neg_mat (A :: real ^ 'n ^ 'n)"
  and "\<forall> x. poly (charpoly A) x = 0 \<longrightarrow> x \<le> 1"
  and "\<forall> x :: complex. norm x = 1 \<longrightarrow> order x (map_poly of_real (charpoly A)) \<le> d"
  shows "\<exists>c1 c2. \<forall>k a. a \<in> elements_mat_h (matpow A k) \<longrightarrow> abs a \<le> (c1 + c2 * real k ^ (d - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c1 c2. \<forall>k a. a \<in> elements_mat_h (matpow A k) \<longrightarrow> \<bar>a\<bar> \<le> c1 + c2 * real k ^ (d - 1)
[PROOF STEP]
using assms perron_frobenius_spectral_radius
[PROOF STATE]
proof (prove)
using this:
non_neg_mat A
\<forall>x. poly (charpoly A) x = 0 \<longrightarrow> x \<le> 1
\<forall>x. cmod x = 1 \<longrightarrow> order x (map_poly complex_of_real (charpoly A)) \<le> d
\<lbrakk>?A \<in> carrier_mat ?n ?n; nonneg_mat ?A; \<forall>x. poly (char_poly ?A) x = 0 \<longrightarrow> x \<le> 1; \<forall>x. cmod x = 1 \<longrightarrow> order x (map_poly complex_of_real (char_poly ?A)) \<le> ?d\<rbrakk> \<Longrightarrow> \<exists>c1 c2. \<forall>k a. a \<in> elements_mat (?A ^\<^sub>m k) \<longrightarrow> \<bar>a\<bar> \<le> c1 + c2 * real k ^ (?d - 1)

goal (1 subgoal):
 1. \<exists>c1 c2. \<forall>k a. a \<in> elements_mat_h (matpow A k) \<longrightarrow> \<bar>a\<bar> \<le> c1 + c2 * real k ^ (d - 1)
[PROOF STEP]
by (transfer, blast)


[STATEMENT]
lemma leadsTo_imp_extend_leadsTo:
     "F \<in> A leadsTo B
      ==> extend h F \<in> (extend_set h A) leadsTo (extend_set h B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<in> A \<longmapsto> B \<Longrightarrow> extend h F \<in> extend_set h A \<longmapsto> extend_set h B
[PROOF STEP]
apply (erule leadsTo_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>A B. F \<in> A ensures B \<Longrightarrow> extend h F \<in> extend_set h A \<longmapsto> extend_set h B
 2. \<And>A B C. \<lbrakk>F \<in> A \<longmapsto> B; extend h F \<in> extend_set h A \<longmapsto> extend_set h B; F \<in> B \<longmapsto> C; extend h F \<in> extend_set h B \<longmapsto> extend_set h C\<rbrakk> \<Longrightarrow> extend h F \<in> extend_set h A \<longmapsto> extend_set h C
 3. \<And>B S. \<forall>A\<in>S. F \<in> A \<longmapsto> B \<and> extend h F \<in> extend_set h A \<longmapsto> extend_set h B \<Longrightarrow> extend h F \<in> extend_set h (\<Union> S) \<longmapsto> extend_set h B
[PROOF STEP]
apply (simp add: leadsTo_Basis extend_ensures)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>A B C. \<lbrakk>F \<in> A \<longmapsto> B; extend h F \<in> extend_set h A \<longmapsto> extend_set h B; F \<in> B \<longmapsto> C; extend h F \<in> extend_set h B \<longmapsto> extend_set h C\<rbrakk> \<Longrightarrow> extend h F \<in> extend_set h A \<longmapsto> extend_set h C
 2. \<And>B S. \<forall>A\<in>S. F \<in> A \<longmapsto> B \<and> extend h F \<in> extend_set h A \<longmapsto> extend_set h B \<Longrightarrow> extend h F \<in> extend_set h (\<Union> S) \<longmapsto> extend_set h B
[PROOF STEP]
apply (blast intro: leadsTo_Trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>B S. \<forall>A\<in>S. F \<in> A \<longmapsto> B \<and> extend h F \<in> extend_set h A \<longmapsto> extend_set h B \<Longrightarrow> extend h F \<in> extend_set h (\<Union> S) \<longmapsto> extend_set h B
[PROOF STEP]
apply (simp add: leadsTo_UN extend_set_Union)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "VARS M N P :: int
 {m=M \<and> n=N}
 IF M < 0 THEN M := -M; N := -N ELSE SKIP FI;
 P := 0;
 WHILE 0 < M
 INV {0 \<le> M \<and> (\<exists>p. p = (if m<0 then -m else m) \<and> p*N = m*n \<and> P = (p-M)*N)}
 DO P := P+N; M := M - 1 OD
 {P = m*n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m = M \<and> n = N}
IF M < 0 THEN M := - M; N := - N  ELSE SKIP FI; P := 0; WHILE 0 < M INV {0 \<le> M \<and> (\<exists>p. p = (if m < 0 then - m else m) \<and> p * N = m * n \<and> P = (p - M) * N)}  VAR {0}
DO P := P + N; M := M - 1 OD
{P = m * n}
[PROOF STEP]
proof casified_vcg_simp
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)
 2. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> \<not> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N = m * n) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N = m * n)
[PROOF STEP]
case while
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)
 2. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> \<not> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N = m * n) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N = m * n)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)
 2. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> \<not> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N = m * n) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N = m * n)
[PROOF STEP]
case postcondition
[PROOF STATE]
proof (state)
this:
0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> \<not> 0 < M

goal (2 subgoals):
 1. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)
 2. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> \<not> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N = m * n) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N = m * n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> \<not> 0 < M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> \<not> 0 < M

goal (1 subgoal):
 1. (m < 0 \<longrightarrow> (- m - M) * N = m * n) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N = m * n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(m < 0 \<longrightarrow> (- m - M) * N = m * n) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N = m * n)

goal (1 subgoal):
 1. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)
[PROOF STEP]
case invariant
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)
[PROOF STEP]
case basic
[PROOF STATE]
proof (state)
this:
0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M

goal (1 subgoal):
 1. \<And>M N. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 < M

goal (1 subgoal):
 1. (m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)
[PROOF STEP]
by (auto simp: int_distrib)
[PROOF STATE]
proof (state)
this:
(m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 \<le> ?M2 \<and> (if m < 0 then - m else m) * ?N2 = m * n \<and> 0 < ?M2 \<Longrightarrow> (m < 0 \<longrightarrow> (- m - ?M2) * ?N2 + ?N2 = (- m - (?M2 - 1)) * ?N2) \<and> (\<not> m < 0 \<longrightarrow> (m - ?M2) * ?N2 + ?N2 = (m - (?M2 - 1)) * ?N2)

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 \<le> ?M2 \<and> (if m < 0 then - m else m) * ?N2 = m * n \<and> 0 < ?M2 \<Longrightarrow> (m < 0 \<longrightarrow> (- m - ?M2) * ?N2 + ?N2 = (- m - (?M2 - 1)) * ?N2) \<and> (\<not> m < 0 \<longrightarrow> (m - ?M2) * ?N2 + ?N2 = (m - (?M2 - 1)) * ?N2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma foldSetD_backwards:
  assumes "A \<noteq> {}" "(A, z) \<in> foldSetD D f e"
  shows "\<exists>x y. x \<in> A \<and> (A - { x }, y) \<in> foldSetD D f e \<and> z = f x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. x \<in> A \<and> (A\<setminus>{x}, y) \<in> foldSetD D f e \<and> z = f x y
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
(A, z) \<in> foldSetD D f e

goal (1 subgoal):
 1. \<exists>x y. x \<in> A \<and> (A\<setminus>{x}, y) \<in> foldSetD D f e \<and> z = f x y
[PROOF STEP]
by (cases) (simp add: assms(1), metis Diff_insert_absorb insertI1)


[STATEMENT]
lemma sum_mset_distrib_div_if_dvd:
  fixes k :: "'a::unique_euclidean_semiring"
  assumes "\<forall>m \<in># M. k dvd f m"
  shows "(\<Sum>m \<in># M. f m) div k = (\<Sum>m \<in># M. f m div k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f M) div k = (\<Sum>m\<in>#M. f m div k)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<in>#M. k dvd f m

goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f M) div k = (\<Sum>m\<in>#M. f m div k)
[PROOF STEP]
by (induct M) (auto simp: div_plus_div_distrib_dvd_left)


[STATEMENT]
lemma mult_less_multiset\<^sub>H\<^sub>O: "(M, N) \<in> mult {(x, y). x < y} \<longleftrightarrow> less_multiset\<^sub>H\<^sub>O M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((M, N) \<in> mult {(x, y). x < y}) = less_multiset\<^sub>H\<^sub>O M N
[PROOF STEP]
unfolding multp_def[of "(<)", symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>H\<^sub>O M N
[PROOF STEP]
using multp_eq_multp\<^sub>H\<^sub>O[of "(<)", simplified]
[PROOF STATE]
proof (prove)
using this:
multp (<) = multp\<^sub>H\<^sub>O (<)

goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>H\<^sub>O M N
[PROOF STEP]
by (simp add: multp\<^sub>H\<^sub>O_def less_multiset\<^sub>H\<^sub>O_def)


[STATEMENT]
lemma "0x01 = (1::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma fps_right_inverse_idempotent_ring1:
  fixes   f :: "'a::ring_1 fps"
  assumes "f$0 * x = 1" "x * y = 1"
  \<comment> \<open>These assumptions imply y equals f$0, but no need to assume that.\<close>
  shows   "fps_right_inverse (fps_right_inverse f x) y = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_right_inverse (fps_right_inverse f x) y = f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fps_right_inverse (fps_right_inverse f x) y = f
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
f $ 0 * x = (1::'a)
[PROOF STEP]
have "f * (fps_right_inverse f x * fps_right_inverse (fps_right_inverse f x) y) =
      fps_right_inverse (fps_right_inverse f x) y"
[PROOF STATE]
proof (prove)
using this:
f $ 0 * x = (1::'a)

goal (1 subgoal):
 1. f * (fps_right_inverse f x * fps_right_inverse (fps_right_inverse f x) y) = fps_right_inverse (fps_right_inverse f x) y
[PROOF STEP]
by (simp add: fps_right_inverse mult.assoc[symmetric])
[PROOF STATE]
proof (state)
this:
f * (fps_right_inverse f x * fps_right_inverse (fps_right_inverse f x) y) = fps_right_inverse (fps_right_inverse f x) y

goal (1 subgoal):
 1. fps_right_inverse (fps_right_inverse f x) y = f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f * (fps_right_inverse f x * fps_right_inverse (fps_right_inverse f x) y) = fps_right_inverse (fps_right_inverse f x) y

goal (1 subgoal):
 1. fps_right_inverse (fps_right_inverse f x) y = f
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
x * y = (1::'a)
[PROOF STEP]
have
    "fps_right_inverse f x * fps_right_inverse (fps_right_inverse f x) y = 1"
[PROOF STATE]
proof (prove)
using this:
x * y = (1::'a)

goal (1 subgoal):
 1. fps_right_inverse f x * fps_right_inverse (fps_right_inverse f x) y = 1
[PROOF STEP]
by (simp add: fps_right_inverse)
[PROOF STATE]
proof (state)
this:
fps_right_inverse f x * fps_right_inverse (fps_right_inverse f x) y = 1

goal (1 subgoal):
 1. fps_right_inverse (fps_right_inverse f x) y = f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f * (fps_right_inverse f x * fps_right_inverse (fps_right_inverse f x) y) = fps_right_inverse (fps_right_inverse f x) y
fps_right_inverse f x * fps_right_inverse (fps_right_inverse f x) y = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f * (fps_right_inverse f x * fps_right_inverse (fps_right_inverse f x) y) = fps_right_inverse (fps_right_inverse f x) y
fps_right_inverse f x * fps_right_inverse (fps_right_inverse f x) y = 1

goal (1 subgoal):
 1. fps_right_inverse (fps_right_inverse f x) y = f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fps_right_inverse (fps_right_inverse f x) y = f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Int_card1: "finite A \<Longrightarrow> card (A \<inter> B) \<le> card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> card (A \<inter> B) \<le> card A
[PROOF STEP]
by (rule card_mono, simp_all)


[STATEMENT]
lemma coclop_Sup_closed:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  shows  "coclop f \<Longrightarrow> Sup_closed_set (Fix f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coclop f \<Longrightarrow> Sup_closed_set (Fix f)
[PROOF STEP]
unfolding coclop_def Sup_closed_set_def mono_def le_fun_def comp_def id_def Fix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. f x \<le> x) \<and> (\<forall>x y. x \<le> y \<longrightarrow> f x \<le> f y) \<and> (\<forall>x. f x \<le> f (f x)) \<Longrightarrow> \<forall>Y\<subseteq>{x. f x = x}. \<Squnion> Y \<in> {x. f x = x}
[PROOF STEP]
by (smt Sup_least Sup_upper antisym_conv mem_Collect_eq subsetCE)


[STATEMENT]
lemma shifted_transitions_alt_def :
  "shifted_transitions ts = {(Inl (q1',q2'), x, y, (Inl (q1'',q2''))) | q1' q2' x y q1'' q2'' . ((q1',q2'), x, y, (q1'',q2'')) \<in> ts}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shifted_transitions ts = {(Inl (q1', q2'), x, y, Inl (q1'', q2'')) |q1' q2' x y q1'' q2''. ((q1', q2'), x, y, q1'', q2'') \<in> ts}
[PROOF STEP]
unfolding shifted_transitions_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shift_Inl ` ts = {(Inl (q1', q2'), x, y, Inl (q1'', q2'')) |q1' q2' x y q1'' q2''. ((q1', q2'), x, y, q1'', q2'') \<in> ts}
[PROOF STEP]
by force


[STATEMENT]
lemma UNION_commute:"(\<Union>x\<in>A. \<Union>y\<in>B . P x y) = (\<Union>y\<in>B. \<Union>x\<in>A . P x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>A. \<Union> (P x ` B)) = (\<Union>y\<in>B. \<Union>x\<in>A. P x y)
[PROOF STEP]
by auto


[STATEMENT]
lemma lebesgue_integrable_real_affine_iff:
  fixes f :: "real \<Rightarrow> 'a :: euclidean_space"
  shows "c \<noteq> 0 \<Longrightarrow> integrable lebesgue (\<lambda>x. f(t + c * x)) \<longleftrightarrow> integrable lebesgue f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> integrable lebesgue (\<lambda>x. f (t + c * x)) = integrable lebesgue f
[PROOF STEP]
using lebesgue_integrable_real_affine[of f c t]
        lebesgue_integrable_real_affine[of "\<lambda>x. f(t + c * x)" "1/c" "-t/c"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>integrable lebesgue f; c \<noteq> 0\<rbrakk> \<Longrightarrow> integrable lebesgue (\<lambda>x. f (t + c * x))
\<lbrakk>integrable lebesgue (\<lambda>x. f (t + c * x)); 1 / c \<noteq> 0\<rbrakk> \<Longrightarrow> integrable lebesgue (\<lambda>x. f (t + c * (- t / c + 1 / c * x)))

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> integrable lebesgue (\<lambda>x. f (t + c * x)) = integrable lebesgue f
[PROOF STEP]
by (auto simp: field_simps)


[STATEMENT]
lemma less_Infinitesimal_less: "0 < x \<Longrightarrow> x \<notin> Infinitesimal \<Longrightarrow> e \<in> Infinitesimal \<Longrightarrow> e < x"
  for x :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x \<notin> Infinitesimal; e \<in> Infinitesimal\<rbrakk> \<Longrightarrow> e < x
[PROOF STEP]
using Infinitesimal_interval less_linear
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?e \<in> Infinitesimal; ?e' \<in> Infinitesimal; ?e' < ?x; ?x < ?e\<rbrakk> \<Longrightarrow> ?x \<in> Infinitesimal
?x < ?y \<or> ?x = ?y \<or> ?y < ?x

goal (1 subgoal):
 1. \<lbrakk>0 < x; x \<notin> Infinitesimal; e \<in> Infinitesimal\<rbrakk> \<Longrightarrow> e < x
[PROOF STEP]
by blast


[STATEMENT]
lemma natceiling_lessD: "nat(ceiling x) < n \<Longrightarrow> x < real n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat \<lceil>x\<rceil> < n \<Longrightarrow> x < real n
[PROOF STEP]
by linarith


[STATEMENT]
lemma takeWhile_map: "takeWhile P (map f xs) = map f (takeWhile (P \<circ> f) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. takeWhile P (map f xs) = map f (takeWhile (P \<circ> f) xs)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma "ipv4addr_wordinterval_pretty_toString
    (RangeUnion (RangeUnion (WordInterval 0x7F000000 0x7FFFFFFF) (WordInterval 0x1020304 0x1020306))
                (WordInterval 0x8080808 0x8080808)) = ''[127.0.0.0/8, 1.2.3.4-1.2.3.6, 8.8.8.8]''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipv4addr_wordinterval_pretty_toString (RangeUnion (RangeUnion (WordInterval 2130706432 2147483647) (WordInterval 16909060 16909062)) (WordInterval 134744072 134744072)) = ''[127.0.0.0/8, 1.2.3.4-1.2.3.6, 8.8.8.8]''
[PROOF STEP]
by eval


[STATEMENT]
theorem wls_subst_compose2:
assumes  "wls s X" and "wls (asSort ys) Y" and "wls (asSort zs) Z"
and "ys \<noteq> zs \<or> y \<noteq> z" and fresh: "fresh ys y Z"
shows "((X #[Y / y]_ys) #[Z / z]_zs) = ((X #[Z / z]_zs) #[(Y #[Z / z]_zs) / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X #[Y / y]_ys #[Z / z]_zs = X #[Z / z]_zs #[Y #[Z / z]_zs / y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
wls (asSort ys) Y
wls (asSort zs) Z
ys \<noteq> zs \<or> y \<noteq> z
fresh ys y Z

goal (1 subgoal):
 1. X #[Y / y]_ys #[Z / z]_zs = X #[Z / z]_zs #[Y #[Z / z]_zs / y]_ys
[PROOF STEP]
by(simp add: subst_compose2)


[STATEMENT]
lemma is_min2_insert:
  "is_min2 x (insert y ys)
  \<longleftrightarrow> (y=x \<and> (\<forall>z\<in>ys. snd x \<le> snd z)) \<or> (snd x \<le> snd y \<and> is_min2 x ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_min2 x (insert y ys) = (y = x \<and> (\<forall>z\<in>ys. snd x \<le> snd z) \<or> snd x \<le> snd y \<and> is_min2 x ys)
[PROOF STEP]
by (auto simp: is_min2_def)


[STATEMENT]
lemma cnorm_ge_square: "norm x \<ge> a \<longleftrightarrow> a \<le> 0 \<or> cinner x x \<ge> complex_of_real (a\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> norm x) = (a \<le> 0 \<or> complex_of_real (a\<^sup>2) \<le> cinner x x)
[PROOF STEP]
by (smt (verit, best) antisym_conv cnorm_eq_square cnorm_le_square complex_of_real_nn_iff nn_comparable zero_le_power2)


[STATEMENT]
lemma gcd_neg_numeral_2 [simp]: "gcd a (- numeral n) = gcd a (numeral n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd a (- numeral n) = gcd a (numeral n)
[PROOF STEP]
by (fact gcd_neg2)


[STATEMENT]
lemma "(\<lambda>x::real. x / (x - 1) - 1 / ln x) \<midarrow>1\<rightarrow> 1 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x / (x - 1) - 1 / ln x) \<midarrow>1\<rightarrow> 1 / 2
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma nact_active:
  fixes t::"nat \<Rightarrow> cnf"
    and n::nat
    and n''
    and id
  assumes "\<parallel>id\<parallel>\<^bsub>t n\<^esub>"
    and "n'' \<ge> n"
    and "\<not> (\<exists>n'\<ge>n. n' < n'' \<and> \<parallel>id\<parallel>\<^bsub>t n'\<^esub>)"
  shows "n=n''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = n''
[PROOF STEP]
using assms le_eq_less_or_eq
[PROOF STATE]
proof (prove)
using this:
\<parallel>id\<parallel>\<^bsub>t n\<^esub>
n \<le> n''
\<not> (\<exists>n'\<ge>n. n' < n'' \<and> \<parallel>id\<parallel>\<^bsub>t n'\<^esub>)
(?m \<le> ?n) = (?m < ?n \<or> ?m = ?n)

goal (1 subgoal):
 1. n = n''
[PROOF STEP]
by auto


[STATEMENT]
lemma trigonometric_set:
  "trigonometric_set 0 x = 1 / sqrt(2 * pi)"
  "trigonometric_set (Suc (2 * n)) x = sin(real(Suc n) * x) / sqrt(pi)"
  "trigonometric_set (2 * n + 2) x = cos(real(Suc n) * x) / sqrt(pi)"
  "trigonometric_set (Suc (Suc (2 * n))) x = cos(real(Suc n) * x) / sqrt(pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (trigonometric_set 0 x = 1 / sqrt (2 * pi) &&& trigonometric_set (Suc (2 * n)) x = sin (real (Suc n) * x) / sqrt pi) &&& trigonometric_set (2 * n + 2) x = cos (real (Suc n) * x) / sqrt pi &&& trigonometric_set (Suc (Suc (2 * n))) x = cos (real (Suc n) * x) / sqrt pi
[PROOF STEP]
by (simp_all add: trigonometric_set_def algebra_simps add_divide_distrib)


[STATEMENT]
lemma transymcl_insert: "transymcl (insert (a, b) Qeq) = transymcl Qeq \<union> {(a,a),(b,b)} \<union>
   ((transymcl Qeq \<union> {(a, a), (b, b)}) O {(a, b), (b, a)} O (transymcl Qeq \<union> {(a, a), (b, b)}) - transymcl Qeq)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transymcl (insert (a, b) Qeq) = transymcl Qeq \<union> {(a, a), (b, b)} \<union> ((transymcl Qeq \<union> {(a, a), (b, b)}) O {(a, b), (b, a)} O (transymcl Qeq \<union> {(a, a), (b, b)}) - transymcl Qeq)
[PROOF STEP]
by (auto simp: relcomp_def relcompp_apply transymcl_def symcl_insert trancl_insert2 dest: trancl_trans)


[STATEMENT]
lemma get_min: "\<lbrakk> pheap h;  h \<noteq> Empty \<rbrakk> \<Longrightarrow> get_min h = Min_mset (mset_heap h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pheap h; h \<noteq> Empty\<rbrakk> \<Longrightarrow> get_min h = Min_mset (mset_heap h)
[PROOF STEP]
by (metis Min_eqI finite_set_mset get_min_in get_min_min )


[STATEMENT]
lemma cut_less_inext_nth_card_if: "
  card (I \<down>< (I \<rightarrow> n)) = (
  if (n < card I \<or> infinite I) then n else card I - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (I \<down>< (I \<rightarrow> n)) = (if n < card I \<or> infinite I then n else card I - Suc 0)
[PROOF STEP]
by (simp add: cut_less_inext_nth_card_eq1 cut_less_inext_nth_card_eq2)


[STATEMENT]
lemma sup_Pair_Pair [simp]: "sup (a, b) (c, d) = (sup a c, sup b d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup (a, b) (c, d) = (sup a c, sup b d)
[PROOF STEP]
unfolding sup_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sup (fst (a, b)) (fst (c, d)), sup (snd (a, b)) (snd (c, d))) = (sup a c, sup b d)
[PROOF STEP]
by simp