[STATEMENT]
lemma fls_unit_base_subdegree_power:
  "x * f $$ fls_subdegree f = 1 \<Longrightarrow> fls_subdegree (f ^ n) = n * fls_subdegree f"
  "f $$ fls_subdegree f * y = 1 \<Longrightarrow> fls_subdegree (f ^ n) = n * fls_subdegree f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * f $$ fls_subdegree f = (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f) &&& (f $$ fls_subdegree f * y = (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x * f $$ fls_subdegree f = (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f
 2. f $$ fls_subdegree f * y = (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f
[PROOF STEP]
show "x * f $$ fls_subdegree f = 1 \<Longrightarrow> fls_subdegree (f ^ n) = n * fls_subdegree f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * f $$ fls_subdegree f = (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f
[PROOF STEP]
using left_right_inverse_power[of x "f $$ fls_subdegree f" n]
[PROOF STATE]
proof (prove)
using this:
x * f $$ fls_subdegree f = (1::'a) \<Longrightarrow> x ^ n * (f $$ fls_subdegree f) ^ n = (1::'a)

goal (1 subgoal):
 1. x * f $$ fls_subdegree f = (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f
[PROOF STEP]
by    (auto intro: fls_pow_subdegree_eqI)
[PROOF STATE]
proof (state)
this:
x * f $$ fls_subdegree f = (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f

goal (1 subgoal):
 1. f $$ fls_subdegree f * y = (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f
[PROOF STEP]
show "f $$ fls_subdegree f * y = 1 \<Longrightarrow> fls_subdegree (f ^ n) = n * fls_subdegree f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f $$ fls_subdegree f * y = (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f
[PROOF STEP]
using left_right_inverse_power[of "f $$ fls_subdegree f" y n]
[PROOF STATE]
proof (prove)
using this:
f $$ fls_subdegree f * y = (1::'a) \<Longrightarrow> (f $$ fls_subdegree f) ^ n * y ^ n = (1::'a)

goal (1 subgoal):
 1. f $$ fls_subdegree f * y = (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f
[PROOF STEP]
by    (auto intro: fls_pow_subdegree_eqI)
[PROOF STATE]
proof (state)
this:
f $$ fls_subdegree f * y = (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lesspoll_trans [trans]: "\<lbrakk>X \<prec> Y; Y \<prec> Z\<rbrakk> \<Longrightarrow> X \<prec> Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<prec> Y; Y \<prec> Z\<rbrakk> \<Longrightarrow> X \<prec> Z
[PROOF STEP]
by (meson eqpoll_sym lepoll_antisym lepoll_trans lepoll_trans1 lesspoll_def)


[STATEMENT]
lemma subseqs_set_subset:
  assumes "ys \<in> set (subseqs xs)"
  shows "set ys \<subseteq> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ys \<subseteq> set xs
[PROOF STEP]
using assms subseqs_powset[of xs]
[PROOF STATE]
proof (prove)
using this:
ys \<in> set (subseqs xs)
set ` set (subseqs xs) = Pow (set xs)

goal (1 subgoal):
 1. set ys \<subseteq> set xs
[PROOF STEP]
by auto


[STATEMENT]
lemma smult_right_add: fixes a :: "'a::ring_1" shows "a *\<^sub>S (x + y) = a *\<^sub>S x + a *\<^sub>S y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a *\<^sub>S (x + y) = a *\<^sub>S x + a *\<^sub>S y
[PROOF STEP]
by transfer (simp add: vec_eq_iff field_simps)


[STATEMENT]
lemma gcd_reflect_poly: fixes f :: "'a :: {factorial_ring_gcd, semiring_gcd_mult_normalize} poly"
  assumes nz: "coeff f 0 \<noteq> 0" "coeff g 0 \<noteq> 0"
  shows "gcd (reflect_poly f) (reflect_poly g) = normalize (reflect_poly (gcd f g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (reflect_poly f) (reflect_poly g) = normalize (reflect_poly (gcd f g))
[PROOF STEP]
proof (rule sym, rule gcdI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. normalize (reflect_poly (gcd f g)) dvd reflect_poly f
 2. normalize (reflect_poly (gcd f g)) dvd reflect_poly g
 3. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
 4. normalize (normalize (reflect_poly (gcd f g))) = normalize (reflect_poly (gcd f g))
[PROOF STEP]
have "gcd f g dvd f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd f g dvd f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gcd f g dvd f

goal (4 subgoals):
 1. normalize (reflect_poly (gcd f g)) dvd reflect_poly f
 2. normalize (reflect_poly (gcd f g)) dvd reflect_poly g
 3. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
 4. normalize (normalize (reflect_poly (gcd f g))) = normalize (reflect_poly (gcd f g))
[PROOF STEP]
from reflect_poly_dvd[OF this]
[PROOF STATE]
proof (chain)
picking this:
reflect_poly (gcd f g) dvd reflect_poly f
[PROOF STEP]
show "normalize (reflect_poly (gcd f g)) dvd reflect_poly f"
[PROOF STATE]
proof (prove)
using this:
reflect_poly (gcd f g) dvd reflect_poly f

goal (1 subgoal):
 1. normalize (reflect_poly (gcd f g)) dvd reflect_poly f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
normalize (reflect_poly (gcd f g)) dvd reflect_poly f

goal (3 subgoals):
 1. normalize (reflect_poly (gcd f g)) dvd reflect_poly g
 2. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
 3. normalize (normalize (reflect_poly (gcd f g))) = normalize (reflect_poly (gcd f g))
[PROOF STEP]
have "gcd f g dvd g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd f g dvd g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gcd f g dvd g

goal (3 subgoals):
 1. normalize (reflect_poly (gcd f g)) dvd reflect_poly g
 2. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
 3. normalize (normalize (reflect_poly (gcd f g))) = normalize (reflect_poly (gcd f g))
[PROOF STEP]
from reflect_poly_dvd[OF this]
[PROOF STATE]
proof (chain)
picking this:
reflect_poly (gcd f g) dvd reflect_poly g
[PROOF STEP]
show "normalize (reflect_poly (gcd f g)) dvd reflect_poly g"
[PROOF STATE]
proof (prove)
using this:
reflect_poly (gcd f g) dvd reflect_poly g

goal (1 subgoal):
 1. normalize (reflect_poly (gcd f g)) dvd reflect_poly g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
normalize (reflect_poly (gcd f g)) dvd reflect_poly g

goal (2 subgoals):
 1. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
 2. normalize (normalize (reflect_poly (gcd f g))) = normalize (reflect_poly (gcd f g))
[PROOF STEP]
show "normalize (normalize (reflect_poly (gcd f g))) = normalize (reflect_poly (gcd f g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize (normalize (reflect_poly (gcd f g))) = normalize (reflect_poly (gcd f g))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
normalize (normalize (reflect_poly (gcd f g))) = normalize (reflect_poly (gcd f g))

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
[PROOF STEP]
assume hf: "h dvd reflect_poly f" and hg: "h dvd reflect_poly g"
[PROOF STATE]
proof (state)
this:
h dvd reflect_poly f
h dvd reflect_poly g

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
[PROOF STEP]
from hf
[PROOF STATE]
proof (chain)
picking this:
h dvd reflect_poly f
[PROOF STEP]
obtain k where "reflect_poly f = h * k"
[PROOF STATE]
proof (prove)
using this:
h dvd reflect_poly f

goal (1 subgoal):
 1. (\<And>k. reflect_poly f = h * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. reflect_poly f = h * k

goal (1 subgoal):
 1. (\<And>k. reflect_poly f = h * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
reflect_poly f = h * k

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
[PROOF STEP]
from arg_cong[OF this, of "\<lambda> f. coeff f 0", unfolded coeff_mult_0] nz(1)
[PROOF STATE]
proof (chain)
picking this:
coeff (reflect_poly f) 0 = coeff h 0 * coeff k 0
coeff f 0 \<noteq> (0::'a)
[PROOF STEP]
have h: "coeff h 0 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
coeff (reflect_poly f) 0 = coeff h 0 * coeff k 0
coeff f 0 \<noteq> (0::'a)

goal (1 subgoal):
 1. coeff h 0 \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coeff h 0 \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
[PROOF STEP]
from reflect_poly_dvd[OF hf] reflect_poly_dvd[OF hg]
[PROOF STATE]
proof (chain)
picking this:
reflect_poly h dvd reflect_poly (reflect_poly f)
reflect_poly h dvd reflect_poly (reflect_poly g)
[PROOF STEP]
have "reflect_poly h dvd f" "reflect_poly h dvd g"
[PROOF STATE]
proof (prove)
using this:
reflect_poly h dvd reflect_poly (reflect_poly f)
reflect_poly h dvd reflect_poly (reflect_poly g)

goal (1 subgoal):
 1. reflect_poly h dvd f &&& reflect_poly h dvd g
[PROOF STEP]
using nz
[PROOF STATE]
proof (prove)
using this:
reflect_poly h dvd reflect_poly (reflect_poly f)
reflect_poly h dvd reflect_poly (reflect_poly g)
coeff f 0 \<noteq> (0::'a)
coeff g 0 \<noteq> (0::'a)

goal (1 subgoal):
 1. reflect_poly h dvd f &&& reflect_poly h dvd g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
reflect_poly h dvd f
reflect_poly h dvd g

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
[PROOF STEP]
hence "reflect_poly h dvd gcd f g"
[PROOF STATE]
proof (prove)
using this:
reflect_poly h dvd f
reflect_poly h dvd g

goal (1 subgoal):
 1. reflect_poly h dvd gcd f g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
reflect_poly h dvd gcd f g

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
[PROOF STEP]
from reflect_poly_dvd[OF this] h
[PROOF STATE]
proof (chain)
picking this:
reflect_poly (reflect_poly h) dvd reflect_poly (gcd f g)
coeff h 0 \<noteq> (0::'a)
[PROOF STEP]
have "h dvd reflect_poly (gcd f g)"
[PROOF STATE]
proof (prove)
using this:
reflect_poly (reflect_poly h) dvd reflect_poly (gcd f g)
coeff h 0 \<noteq> (0::'a)

goal (1 subgoal):
 1. h dvd reflect_poly (gcd f g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h dvd reflect_poly (gcd f g)

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d dvd reflect_poly f; d dvd reflect_poly g\<rbrakk> \<Longrightarrow> d dvd normalize (reflect_poly (gcd f g))
[PROOF STEP]
thus "h dvd normalize (reflect_poly (gcd f g))"
[PROOF STATE]
proof (prove)
using this:
h dvd reflect_poly (gcd f g)

goal (1 subgoal):
 1. h dvd normalize (reflect_poly (gcd f g))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h dvd normalize (reflect_poly (gcd f g))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lfinite_LCons: "lfinite (LCons x xs) = lfinite xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfinite (LCons x xs) = lfinite xs
[PROOF STEP]
using lfinite.simps
[PROOF STATE]
proof (prove)
using this:
lfinite ?a = (?a = LNil \<or> (\<exists>x xs. ?a = LCons x xs \<and> lfinite xs))

goal (1 subgoal):
 1. lfinite (LCons x xs) = lfinite xs
[PROOF STEP]
by auto


[STATEMENT]
lemma norm_blinfun_euclidean_le:
  fixes a::"'a::euclidean_space \<Rightarrow>\<^sub>L 'b::real_normed_vector"
  shows "norm a \<le> sum (\<lambda>x. norm (a x)) Basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm a \<le> (\<Sum>x\<in>Basis. norm (blinfun_apply a x))
[PROOF STEP]
apply (rule norm_blinfun_bound)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<le> (\<Sum>x\<in>Basis. norm (blinfun_apply a x))
 2. \<And>x. norm (blinfun_apply a x) \<le> (\<Sum>x\<in>Basis. norm (blinfun_apply a x)) * norm x
[PROOF STEP]
apply (simp add: sum_nonneg)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. norm (blinfun_apply a x) \<le> (\<Sum>x\<in>Basis. norm (blinfun_apply a x)) * norm x
[PROOF STEP]
apply (subst euclidean_representation[symmetric, where 'a='a])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. norm (blinfun_apply a (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b)) \<le> (\<Sum>x\<in>Basis. norm (blinfun_apply a x)) * norm x
[PROOF STEP]
apply (simp only: blinfun.bilinear_simps sum_distrib_right)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. norm (\<Sum>i\<in>Basis. (x \<bullet> i) *\<^sub>R blinfun_apply a i) \<le> (\<Sum>n\<in>Basis. norm (blinfun_apply a n) * norm x)
[PROOF STEP]
apply (rule order.trans[OF norm_sum sum_mono])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n. n \<in> Basis \<Longrightarrow> norm ((x \<bullet> n) *\<^sub>R blinfun_apply a n) \<le> norm (blinfun_apply a n) * norm x
[PROOF STEP]
apply (simp add: abs_mult mult_right_mono ac_simps Basis_le_norm)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma not_int_cmp_0 [simp]:
  fixes i :: int shows
  "0 < NOT i \<longleftrightarrow> i < -1"
  "0 \<le> NOT i \<longleftrightarrow> i < 0"
  "NOT i < 0 \<longleftrightarrow> i \<ge> 0"
  "NOT i \<le> 0 \<longleftrightarrow> i \<ge> -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0 < NOT i) = (i < - 1) &&& (0 \<le> NOT i) = (i < 0)) &&& (NOT i < 0) = (0 \<le> i) &&& (NOT i \<le> 0) = (- 1 \<le> i)
[PROOF STEP]
by(simp_all add: int_not_def) arith+


[STATEMENT]
lemma Bseq_iff2: "Bseq X \<longleftrightarrow> (\<exists>k > 0. \<exists>x. \<forall>n. norm (X n + - x) \<le> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bseq X = (\<exists>k>0. \<exists>x. \<forall>n. norm (X n + - x) \<le> k)
[PROOF STEP]
by (metis BseqE BseqI' add.commute add_cancel_right_left add_uminus_conv_diff norm_add_leD
            norm_minus_cancel norm_minus_commute)


[STATEMENT]
theorem Lang_eq2 :
"(w \<in> Lang G S \<and> 1 < length w) =
 (\<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B))"
(is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w \<in> Lang G S \<and> 1 < length w) = (\<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B))
[PROOF STEP]
proof(rule iffI, clarify, subst (asm) Lang_def, simp, subst (asm) trancl_unfold_left, clarsimp)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
have map_Inr_split : "\<And>xs. \<forall>zs w. map Inr w = xs \<cdot> zs \<longrightarrow>
                       (\<exists>u v. w = u \<cdot> v \<and> xs = map Inr u \<and> zs = map Inr v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. \<forall>zs w. map Inr w = xs \<cdot> zs \<longrightarrow> (\<exists>u v. w = u \<cdot> v \<and> xs = map Inr u \<and> zs = map Inr v)
[PROOF STEP]
by(induct_tac xs, simp, force)
[PROOF STATE]
proof (state)
this:
\<forall>zs w. map Inr w = ?xs \<cdot> zs \<longrightarrow> (\<exists>u v. w = u \<cdot> v \<and> ?xs = map Inr u \<and> zs = map Inr v)

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
assume a: "Suc 0 < length w"
[PROOF STATE]
proof (state)
this:
Suc 0 < length w

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
assume b: "[Inl S] -G\<rightarrow> t"
[PROOF STATE]
proof (state)
this:
[Inl S] -G\<rightarrow> t

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
assume c: "t -G\<rightarrow>\<^sup>* map Inr w"
[PROOF STATE]
proof (state)
this:
t -G\<rightarrow>\<^sup>* map Inr w

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
from b
[PROOF STATE]
proof (chain)
picking this:
[Inl S] -G\<rightarrow> t
[PROOF STEP]
have  "\<exists>A B. (S, Branch A B) \<in> set G \<and> t = [Inl A, Inl B]"
[PROOF STATE]
proof (prove)
using this:
[Inl S] -G\<rightarrow> t

goal (1 subgoal):
 1. \<exists>A B. (S, Branch A B) \<in> set G \<and> t = [Inl A, Inl B]
[PROOF STEP]
proof(simp add: DSTEP_def, clarify, case_tac l, simp_all, simp split: RHS.split_asm, clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l N rhs x2. \<lbrakk>[Inl S] -G\<rightarrow> [Inr x2]; (S, Leaf x2) \<in> set G; t = [Inr x2]; [Inl S] -G\<rightarrow> [Inr x2]\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l N rhs x2. \<lbrakk>[Inl S] -G\<rightarrow> [Inr x2]; (S, Leaf x2) \<in> set G; t = [Inr x2]; [Inl S] -G\<rightarrow> [Inr x2]\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "t = [Inr x]"
[PROOF STATE]
proof (state)
this:
t = [Inr x]

goal (1 subgoal):
 1. \<And>l N rhs x2. \<lbrakk>[Inl S] -G\<rightarrow> [Inr x2]; (S, Leaf x2) \<in> set G; t = [Inr x2]; [Inl S] -G\<rightarrow> [Inr x2]\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with c
[PROOF STATE]
proof (chain)
picking this:
t -G\<rightarrow>\<^sup>* map Inr w
t = [Inr x]
[PROOF STEP]
have d: "[Inr x] -G\<rightarrow>\<^sup>* map Inr w"
[PROOF STATE]
proof (prove)
using this:
t -G\<rightarrow>\<^sup>* map Inr w
t = [Inr x]

goal (1 subgoal):
 1. [Inr x] -G\<rightarrow>\<^sup>* map Inr w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[Inr x] -G\<rightarrow>\<^sup>* map Inr w

goal (1 subgoal):
 1. \<And>l N rhs x2. \<lbrakk>[Inl S] -G\<rightarrow> [Inr x2]; (S, Leaf x2) \<in> set G; t = [Inr x2]; [Inl S] -G\<rightarrow> [Inr x2]\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "\<And>x s. [Inr x] -G\<rightarrow>\<^sup>* s \<Longrightarrow> s = [Inr x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x s. [Inr x] -G\<rightarrow>\<^sup>* s \<Longrightarrow> s = [Inr x]
[PROOF STEP]
by(erule rtrancl_induct, simp_all, drule DSTEP_D, clarsimp, case_tac L, simp_all)
[PROOF STATE]
proof (state)
this:
[Inr ?x1] -G\<rightarrow>\<^sup>* ?s1 \<Longrightarrow> ?s1 = [Inr ?x1]

goal (1 subgoal):
 1. \<And>l N rhs x2. \<lbrakk>[Inl S] -G\<rightarrow> [Inr x2]; (S, Leaf x2) \<in> set G; t = [Inr x2]; [Inl S] -G\<rightarrow> [Inr x2]\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
note this[OF d]
[PROOF STATE]
proof (state)
this:
map Inr w = [Inr x]

goal (1 subgoal):
 1. \<And>l N rhs x2. \<lbrakk>[Inl S] -G\<rightarrow> [Inr x2]; (S, Leaf x2) \<in> set G; t = [Inr x2]; [Inl S] -G\<rightarrow> [Inr x2]\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "w = [x]"
[PROOF STATE]
proof (prove)
using this:
map Inr w = [Inr x]

goal (1 subgoal):
 1. w = [x]
[PROOF STEP]
by(case_tac w, simp_all)
[PROOF STATE]
proof (state)
this:
w = [x]

goal (1 subgoal):
 1. \<And>l N rhs x2. \<lbrakk>[Inl S] -G\<rightarrow> [Inr x2]; (S, Leaf x2) \<in> set G; t = [Inr x2]; [Inl S] -G\<rightarrow> [Inr x2]\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
Suc 0 < length w
w = [x]
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
Suc 0 < length w
w = [x]

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>A B. (S, Branch A B) \<in> set G \<and> t = [Inl A, Inl B]

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A B. (S, Branch A B) \<in> set G \<and> t = [Inl A, Inl B]
[PROOF STEP]
obtain A B where d: "(S, Branch A B) \<in> set G \<and> t = [Inl A, Inl B]"
[PROOF STATE]
proof (prove)
using this:
\<exists>A B. (S, Branch A B) \<in> set G \<and> t = [Inl A, Inl B]

goal (1 subgoal):
 1. (\<And>A B. (S, Branch A B) \<in> set G \<and> t = [Inl A, Inl B] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(S, Branch A B) \<in> set G \<and> t = [Inl A, Inl B]

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
with c
[PROOF STATE]
proof (chain)
picking this:
t -G\<rightarrow>\<^sup>* map Inr w
(S, Branch A B) \<in> set G \<and> t = [Inl A, Inl B]
[PROOF STEP]
have e: "[Inl A] \<cdot> [Inl B] -G\<rightarrow>\<^sup>* map Inr w"
[PROOF STATE]
proof (prove)
using this:
t -G\<rightarrow>\<^sup>* map Inr w
(S, Branch A B) \<in> set G \<and> t = [Inl A, Inl B]

goal (1 subgoal):
 1. [Inl A] \<cdot> [Inl B] -G\<rightarrow>\<^sup>* map Inr w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[Inl A] \<cdot> [Inl B] -G\<rightarrow>\<^sup>* map Inr w

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
note DSTEP_star_comp1[OF e]
[PROOF STATE]
proof (state)
this:
\<exists>l' r'. [Inl A] -G\<rightarrow>\<^sup>* l' \<and> [Inl B] -G\<rightarrow>\<^sup>* r' \<and> map Inr w = l' \<cdot> r'

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>l' r'. [Inl A] -G\<rightarrow>\<^sup>* l' \<and> [Inl B] -G\<rightarrow>\<^sup>* r' \<and> map Inr w = l' \<cdot> r'
[PROOF STEP]
obtain l' r' where e: "[Inl A] -G\<rightarrow>\<^sup>* l' \<and> [Inl B] -G\<rightarrow>\<^sup>* r' \<and>
                              map Inr w = l'  \<cdot>  r'"
[PROOF STATE]
proof (prove)
using this:
\<exists>l' r'. [Inl A] -G\<rightarrow>\<^sup>* l' \<and> [Inl B] -G\<rightarrow>\<^sup>* r' \<and> map Inr w = l' \<cdot> r'

goal (1 subgoal):
 1. (\<And>l' r'. [Inl A] -G\<rightarrow>\<^sup>* l' \<and> [Inl B] -G\<rightarrow>\<^sup>* r' \<and> map Inr w = l' \<cdot> r' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[Inl A] -G\<rightarrow>\<^sup>* l' \<and> [Inl B] -G\<rightarrow>\<^sup>* r' \<and> map Inr w = l' \<cdot> r'

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
note map_Inr_split[rule_format, OF e[THEN conjunct2, THEN conjunct2]]
[PROOF STATE]
proof (state)
this:
\<exists>u v. w = u \<cdot> v \<and> l' = map Inr u \<and> r' = map Inr v

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>u v. w = u \<cdot> v \<and> l' = map Inr u \<and> r' = map Inr v
[PROOF STEP]
obtain u v where f: "w = u \<cdot> v \<and> l' = map Inr u \<and> r' = map Inr v"
[PROOF STATE]
proof (prove)
using this:
\<exists>u v. w = u \<cdot> v \<and> l' = map Inr u \<and> r' = map Inr v

goal (1 subgoal):
 1. (\<And>u v. w = u \<cdot> v \<and> l' = map Inr u \<and> r' = map Inr v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
w = u \<cdot> v \<and> l' = map Inr u \<and> r' = map Inr v

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
with e
[PROOF STATE]
proof (chain)
picking this:
[Inl A] -G\<rightarrow>\<^sup>* l' \<and> [Inl B] -G\<rightarrow>\<^sup>* r' \<and> map Inr w = l' \<cdot> r'
w = u \<cdot> v \<and> l' = map Inr u \<and> r' = map Inr v
[PROOF STEP]
have g: "[Inl A] -G\<rightarrow>\<^sup>* map Inr u \<and> [Inl B] -G\<rightarrow>\<^sup>* map Inr v"
[PROOF STATE]
proof (prove)
using this:
[Inl A] -G\<rightarrow>\<^sup>* l' \<and> [Inl B] -G\<rightarrow>\<^sup>* r' \<and> map Inr w = l' \<cdot> r'
w = u \<cdot> v \<and> l' = map Inr u \<and> r' = map Inr v

goal (1 subgoal):
 1. [Inl A] -G\<rightarrow>\<^sup>* map Inr u \<and> [Inl B] -G\<rightarrow>\<^sup>* map Inr v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[Inl A] -G\<rightarrow>\<^sup>* map Inr u \<and> [Inl B] -G\<rightarrow>\<^sup>* map Inr v

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Suc 0 < length w; [Inl S] -G\<rightarrow> y; y -G\<rightarrow>\<^sup>* map Inr w\<rbrakk> \<Longrightarrow> \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
 2. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
show "?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
[PROOF STEP]
by(rule_tac x=A in exI, rule_tac x=B in exI, simp add: d,
     rule_tac x=u in exI, rule_tac x=v in exI, simp add: f,
     (subst Lang_rtrancl_eq)+, rule g)
[PROOF STATE]
proof (state)
this:
\<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)

goal (1 subgoal):
 1. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
assume "?R"
[PROOF STATE]
proof (state)
this:
\<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)

goal (1 subgoal):
 1. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)
[PROOF STEP]
obtain A B l r where a: "(S, Branch A B) \<in> set G \<and> w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B"
[PROOF STATE]
proof (prove)
using this:
\<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B)

goal (1 subgoal):
 1. (\<And>A B l r. (S, Branch A B) \<in> set G \<and> w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(S, Branch A B) \<in> set G \<and> w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B

goal (1 subgoal):
 1. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
have "[Inl A] \<cdot> [Inl B] -G\<rightarrow>\<^sup>* map Inr l \<cdot> map Inr r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [Inl A] \<cdot> [Inl B] -G\<rightarrow>\<^sup>* map Inr l \<cdot> map Inr r
[PROOF STEP]
by(rule DSTEP_star_comp2, subst Lang_rtrancl_eq[THEN sym], simp add: a,
     subst Lang_rtrancl_eq[THEN sym], simp add: a)
[PROOF STATE]
proof (state)
this:
[Inl A] \<cdot> [Inl B] -G\<rightarrow>\<^sup>* map Inr l \<cdot> map Inr r

goal (1 subgoal):
 1. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
hence b: "[Inl A] \<cdot> [Inl B] -G\<rightarrow>\<^sup>* map Inr w"
[PROOF STATE]
proof (prove)
using this:
[Inl A] \<cdot> [Inl B] -G\<rightarrow>\<^sup>* map Inr l \<cdot> map Inr r

goal (1 subgoal):
 1. [Inl A] \<cdot> [Inl B] -G\<rightarrow>\<^sup>* map Inr w
[PROOF STEP]
by(simp add: a)
[PROOF STATE]
proof (state)
this:
[Inl A] \<cdot> [Inl B] -G\<rightarrow>\<^sup>* map Inr w

goal (1 subgoal):
 1. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
have c: "w \<in> Lang G S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> Lang G S
[PROOF STEP]
by(simp add: Lang_def, subst trancl_unfold_left, rule_tac b="[Inl A] \<cdot> [Inl B]" in relcompI,
     simp add: DSTEP_def, rule_tac x="[]" in exI, rule_tac x="S" in exI, rule_tac x="[]" in exI,
     simp, rule_tac x="Branch A B" in exI, simp add:  a[THEN conjunct1], rule b)
[PROOF STATE]
proof (state)
this:
w \<in> Lang G S

goal (1 subgoal):
 1. \<exists>A B. (S, Branch A B) \<in> set G \<and> (\<exists>l r. w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B) \<Longrightarrow> w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
thus "?L"
[PROOF STATE]
proof (prove)
using this:
w \<in> Lang G S

goal (1 subgoal):
 1. w \<in> Lang G S \<and> 1 < length w
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < length w
[PROOF STEP]
show "1 < length w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length w
[PROOF STEP]
proof(simp add: a, rule ccontr, drule leI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length l + length r \<le> Suc 0 \<Longrightarrow> False
[PROOF STEP]
assume "length l + length r \<le> Suc 0"
[PROOF STATE]
proof (state)
this:
length l + length r \<le> Suc 0

goal (1 subgoal):
 1. length l + length r \<le> Suc 0 \<Longrightarrow> False
[PROOF STEP]
hence "l = [] \<or> r = []"
[PROOF STATE]
proof (prove)
using this:
length l + length r \<le> Suc 0

goal (1 subgoal):
 1. l = [] \<or> r = []
[PROOF STEP]
by(case_tac l, simp_all)
[PROOF STATE]
proof (state)
this:
l = [] \<or> r = []

goal (1 subgoal):
 1. length l + length r \<le> Suc 0 \<Longrightarrow> False
[PROOF STEP]
thus "False"
[PROOF STATE]
proof (prove)
using this:
l = [] \<or> r = []

goal (1 subgoal):
 1. False
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. l = [] \<Longrightarrow> False
 2. r = [] \<Longrightarrow> False
[PROOF STEP]
assume "l = []"
[PROOF STATE]
proof (state)
this:
l = []

goal (2 subgoals):
 1. l = [] \<Longrightarrow> False
 2. r = [] \<Longrightarrow> False
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
(S, Branch A B) \<in> set G \<and> w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B
l = []
[PROOF STEP]
have "[] \<in> Lang G A"
[PROOF STATE]
proof (prove)
using this:
(S, Branch A B) \<in> set G \<and> w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B
l = []

goal (1 subgoal):
 1. [] \<in> Lang G A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[] \<in> Lang G A

goal (2 subgoals):
 1. l = [] \<Longrightarrow> False
 2. r = [] \<Longrightarrow> False
[PROOF STEP]
note Lang_no_Nil[OF this]
[PROOF STATE]
proof (state)
this:
[] \<noteq> []

goal (2 subgoals):
 1. l = [] \<Longrightarrow> False
 2. r = [] \<Longrightarrow> False
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
[] \<noteq> []

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

goal (1 subgoal):
 1. r = [] \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r = [] \<Longrightarrow> False
[PROOF STEP]
assume "r = []"
[PROOF STATE]
proof (state)
this:
r = []

goal (1 subgoal):
 1. r = [] \<Longrightarrow> False
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
(S, Branch A B) \<in> set G \<and> w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B
r = []
[PROOF STEP]
have "[] \<in> Lang G B"
[PROOF STATE]
proof (prove)
using this:
(S, Branch A B) \<in> set G \<and> w = l \<cdot> r \<and> l \<in> Lang G A \<and> r \<in> Lang G B
r = []

goal (1 subgoal):
 1. [] \<in> Lang G B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[] \<in> Lang G B

goal (1 subgoal):
 1. r = [] \<Longrightarrow> False
[PROOF STEP]
note Lang_no_Nil[OF this]
[PROOF STATE]
proof (state)
this:
[] \<noteq> []

goal (1 subgoal):
 1. r = [] \<Longrightarrow> False
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
[] \<noteq> []

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 < length w

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w \<in> Lang G S \<and> 1 < length w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cryptinverts: "\<lbrakk> prime p; prime q; p \<noteq> q; n = p*q; m < n;
    e*d mod ((pred p)*(pred q)) = 1\<rbrakk> \<Longrightarrow> rsa_crypt (rsa_crypt m e n) d n = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; prime q; p \<noteq> q; n = p * q; m < n; e * d mod (pred p * pred q) = 1\<rbrakk> \<Longrightarrow> rsa_crypt (rsa_crypt m e n) d n = m
[PROOF STEP]
apply (insert cryptinverts_hilf4 [of p q m "e*d"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; prime q; p \<noteq> q; n = p * q; m < n; e * d mod (pred p * pred q) = 1; \<lbrakk>prime p; prime q; p \<noteq> q; m < p * q; e * d mod (pred p * pred q) = 1\<rbrakk> \<Longrightarrow> m ^ (e * d) mod (p * q) = m\<rbrakk> \<Longrightarrow> rsa_crypt (rsa_crypt m e n) d n = m
[PROOF STEP]
apply (insert cryptcorrect [of "p*q" "rsa_crypt m e (p * q)" d])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; prime q; p \<noteq> q; n = p * q; m < n; e * d mod (pred p * pred q) = 1; \<lbrakk>prime p; prime q; p \<noteq> q; m < p * q; e * d mod (pred p * pred q) = 1\<rbrakk> \<Longrightarrow> m ^ (e * d) mod (p * q) = m; rsa_crypt (p * q) (rsa_crypt m e (p * q)) d = (p * q) ^ rsa_crypt m e (p * q) mod d\<rbrakk> \<Longrightarrow> rsa_crypt (rsa_crypt m e n) d n = m
[PROOF STEP]
apply (insert cryptcorrect [of "p*q" m e])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; prime q; p \<noteq> q; n = p * q; m < n; e * d mod (pred p * pred q) = 1; \<lbrakk>prime p; prime q; p \<noteq> q; m < p * q; e * d mod (pred p * pred q) = 1\<rbrakk> \<Longrightarrow> m ^ (e * d) mod (p * q) = m; rsa_crypt (p * q) (rsa_crypt m e (p * q)) d = (p * q) ^ rsa_crypt m e (p * q) mod d; rsa_crypt (p * q) m e = (p * q) ^ m mod e\<rbrakk> \<Longrightarrow> rsa_crypt (rsa_crypt m e n) d n = m
[PROOF STEP]
apply (insert primmultgreater2 [of p q])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; prime q; p \<noteq> q; n = p * q; m < n; e * d mod (pred p * pred q) = 1; \<lbrakk>prime p; prime q; p \<noteq> q; m < p * q; e * d mod (pred p * pred q) = 1\<rbrakk> \<Longrightarrow> m ^ (e * d) mod (p * q) = m; rsa_crypt (p * q) (rsa_crypt m e (p * q)) d = (p * q) ^ rsa_crypt m e (p * q) mod d; rsa_crypt (p * q) m e = (p * q) ^ m mod e; \<lbrakk>prime p; prime q; p \<noteq> q\<rbrakk> \<Longrightarrow> 2 < p * q\<rbrakk> \<Longrightarrow> rsa_crypt (rsa_crypt m e n) d n = m
[PROOF STEP]
apply (simp add: prime_nat_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Suc 0 < p \<and> (\<forall>m. m dvd p \<longrightarrow> m = Suc 0 \<or> m = p); Suc 0 < q \<and> (\<forall>m. m dvd q \<longrightarrow> m = Suc 0 \<or> m = q); p \<noteq> q; n = p * q; m < p * q; e * d mod (pred p * pred q) = Suc 0; m ^ (e * d) mod (p * q) = m; rsa_crypt (p * q) (rsa_crypt m e (p * q)) d = (p * q) ^ rsa_crypt m e (p * q) mod d; rsa_crypt (p * q) m e = (p * q) ^ m mod e; 2 < p * q\<rbrakk> \<Longrightarrow> rsa_crypt (rsa_crypt m e (p * q)) d (p * q) = m
[PROOF STEP]
apply (simp add: cryptcorrect remainderexp [of "m^e" "p*q" d] power_mult [symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pmf_bind: "pmf (bind_pmf N f) i = (\<integral>x. pmf (f x) i \<partial>measure_pmf N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (N \<bind> f) i = measure_pmf.expectation N (\<lambda>x. pmf (f x) i)
[PROOF STEP]
using ennreal_pmf_bind[of N f i]
[PROOF STATE]
proof (prove)
using this:
ennreal (pmf (N \<bind> f) i) = \<integral>\<^sup>+ x. ennreal (pmf (f x) i) \<partial>measure_pmf N

goal (1 subgoal):
 1. pmf (N \<bind> f) i = measure_pmf.expectation N (\<lambda>x. pmf (f x) i)
[PROOF STEP]
by (subst (asm) nn_integral_eq_integral)
     (auto simp: pmf_nonneg pmf_le_1 pmf_nonneg integral_nonneg
           intro!: nn_integral_eq_integral[symmetric] measure_pmf.integrable_const_bound[where B=1])


[STATEMENT]
lemma ordinal_mod_0: "x mod 0 = (x::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod 0 = x
[PROOF STEP]
by (simp add: mod_ordinal_def)


[STATEMENT]
theorem elgamal_secure:
  "negligible (\<lambda>\<eta>. ind_cpa.advantage \<eta> (\<A> \<eta>))" if "negligible (\<lambda>\<eta>. ddh.advantage \<eta> (elgamal_adversary \<eta> (\<A> \<eta>)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Negligible.negligible (\<lambda>\<eta>. local.ind_cpa.advantage \<eta> (\<A> \<eta>))
[PROOF STEP]
by(simp add: advantage_elgamal that)


[STATEMENT]
lemma contractible_imp_path_connected:
  fixes S :: "_::real_normed_vector set"
  shows "contractible S \<Longrightarrow> path_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contractible S \<Longrightarrow> path_connected S
[PROOF STEP]
by (simp add: contractible_imp_simply_connected simply_connected_imp_path_connected)


[STATEMENT]
lemma ordinal_plus_absorb_iff: "(x + y = y) = (x * \<omega> \<le> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y = y) = (x * \<omega> \<le> y)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x + y = y \<Longrightarrow> x * \<omega> \<le> y
 2. x * \<omega> \<le> y \<Longrightarrow> x + y = y
[PROOF STEP]
apply (rule ccontr, simp add: linorder_not_le)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x + y = y; y < x * \<omega>\<rbrakk> \<Longrightarrow> False
 2. x * \<omega> \<le> y \<Longrightarrow> x + y = y
[PROOF STEP]
apply (drule ordinal_less_plusL, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * \<omega> \<le> y \<Longrightarrow> x + y = y
[PROOF STEP]
apply (erule ordinal_plus_absorb)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in group) trivial_group_subset:
   "trivial_group G \<longleftrightarrow> carrier G \<subseteq> {one G}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trivial_group G = (carrier G \<subseteq> {\<one>})
[PROOF STEP]
using is_group trivial_group_def
[PROOF STATE]
proof (prove)
using this:
Group.group G
trivial_group ?G \<equiv> Group.group ?G \<and> carrier ?G = {\<one>\<^bsub>?G\<^esub>}

goal (1 subgoal):
 1. trivial_group G = (carrier G \<subseteq> {\<one>})
[PROOF STEP]
by fastforce


[STATEMENT]
lemma isomorphism_trans:
  "\<lbrakk>\<exists>f \<in> iso G1 G2. \<forall>x \<in> carrier G1. r2(f x) = f(r1 x); \<exists>f \<in> iso G2 G3. \<forall>x \<in> carrier G2. r3(f x) = f(r2 x)\<rbrakk>
   \<Longrightarrow> \<exists>f \<in> iso G1 G3. \<forall>x \<in> carrier G1. r3(f x) = f(r1 x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>f\<in>Group.iso G1 G2. \<forall>x\<in>carrier G1. r2 (f x) = f (r1 x); \<exists>f\<in>Group.iso G2 G3. \<forall>x\<in>carrier G2. r3 (f x) = f (r2 x)\<rbrakk> \<Longrightarrow> \<exists>f\<in>Group.iso G1 G3. \<forall>x\<in>carrier G1. r3 (f x) = f (r1 x)
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f fa. \<lbrakk>f \<in> Group.iso G1 G2; \<forall>x\<in>carrier G1. r2 (f x) = f (r1 x); fa \<in> Group.iso G2 G3; \<forall>x\<in>carrier G2. r3 (fa x) = fa (r2 x)\<rbrakk> \<Longrightarrow> \<exists>f\<in>Group.iso G1 G3. \<forall>x\<in>carrier G1. r3 (f x) = f (r1 x)
[PROOF STEP]
apply (rename_tac g f)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g f. \<lbrakk>g \<in> Group.iso G1 G2; \<forall>x\<in>carrier G1. r2 (g x) = g (r1 x); f \<in> Group.iso G2 G3; \<forall>x\<in>carrier G2. r3 (f x) = f (r2 x)\<rbrakk> \<Longrightarrow> \<exists>f\<in>Group.iso G1 G3. \<forall>x\<in>carrier G1. r3 (f x) = f (r1 x)
[PROOF STEP]
apply (rule_tac x="f \<circ> g" in bexI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>g f. \<lbrakk>g \<in> Group.iso G1 G2; \<forall>x\<in>carrier G1. r2 (g x) = g (r1 x); f \<in> Group.iso G2 G3; \<forall>x\<in>carrier G2. r3 (f x) = f (r2 x)\<rbrakk> \<Longrightarrow> \<forall>x\<in>carrier G1. r3 ((f \<circ> g) x) = (f \<circ> g) (r1 x)
 2. \<And>g f. \<lbrakk>g \<in> Group.iso G1 G2; \<forall>x\<in>carrier G1. r2 (g x) = g (r1 x); f \<in> Group.iso G2 G3; \<forall>x\<in>carrier G2. r3 (f x) = f (r2 x)\<rbrakk> \<Longrightarrow> f \<circ> g \<in> Group.iso G1 G3
[PROOF STEP]
apply (metis iso_iff comp_apply hom_in_carrier)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g f. \<lbrakk>g \<in> Group.iso G1 G2; \<forall>x\<in>carrier G1. r2 (g x) = g (r1 x); f \<in> Group.iso G2 G3; \<forall>x\<in>carrier G2. r3 (f x) = f (r2 x)\<rbrakk> \<Longrightarrow> f \<circ> g \<in> Group.iso G1 G3
[PROOF STEP]
using iso_set_trans
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?h \<in> Group.iso ?G ?H; ?i \<in> Group.iso ?H ?I\<rbrakk> \<Longrightarrow> ?i \<circ> ?h \<in> Group.iso ?G ?I

goal (1 subgoal):
 1. \<And>g f. \<lbrakk>g \<in> Group.iso G1 G2; \<forall>x\<in>carrier G1. r2 (g x) = g (r1 x); f \<in> Group.iso G2 G3; \<forall>x\<in>carrier G2. r3 (f x) = f (r2 x)\<rbrakk> \<Longrightarrow> f \<circ> g \<in> Group.iso G1 G3
[PROOF STEP]
by blast


[STATEMENT]
lemma locally_iff:
    "locally P S \<longleftrightarrow>
     (\<forall>T x. open T \<and> x \<in> S \<inter> T \<longrightarrow> (\<exists>U. open U \<and> (\<exists>V. P V \<and> x \<in> S \<inter> U \<and> S \<inter> U \<subseteq> V \<and> V \<subseteq> S \<inter> T)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally P S = (\<forall>T x. open T \<and> x \<in> S \<inter> T \<longrightarrow> (\<exists>U. open U \<and> (\<exists>V. P V \<and> x \<in> S \<inter> U \<and> S \<inter> U \<subseteq> V \<and> V \<subseteq> S \<inter> T)))
[PROOF STEP]
apply (simp add: le_inf_iff locally_def openin_open, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>T x. \<lbrakk>\<forall>w x. (\<exists>T. open T \<and> w = S \<inter> T) \<and> x \<in> w \<longrightarrow> (\<exists>u. (\<exists>T. open T \<and> u = S \<inter> T) \<and> (\<exists>v. P v \<and> x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> w)); open T; x \<in> S; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>U. open U \<and> (\<exists>V. P V \<and> x \<in> U \<and> S \<inter> U \<subseteq> V \<and> V \<subseteq> S \<and> V \<subseteq> T)
 2. \<And>w x T. \<lbrakk>\<forall>T x. open T \<and> x \<in> S \<and> x \<in> T \<longrightarrow> (\<exists>U. open U \<and> (\<exists>V. P V \<and> x \<in> U \<and> S \<inter> U \<subseteq> V \<and> V \<subseteq> S \<and> V \<subseteq> T)); open T; x \<in> S; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>u. (\<exists>T. open T \<and> u = S \<inter> T) \<and> (\<exists>v. P v \<and> x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<inter> T)
[PROOF STEP]
apply (metis IntE IntI le_inf_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w x T. \<lbrakk>\<forall>T x. open T \<and> x \<in> S \<and> x \<in> T \<longrightarrow> (\<exists>U. open U \<and> (\<exists>V. P V \<and> x \<in> U \<and> S \<inter> U \<subseteq> V \<and> V \<subseteq> S \<and> V \<subseteq> T)); open T; x \<in> S; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>u. (\<exists>T. open T \<and> u = S \<inter> T) \<and> (\<exists>v. P v \<and> x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<inter> T)
[PROOF STEP]
apply (metis IntI Int_subset_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma trans_relcl: "lattice L ==> trans (relcl L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice L \<Longrightarrow> trans (relcl L)
[PROOF STEP]
by (blast intro: relcl_trans transI)


[STATEMENT]
lemma ccApprox_below_iff: "ccApprox t \<sqsubseteq> G \<longleftrightarrow> (\<forall> xs \<in> paths t. ccFromList xs \<sqsubseteq> G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ccApprox t \<sqsubseteq> G) = (\<forall>xs\<in>paths t. ccFromList xs \<sqsubseteq> G)
[PROOF STEP]
unfolding ccApprox_paths
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lub (ccFromList ` paths t) \<sqsubseteq> G) = (\<forall>xs\<in>paths t. ccFromList xs \<sqsubseteq> G)
[PROOF STEP]
by transfer auto


[STATEMENT]
lemma map_of_zip_Some:
     "v < length xs
        \<Longrightarrow> (map_of (zip [0..<length xs] xs) v) = Some (xs ! v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v < length xs \<Longrightarrow> map_of (zip [0..<length xs] xs) v = Some (xs ! v)
[PROOF STEP]
by (induction xs rule: rev_induct) (auto simp add: nth_append map_add_Some_iff)


[STATEMENT]
lemma point_diff [simp]:
  "Point xA yA - Point xB yB = Point (xA - xB) (yA - yB)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Point xA yA - Point xB yB = Point (xA - xB) (yA - yB)
[PROOF STEP]
by (simp add: point_diff_def)


[STATEMENT]
lemma infinite_halfspace_Im_gt: "infinite {x. Im x > b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {x. b < Im x}
[PROOF STEP]
apply (rule connected_uncountable[THEN uncountable_infinite,of _ "(b+1)* \<i>" "(b+2)*\<i>"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. connected {x. b < Im x}
 2. complex_of_real (b + 1) * \<i> \<in> {x. b < Im x}
 3. complex_of_real (b + 2) * \<i> \<in> {x. b < Im x}
 4. complex_of_real (b + 1) * \<i> \<noteq> complex_of_real (b + 2) * \<i>
[PROOF STEP]
by (auto intro!:convex_connected simp add: convex_halfspace_Im_gt)


[STATEMENT]
lemma stable_Union:
    "(!!A. A \<in> X ==> F \<in> stable A) ==> F \<in> stable (\<Union>X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> X \<Longrightarrow> F \<in> UNITY.stable A) \<Longrightarrow> F \<in> UNITY.stable (\<Union> X)
[PROOF STEP]
by (unfold stable_def constrains_def, blast)


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

  assumes "P \<simeq> Q"
  and     "Q \<simeq> R"

  shows "P \<simeq> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<simeq> R
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<simeq> R
[PROOF STEP]
have Goal: "\<And>P Q R. \<lbrakk>P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q; Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> R; P \<approx> Q\<rbrakk> \<Longrightarrow> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P Q R. \<lbrakk>P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q; Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> R; P \<approx> Q\<rbrakk> \<Longrightarrow> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> R
[PROOF STEP]
using Weak_Early_Bisim.eqvt Weak_Early_Bisim.weakBisimE Weak_Early_Bisim.transitive
[PROOF STATE]
proof (prove)
using this:
eqvt weakBisim
?P \<approx> ?Q \<Longrightarrow> ?P \<leadsto><weakBisim> ?Q
?P \<approx> ?Q \<Longrightarrow> ?Q \<approx> ?P
\<lbrakk>?P \<approx> ?Q; ?Q \<approx> ?R\<rbrakk> \<Longrightarrow> ?P \<approx> ?R

goal (1 subgoal):
 1. \<And>P Q R. \<lbrakk>P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q; Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> R; P \<approx> Q\<rbrakk> \<Longrightarrow> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> R
[PROOF STEP]
by(blast intro: Weak_Early_Step_Sim.transitive)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> ?Q; ?Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> ?R; ?P \<approx> ?Q\<rbrakk> \<Longrightarrow> ?P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> ?R

goal (1 subgoal):
 1. P \<simeq> R
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
P \<simeq> Q
Q \<simeq> R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P \<simeq> Q
Q \<simeq> R

goal (1 subgoal):
 1. P \<simeq> R
[PROOF STEP]
apply(simp add: weakCongruence_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q \<and> Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> P; Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> R \<and> R \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q\<rbrakk> \<Longrightarrow> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> R \<and> R \<leadsto>\<guillemotleft>weakBisim\<guillemotright> P
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P \<simeq> Q
Q \<simeq> R

goal (1 subgoal):
 1. \<lbrakk>P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q \<and> Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> P; Q \<leadsto>\<guillemotleft>weakBisim\<guillemotright> R \<and> R \<leadsto>\<guillemotleft>weakBisim\<guillemotright> Q\<rbrakk> \<Longrightarrow> P \<leadsto>\<guillemotleft>weakBisim\<guillemotright> R \<and> R \<leadsto>\<guillemotleft>weakBisim\<guillemotright> P
[PROOF STEP]
by(blast intro: Goal dest: congruenceWeakBisim symetric)
[PROOF STATE]
proof (state)
this:
P \<simeq> R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma countable_image_inj_Int_vimage:
   "\<lbrakk>inj_on f S; countable A\<rbrakk> \<Longrightarrow> countable (S \<inter> f -` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f S; countable A\<rbrakk> \<Longrightarrow> countable (S \<inter> f -` A)
[PROOF STEP]
by (meson countable_image_inj_on countable_subset image_subset_iff_subset_vimage inf_le2 inj_on_Int)


[STATEMENT]
lemma eq_effect_eq_vset:
  fixes x y
  assumes "(snd x = snd y)"
  shows "((\<lambda>a. varset_action a vs) x = (\<lambda>a. varset_action a vs) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. varset_action x vs = varset_action y vs
[PROOF STEP]
unfolding varset_action_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fmdom' (snd x) \<subseteq> vs) = (fmdom' (snd y) \<subseteq> vs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
snd x = snd y

goal (1 subgoal):
 1. (fmdom' (snd x) \<subseteq> vs) = (fmdom' (snd y) \<subseteq> vs)
[PROOF STEP]
by presburger


[STATEMENT]
lemma pj_zero:"\<lbrakk>Ring R; ideal R I; x \<in> carrier R\<rbrakk> \<Longrightarrow>
                         (pj R I x = \<zero>\<^bsub>(R /\<^sub>r I)\<^esub>) = (x \<in> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring R; ideal R I; x \<in> carrier R\<rbrakk> \<Longrightarrow> (pj R I x = \<zero>\<^bsub>R /\<^sub>r I\<^esub>) = (x \<in> I)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Ring R; ideal R I; x \<in> carrier R; pj R I x = \<zero>\<^bsub>R /\<^sub>r I\<^esub>\<rbrakk> \<Longrightarrow> x \<in> I
 2. \<lbrakk>Ring R; ideal R I; x \<in> carrier R; x \<in> I\<rbrakk> \<Longrightarrow> pj R I x = \<zero>\<^bsub>R /\<^sub>r I\<^esub>
[PROOF STEP]
apply (simp add:pj_mem Ring.qring_zero,
       simp add:Ring.qring_zero_1[of "R" "x" "I"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring R; ideal R I; x \<in> carrier R; x \<in> I\<rbrakk> \<Longrightarrow> pj R I x = \<zero>\<^bsub>R /\<^sub>r I\<^esub>
[PROOF STEP]
apply (simp add:pj_mem Ring.qring_zero,
       rule Ring.Qring_fix1, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma l_unit_gHom:"\<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> (I\<^bsub>G\<^esub>) \<circ>\<^bsub>F\<^esub> f = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> I\<^bsub>G\<^esub> \<circ>\<^bsub>F\<^esub> f = f
[PROOF STEP]
apply (simp add:cmpghom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> compose (carrier F) I\<^bsub>G\<^esub> f = f
[PROOF STEP]
apply (rule funcset_eq[of _ "carrier F"],
       simp add:compose_def, simp add:gHom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> \<forall>x\<in>carrier F. compose (carrier F) I\<^bsub>G\<^esub> f x = f x
[PROOF STEP]
apply (rule ballI,
       simp add:idmap_def compose_def,
       simp add:gHom_mem[of "F" "G" "f"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma irreducible_dvd_degree: assumes "(f::'a::field poly) dvd g"
 "irreducible g"
 "degree f > 0"
 shows "degree f = degree g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree f = degree g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f dvd g
irreducible g
0 < degree f

goal (1 subgoal):
 1. degree f = degree g
[PROOF STEP]
by (metis irreducible_altdef degree_0 dvd_refl is_unit_field_poly linorder_neqE_nat poly_divides_conv0)


[STATEMENT]
lemma isPrefixPrefixToLevelLowerLevel:
assumes "level < level'"
shows "isPrefix (prefixToLevel level M) (prefixToLevel level' M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isPrefix (prefixToLevel level M) (prefixToLevel level' M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
level < level'

goal (1 subgoal):
 1. isPrefix (prefixToLevel level M) (prefixToLevel level' M)
[PROOF STEP]
unfolding prefixToLevel_def
[PROOF STATE]
proof (prove)
using this:
level < level'

goal (1 subgoal):
 1. isPrefix (prefixToLevel_aux M level 0) (prefixToLevel_aux M level' 0)
[PROOF STEP]
using isPrefixPrefixToLevel_auxLowerLevel[of "level" "level'" "M" "0"]
[PROOF STATE]
proof (prove)
using this:
level < level'
level \<le> level' \<Longrightarrow> isPrefix (prefixToLevel_aux M level 0) (prefixToLevel_aux M level' 0)

goal (1 subgoal):
 1. isPrefix (prefixToLevel_aux M level 0) (prefixToLevel_aux M level' 0)
[PROOF STEP]
by simp


[STATEMENT]
theorem (in domain) frobenius_hom:
  assumes "char R  > 0"
  assumes "m = char R ^ k"
  shows "ring_hom_cring R R (\<lambda>x. x [^] m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_hom_cring R R (\<lambda>x. x [^] m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ring_hom_cring R R (\<lambda>x. x [^] m)
[PROOF STEP]
have a:"(x \<otimes> y) [^] m = x [^] m \<otimes> y [^] m"
    if b:"x \<in> carrier R" "y \<in> carrier R" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<otimes> y) [^] m = x [^] m \<otimes> y [^] m
[PROOF STEP]
using b nat_pow_distrib
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
y \<in> carrier R
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R\<rbrakk> \<Longrightarrow> (?x \<otimes> ?y) [^] ?n = ?x [^] ?n \<otimes> ?y [^] ?n

goal (1 subgoal):
 1. (x \<otimes> y) [^] m = x [^] m \<otimes> y [^] m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R\<rbrakk> \<Longrightarrow> (?x \<otimes> ?y) [^] m = ?x [^] m \<otimes> ?y [^] m

goal (1 subgoal):
 1. ring_hom_cring R R (\<lambda>x. x [^] m)
[PROOF STEP]
have b:"(x \<oplus> y) [^] m = x [^] m \<oplus> y [^] m"
    if b:"x \<in> carrier R" "y \<in> carrier R" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus> y) [^] m = x [^] m \<oplus> y [^] m
[PROOF STEP]
unfolding assms(2) freshmans_dream_ext[OF assms(1) b]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^] char R ^ k \<oplus> y [^] char R ^ k = x [^] char R ^ k \<oplus> y [^] char R ^ k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R\<rbrakk> \<Longrightarrow> (?x \<oplus> ?y) [^] m = ?x [^] m \<oplus> ?y [^] m

goal (1 subgoal):
 1. ring_hom_cring R R (\<lambda>x. x [^] m)
[PROOF STEP]
have "ring_hom_ring R R (\<lambda>x. x [^] m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_hom_ring R R (\<lambda>x. x [^] m)
[PROOF STEP]
by  (intro ring_hom_ringI a b ring_axioms, simp_all)
[PROOF STATE]
proof (state)
this:
ring_hom_ring R R (\<lambda>x. x [^] m)

goal (1 subgoal):
 1. ring_hom_cring R R (\<lambda>x. x [^] m)
[PROOF STEP]
thus "?thesis"
[PROOF STATE]
proof (prove)
using this:
ring_hom_ring R R (\<lambda>x. x [^] m)

goal (1 subgoal):
 1. ring_hom_cring R R (\<lambda>x. x [^] m)
[PROOF STEP]
using RingHom.ring_hom_cringI is_cring
[PROOF STATE]
proof (prove)
using this:
ring_hom_ring R R (\<lambda>x. x [^] m)
\<lbrakk>ring_hom_ring ?R ?S ?h; cring ?R; cring ?S\<rbrakk> \<Longrightarrow> ring_hom_cring ?R ?S ?h
cring R

goal (1 subgoal):
 1. ring_hom_cring R R (\<lambda>x. x [^] m)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ring_hom_cring R R (\<lambda>x. x [^] m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma INF_Pair: "(INF x\<in>A. (f x, g x)) = (INF x\<in>A. f x, INF x\<in>A. g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF x\<in>A. (f x, g x)) = (Inf (f ` A), Inf (g ` A))
[PROOF STEP]
by (simp add: Inf_prod_def image_image)


[STATEMENT]
lemma sigma_sets_le_sets_iff: "(sigma_sets (space x) \<A> \<subseteq> sets x) = (\<A> \<subseteq> sets x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sigma_sets (space x) \<A> \<subseteq> sets x) = (\<A> \<subseteq> sets x)
[PROOF STEP]
using sets.sigma_sets_subset[of \<A> x]
[PROOF STATE]
proof (prove)
using this:
\<A> \<subseteq> sets x \<Longrightarrow> sigma_sets (space x) \<A> \<subseteq> sets x

goal (1 subgoal):
 1. (sigma_sets (space x) \<A> \<subseteq> sets x) = (\<A> \<subseteq> sets x)
[PROOF STEP]
by auto


[STATEMENT]
lemma vars_clause_add_mset[simp]: "vars_clause (add_mset L C) = vars_lit L \<union> vars_clause C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars_clause (add_mset L C) = vars_lit L \<union> vars_clause C
[PROOF STEP]
unfolding vars_clause_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set_mset (image_mset vars_lit (add_mset L C))) = vars_lit L \<union> \<Union> (set_mset (image_mset vars_lit C))
[PROOF STEP]
by auto


[STATEMENT]
lemma change_row_index[simp]: "A \<in> carrier_mat nr nc \<Longrightarrow> i < nr \<Longrightarrow> j < nc \<Longrightarrow>
  change_row k f A $$ (i,j) = (if i = k then f j (A $$ (k,j)) else A $$ (i,j))"
  "i < dim_row A \<Longrightarrow> j < dim_col A \<Longrightarrow> change_row k f A $$ (i,j) = (if i = k then f j (A $$ (k,j)) else A $$ (i,j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>A \<in> carrier_mat nr nc; i < nr; j < nc\<rbrakk> \<Longrightarrow> change_row k f A $$ (i, j) = (if i = k then f j (A $$ (k, j)) else A $$ (i, j))) &&& (\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> change_row k f A $$ (i, j) = (if i = k then f j (A $$ (k, j)) else A $$ (i, j)))
[PROOF STEP]
unfolding change_row_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>A \<in> carrier_mat nr nc; i < nr; j < nc\<rbrakk> \<Longrightarrow> mat (dim_row A) (dim_col A) (\<lambda>(i, j). if i = k then f j (A $$ (k, j)) else A $$ (i, j)) $$ (i, j) = (if i = k then f j (A $$ (k, j)) else A $$ (i, j))) &&& (\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> mat (dim_row A) (dim_col A) (\<lambda>(i, j). if i = k then f j (A $$ (k, j)) else A $$ (i, j)) $$ (i, j) = (if i = k then f j (A $$ (k, j)) else A $$ (i, j)))
[PROOF STEP]
by auto


[STATEMENT]
lemma ideal_GB_Macaulay_Dube: "ideal (set (GB_Macaulay_Dube fs)) = ideal (set fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal (set (GB_Macaulay_Dube fs)) = ideal (set fs)
[PROOF STEP]
by (simp add: GB_Macaulay_Dube_def punit.pmdl_Macaulay_list[simplified] ideal_deg_shifts_pp)


[STATEMENT]
lemma cv_inv_version3:
  fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_"
  assumes der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)"
    and der_h: "\<And>y. y \<in> T \<Longrightarrow> (h has_derivative h' y) (at y within T)"
    and hg: "\<And>x. x \<in> S \<Longrightarrow> g x \<in> T \<and> h(g x) = x"
    and gh: "\<And>y. y \<in> T \<Longrightarrow> h y \<in> S \<and> g(h y) = y"
    and id: "\<And>y. y \<in> T \<Longrightarrow> h' y \<circ> g'(h y) = id"
  shows "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and>
             integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) = b
         \<longleftrightarrow> f absolutely_integrable_on T \<and> integral T f = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on T \<and> integral T f = b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on T \<and> integral T f = b)
[PROOF STEP]
let ?D = "\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on T \<and> integral T f = b)
[PROOF STEP]
have "((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x) $ i) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * (f(g x) $ i)) = b $ i) \<longleftrightarrow>
        ((\<lambda>x. f x $ i) absolutely_integrable_on T \<and> integral T (\<lambda>x. f x $ i) = b $ i)" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x) $ i) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x) $ i) = b $ i) = ((\<lambda>x. f x $ i) absolutely_integrable_on T \<and> integral T (\<lambda>x. f x $ i) = b $ i)
[PROOF STEP]
by (rule cov_invertible_real [OF der_g der_h hg gh id])
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x) $ ?i) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x) $ ?i) = b $ ?i) = ((\<lambda>x. f x $ ?i) absolutely_integrable_on T \<and> integral T (\<lambda>x. f x $ ?i) = b $ ?i)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on T \<and> integral T f = b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x) $ ?i) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x) $ ?i) = b $ ?i) = ((\<lambda>x. f x $ ?i) absolutely_integrable_on T \<and> integral T (\<lambda>x. f x $ ?i) = b $ ?i)
[PROOF STEP]
have "?D absolutely_integrable_on S \<and> (?D has_integral b) S \<longleftrightarrow>
        f absolutely_integrable_on T \<and> (f has_integral b) T"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x) $ ?i) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x) $ ?i) = b $ ?i) = ((\<lambda>x. f x $ ?i) absolutely_integrable_on T \<and> integral T (\<lambda>x. f x $ ?i) = b $ ?i)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) has_integral b) S) = (f absolutely_integrable_on T \<and> (f has_integral b) T)
[PROOF STEP]
unfolding absolutely_integrable_componentwise_iff [where f=f] has_integral_componentwise_iff [of f]
              absolutely_integrable_componentwise_iff [where f="?D"] has_integral_componentwise_iff [of ?D]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x) $ ?i) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x) $ ?i) = b $ ?i) = ((\<lambda>x. f x $ ?i) absolutely_integrable_on T \<and> integral T (\<lambda>x. f x $ ?i) = b $ ?i)

goal (1 subgoal):
 1. ((\<forall>b\<in>Basis. (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<bullet> b) absolutely_integrable_on S) \<and> (\<forall>ba\<in>Basis. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<bullet> ba) has_integral b \<bullet> ba) S)) = ((\<forall>b\<in>Basis. (\<lambda>x. f x \<bullet> b) absolutely_integrable_on T) \<and> (\<forall>ba\<in>Basis. ((\<lambda>x. f x \<bullet> ba) has_integral b \<bullet> ba) T))
[PROOF STEP]
by (auto simp: all_conj_distrib Basis_vec_def cart_eq_inner_axis [symmetric]
           has_integral_iff set_lebesgue_integral_eq_integral)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) has_integral b) S) = (f absolutely_integrable_on T \<and> (f has_integral b) T)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on T \<and> integral T f = b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) has_integral b) S) = (f absolutely_integrable_on T \<and> (f has_integral b) T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) has_integral b) S) = (f absolutely_integrable_on T \<and> (f has_integral b) T)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on T \<and> integral T f = b)
[PROOF STEP]
using absolutely_integrable_on_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) has_integral b) S) = (f absolutely_integrable_on T \<and> (f has_integral b) T)
(?f absolutely_integrable_on ?S) = (?f integrable_on ?S \<and> (\<lambda>x. norm (?f x)) integrable_on ?S)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on T \<and> integral T f = b)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on T \<and> integral T f = b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disj_pre:
  "p \<in> Pre_expression \<Longrightarrow> q \<in> Pre_expression \<Longrightarrow> p\<squnion>q \<in> Pre_expression"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> Pre_expression; q \<in> Pre_expression\<rbrakk> \<Longrightarrow> p \<squnion> q \<in> Pre_expression
[PROOF STEP]
by (smt conj_pre neg_pre tests_dual.sub_inf_def pre_expression_test)


[STATEMENT]
lemma powreal_one [simp]: "a \<ge> 0 \<Longrightarrow> a pow\<^sub>\<real> 1 = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> a \<Longrightarrow> a pow\<^sub>\<real> 1 = a
[PROOF STEP]
by (simp add: powa_minus_one powreal_def real_inverse_ge_one_lemma)


[STATEMENT]
lemma cost_mergeSibling:
"\<lbrakk>consistent t; sibling t a \<noteq> a\<rbrakk> \<Longrightarrow>
 cost (mergeSibling t a) + freq t a + freq t (sibling t a) = cost t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>consistent t; sibling t a \<noteq> a\<rbrakk> \<Longrightarrow> cost (mergeSibling t a) + freq t a + freq t (sibling t a) = cost t
[PROOF STEP]
by (induct t a rule: mergeSibling_induct_consistent) auto


[STATEMENT]
lemma prime_power_product_in_Pi:
  "(\<lambda>g. \<Prod>p\<in>{p. p \<le> (n::nat) \<and> prime p}. p ^ g p)
    \<in> ({p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV) \<rightarrow>
       {m. 0 < m \<and> prime_factors m \<subseteq> {..n}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>g. \<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ g p) \<in> ({p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV) \<rightarrow> {m. 0 < m \<and> prime_factors m \<subseteq> {..n}}
[PROOF STEP]
proof (safe, goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV \<Longrightarrow> 0 < (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)
 2. \<And>x xa. \<lbrakk>x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV; xa \<in># prime_factorization (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)\<rbrakk> \<Longrightarrow> xa \<le> n
[PROOF STEP]
case (2 f p)
[PROOF STATE]
proof (state)
this:
f \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV
p \<in># prime_factorization (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ f p)

goal (2 subgoals):
 1. \<And>x. x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV \<Longrightarrow> 0 < (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)
 2. \<And>x xa. \<lbrakk>x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV; xa \<in># prime_factorization (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)\<rbrakk> \<Longrightarrow> xa \<le> n
[PROOF STEP]
have "prime_factors (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ f p) =
          (\<Union>p\<in>{p. p \<le> n \<and> prime p}. prime_factors (p ^ f p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factors (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ f p) = (\<Union>p\<in>{p. p \<le> n \<and> prime p}. prime_factors (p ^ f p))
[PROOF STEP]
by (subst prime_factors_prod) auto
[PROOF STATE]
proof (state)
this:
prime_factors (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ f p) = (\<Union>p\<in>{p. p \<le> n \<and> prime p}. prime_factors (p ^ f p))

goal (2 subgoals):
 1. \<And>x. x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV \<Longrightarrow> 0 < (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)
 2. \<And>x xa. \<lbrakk>x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV; xa \<in># prime_factorization (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)\<rbrakk> \<Longrightarrow> xa \<le> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prime_factors (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ f p) = (\<Union>p\<in>{p. p \<le> n \<and> prime p}. prime_factors (p ^ f p))

goal (2 subgoals):
 1. \<And>x. x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV \<Longrightarrow> 0 < (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)
 2. \<And>x xa. \<lbrakk>x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV; xa \<in># prime_factorization (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)\<rbrakk> \<Longrightarrow> xa \<le> n
[PROOF STEP]
have "\<dots> \<subseteq> (\<Union>p\<in>{p. p \<le> n \<and> prime p}. prime_factors p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>p\<in>{p. p \<le> n \<and> prime p}. prime_factors (p ^ f p)) \<subseteq> \<Union> (prime_factors ` {p. p \<le> n \<and> prime p})
[PROOF STEP]
using prime_factors_power_subset
[PROOF STATE]
proof (prove)
using this:
prime_factors (?x ^ ?n) \<subseteq> prime_factors ?x

goal (1 subgoal):
 1. (\<Union>p\<in>{p. p \<le> n \<and> prime p}. prime_factors (p ^ f p)) \<subseteq> \<Union> (prime_factors ` {p. p \<le> n \<and> prime p})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Union>p\<in>{p. p \<le> n \<and> prime p}. prime_factors (p ^ f p)) \<subseteq> \<Union> (prime_factors ` {p. p \<le> n \<and> prime p})

goal (2 subgoals):
 1. \<And>x. x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV \<Longrightarrow> 0 < (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)
 2. \<And>x xa. \<lbrakk>x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV; xa \<in># prime_factorization (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)\<rbrakk> \<Longrightarrow> xa \<le> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Union>p\<in>{p. p \<le> n \<and> prime p}. prime_factors (p ^ f p)) \<subseteq> \<Union> (prime_factors ` {p. p \<le> n \<and> prime p})

goal (2 subgoals):
 1. \<And>x. x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV \<Longrightarrow> 0 < (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)
 2. \<And>x xa. \<lbrakk>x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV; xa \<in># prime_factorization (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)\<rbrakk> \<Longrightarrow> xa \<le> n
[PROOF STEP]
have "\<dots> \<subseteq> (\<Union>p\<in>{p. p \<le> n \<and> prime p}. {p})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (prime_factors ` {p. p \<le> n \<and> prime p}) \<subseteq> (\<Union>p\<in>{p. p \<le> n \<and> prime p}. {p})
[PROOF STEP]
by (auto simp: prime_factors_dvd prime_gt_0_nat dest!: dvd_imp_le)
[PROOF STATE]
proof (state)
this:
\<Union> (prime_factors ` {p. p \<le> n \<and> prime p}) \<subseteq> (\<Union>p\<in>{p. p \<le> n \<and> prime p}. {p})

goal (2 subgoals):
 1. \<And>x. x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV \<Longrightarrow> 0 < (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)
 2. \<And>x xa. \<lbrakk>x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV; xa \<in># prime_factorization (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)\<rbrakk> \<Longrightarrow> xa \<le> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> (prime_factors ` {p. p \<le> n \<and> prime p}) \<subseteq> (\<Union>p\<in>{p. p \<le> n \<and> prime p}. {p})

goal (2 subgoals):
 1. \<And>x. x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV \<Longrightarrow> 0 < (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)
 2. \<And>x xa. \<lbrakk>x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV; xa \<in># prime_factorization (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)\<rbrakk> \<Longrightarrow> xa \<le> n
[PROOF STEP]
have "\<dots> \<subseteq> {..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>p\<in>{p. p \<le> n \<and> prime p}. {p}) \<subseteq> {..n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>p\<in>{p. p \<le> n \<and> prime p}. {p}) \<subseteq> {..n}

goal (2 subgoals):
 1. \<And>x. x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV \<Longrightarrow> 0 < (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)
 2. \<And>x xa. \<lbrakk>x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV; xa \<in># prime_factorization (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)\<rbrakk> \<Longrightarrow> xa \<le> n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prime_factors (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ f p) \<subseteq> {..n}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
prime_factors (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ f p) \<subseteq> {..n}

goal (1 subgoal):
 1. p \<le> n
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
prime_factors (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ f p) \<subseteq> {..n}
f \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV
p \<in># prime_factorization (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ f p)

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

goal (1 subgoal):
 1. \<And>x. x \<in> {p. p \<le> n \<and> prime p} \<rightarrow>\<^sub>E UNIV \<Longrightarrow> 0 < (\<Prod>p\<in>{p. p \<le> n \<and> prime p}. p ^ x p)
[PROOF STEP]
qed (auto simp: prime_gt_0_nat)


[STATEMENT]
lemma incseq_le_all: "incseq X \<Longrightarrow> X \<longlonglongrightarrow> L \<Longrightarrow> \<forall>n. X n \<le> (L::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>incseq X; X \<longlonglongrightarrow> L\<rbrakk> \<Longrightarrow> \<forall>n. X n \<le> L
[PROOF STEP]
by (metis incseq_le)


[STATEMENT]
lemma card_order_cpow: "card_order r \<Longrightarrow> card_order (cpow r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card_order r \<Longrightarrow> card_order (cpow r)
[PROOF STEP]
by (simp only: cpow_def Field_card_order Pow_UNIV card_of_card_order_on)


[STATEMENT]
lemma longest_common_prefix:
  "\<exists>ps xs' ys'. xs = ps @ xs' \<and> ys = ps @ ys'
       \<and> (xs' = [] \<or> ys' = [] \<or> hd xs' \<noteq> hd ys')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ps xs' ys'. xs = ps @ xs' \<and> ys = ps @ ys' \<and> (xs' = [] \<or> ys' = [] \<or> hd xs' \<noteq> hd ys')
[PROOF STEP]
by (induct xs ys rule: list_induct2')
   (blast, blast, blast,
    metis (no_types, opaque_lifting) append_Cons append_Nil list.sel(1))


[STATEMENT]
lemma lim_add: "convergent P \<Longrightarrow> lim (\<lambda>n. P n + (c :: 'a ::real_normed_vector)) = lim P + c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent P \<Longrightarrow> lim (\<lambda>n. P n + c) = lim P + c
[PROOF STEP]
by (auto intro: limI dest: Bounded_Functions.tendsto_add simp add: convergent_LIMSEQ_iff)


[STATEMENT]
lemma to_int_mod_ring_of_int_mod_ring[simp]: "0 \<le> x \<Longrightarrow> x < int CARD('a :: finite) \<Longrightarrow>
  to_int_mod_ring (of_int_mod_ring x :: 'a mod_ring) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; x < int CARD('a)\<rbrakk> \<Longrightarrow> to_int_mod_ring (of_int_mod_ring x) = x
[PROOF STEP]
by (transfer, auto)


[STATEMENT]
lemma primepow_not_unit [simp]: "primepow p \<Longrightarrow> \<not>is_unit p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primepow p \<Longrightarrow> \<not> is_unit p
[PROOF STEP]
by (auto simp: primepow_def is_unit_power_iff)


[STATEMENT]
lemma starlike_imp_path_connected:
  fixes S :: "'a::real_normed_vector set"
  shows "starlike S \<Longrightarrow> path_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. starlike S \<Longrightarrow> path_connected S
[PROOF STEP]
by (simp add: simply_connected_imp_path_connected starlike_imp_simply_connected)


[STATEMENT]
lemma simple_path_translation_eq:
  fixes g :: "real \<Rightarrow> 'a::euclidean_space"
  shows "simple_path((\<lambda>x. a + x) \<circ> g) = simple_path g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_path ((+) a \<circ> g) = simple_path g
[PROOF STEP]
by (simp add: simple_path_def path_translation_eq)


[STATEMENT]
lemma ceiling_divide_eq_div_numeral [simp]:
  "\<lceil>numeral a / numeral b :: real\<rceil> = - (- numeral a div numeral b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>numeral a / numeral b\<rceil> = - (- numeral a div numeral b)
[PROOF STEP]
using ceiling_divide_eq_div[of "numeral a" "numeral b"]
[PROOF STATE]
proof (prove)
using this:
\<lceil>of_int (numeral a) / of_int (numeral b)\<rceil> = - (- numeral a div numeral b)

goal (1 subgoal):
 1. \<lceil>numeral a / numeral b\<rceil> = - (- numeral a div numeral b)
[PROOF STEP]
by simp


[STATEMENT]
lemma [code]: "wivs_mask_integer = 2 ^ dflt_size - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wivs_mask_integer = 2 ^ dflt_size - 1
[PROOF STEP]
by transfer (simp add: wivs_mask_def)


[STATEMENT]
lemma (in abelian_group_hom) hom_a_inv [simp]:
  "x \<in> carrier G ==> h (\<ominus>x) = \<ominus>\<^bsub>H\<^esub> (h x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> h (\<ominus> x) = \<ominus>\<^bsub>H\<^esub> h x
[PROOF STEP]
by (rule group_hom.hom_inv[OF a_group_hom,
    folded a_inv_def, simplified ring_record_simps])


[STATEMENT]
lemma rank_def: "rank A = row_rank A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = row_rank A
[PROOF STEP]
by (auto simp: row_rank_def row_rank_def_gen row_space_def)


[STATEMENT]
lemma dual_conjunctive: "x \<in> conjunctive \<Longrightarrow> x ^ o \<in> disjunctive"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*) \<Longrightarrow> x ^ o \<in> disjunctive.disjunctive (\<squnion>) (\<squnion>) (*)
[PROOF STEP]
apply (simp add: conjunctive_def disjunctive_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y z. x * (y \<sqinter> z) = x * y \<sqinter> (x * z) \<Longrightarrow> \<forall>y z. x ^ o * (y \<squnion> z) = x ^ o * y \<squnion> x ^ o * z
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<forall>y z. x * (y \<sqinter> z) = x * y \<sqinter> (x * z) \<Longrightarrow> x ^ o * (y \<squnion> z) = x ^ o * y \<squnion> x ^ o * z
[PROOF STEP]
apply (rule dual_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<forall>y z. x * (y \<sqinter> z) = x * y \<sqinter> (x * z) \<Longrightarrow> (x ^ o * (y \<squnion> z)) ^ o = (x ^ o * y \<squnion> x ^ o * z) ^ o
[PROOF STEP]
by (simp add: dual_comp dual_sup)


[STATEMENT]
lemma L2_set_cong:
  "\<lbrakk>A = B; \<And>x. x \<in> B \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> L2_set f A = L2_set g B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = B; \<And>x. x \<in> B \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> L2_set f A = L2_set g B
[PROOF STEP]
unfolding L2_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = B; \<And>x. x \<in> B \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) = sqrt (\<Sum>i\<in>B. (g i)\<^sup>2)
[PROOF STEP]
by simp


[STATEMENT]
theorem raabes_test_convergence:
fixes f :: "nat \<Rightarrow> real"
  assumes pos: "eventually (\<lambda>n. f n > 0) sequentially"
  defines "l \<equiv> liminf (\<lambda>n. ereal (of_nat n * (f n / f (Suc n) - 1)))"
  assumes l: "l > 1"
  shows   "summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f
[PROOF STEP]
proof (rule kummers_test_convergence)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 \<le> ?p n
 3. 0 < liminf (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n)))
[PROOF STEP]
let ?l' = "liminf (\<lambda>n. ereal (of_nat n * f n / f (Suc n) - of_nat (Suc n)))"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 \<le> ?p n
 3. 0 < liminf (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n)))
[PROOF STEP]
have "1 < l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < l
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
1 < l

goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 \<le> ?p n
 3. 0 < liminf (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 < l

goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 \<le> ?p n
 3. 0 < liminf (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n)))
[PROOF STEP]
have "l = liminf (\<lambda>n. ereal (of_nat n * f n / f (Suc n) - of_nat (Suc n)) + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l = liminf (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)) + 1)
[PROOF STEP]
by (simp add: l_def algebra_simps)
[PROOF STATE]
proof (state)
this:
l = liminf (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)) + 1)

goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 \<le> ?p n
 3. 0 < liminf (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
l = liminf (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)) + 1)

goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 \<le> ?p n
 3. 0 < liminf (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n)))
[PROOF STEP]
have "\<dots> = ?l' + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)) + 1) = liminf (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n))) + 1
[PROOF STEP]
by (subst Liminf_add_ereal_right) simp_all
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)) + 1) = liminf (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n))) + 1

goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 \<le> ?p n
 3. 0 < liminf (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 < liminf (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n))) + 1
[PROOF STEP]
show "?l' > 0"
[PROOF STATE]
proof (prove)
using this:
1 < liminf (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n))) + 1

goal (1 subgoal):
 1. 0 < liminf (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)))
[PROOF STEP]
by (cases ?l') (simp_all add: algebra_simps)
[PROOF STATE]
proof (state)
this:
0 < liminf (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)))

goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 \<le> real n
[PROOF STEP]
qed (simp_all add: pos)


[STATEMENT]
lemma length_suffixes [simp]: "length (suffixes xs) = Suc (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (suffixes xs) = Suc (length xs)
[PROOF STEP]
by (induction xs) auto


[STATEMENT]
lemma ccInf_insert [simp]: "countable A \<Longrightarrow> Inf (insert a A) = inf a (Inf A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable A \<Longrightarrow> Inf (insert a A) = inf a (Inf A)
[PROOF STEP]
by (force intro: le_infI le_infI1 le_infI2 order.antisym ccInf_greatest ccInf_lower)


[STATEMENT]
lemma sup_left_dist_inf:
  "-x \<squnion> (-y \<sqinter> -z) = (-x \<squnion> -y) \<sqinter> (-x \<squnion> -z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x \<squnion> - y \<sqinter> - z = (- x \<squnion> - y) \<sqinter> (- x \<squnion> - z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - x \<squnion> - y \<sqinter> - z = (- x \<squnion> - y) \<sqinter> (- x \<squnion> - z)
[PROOF STEP]
have "-x \<squnion> (-y \<sqinter> -z) = -(--x \<sqinter> (--y \<squnion> --z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x \<squnion> - y \<sqinter> - z = - (- - x \<sqinter> (- - y \<squnion> - - z))
[PROOF STEP]
by (metis sub_inf_def sub_sup_closed sub_sup_demorgan)
[PROOF STATE]
proof (state)
this:
- x \<squnion> - y \<sqinter> - z = - (- - x \<sqinter> (- - y \<squnion> - - z))

goal (1 subgoal):
 1. - x \<squnion> - y \<sqinter> - z = (- x \<squnion> - y) \<sqinter> (- x \<squnion> - z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- x \<squnion> - y \<sqinter> - z = - (- - x \<sqinter> (- - y \<squnion> - - z))

goal (1 subgoal):
 1. - x \<squnion> - y \<sqinter> - z = (- x \<squnion> - y) \<sqinter> (- x \<squnion> - z)
[PROOF STEP]
have "... = (-x \<squnion> -y) \<sqinter> (-x \<squnion> -z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (- - x \<sqinter> (- - y \<squnion> - - z)) = (- x \<squnion> - y) \<sqinter> (- x \<squnion> - z)
[PROOF STEP]
by (metis inf_left_dist_sup sub_sup_closed sub_sup_demorgan)
[PROOF STATE]
proof (state)
this:
- (- - x \<sqinter> (- - y \<squnion> - - z)) = (- x \<squnion> - y) \<sqinter> (- x \<squnion> - z)

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

goal (1 subgoal):
 1. - x \<squnion> - y \<sqinter> - z = (- x \<squnion> - y) \<sqinter> (- x \<squnion> - z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
- x \<squnion> - y \<sqinter> - z = (- x \<squnion> - y) \<sqinter> (- x \<squnion> - z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<lbrakk>\<forall>x\<in>set xs. x<2^n; n>0\<rbrakk> \<Longrightarrow> test n xs ys = map (\<lambda>y. (GREATEST y'. y'\<in>insert 0 (set xs) \<and> y'\<le>y)) ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>set xs. x < 2 ^ n; 0 < n\<rbrakk> \<Longrightarrow> test n xs ys = map (\<lambda>y. GREATEST y'. y' \<in> insert 0 (set xs) \<and> y' \<le> y) ys
[PROOF STEP]
unfolding test_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>set xs. x < 2 ^ n; 0 < n\<rbrakk> \<Longrightarrow> (let t = vebt_buildup n; t = foldl vebt_insert t (0 # xs); f = \<lambda>x. if vebt_member t x then x else the (vebt_pred t x) in map f ys) = map (\<lambda>y. GREATEST y'. y' \<in> insert 0 (set xs) \<and> y' \<le> y) ys
[PROOF STEP]
apply (auto simp add: Let_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<forall>x\<in>set xs. x < 2 ^ n; 0 < n; 0 \<in> set ys\<rbrakk> \<Longrightarrow> (GREATEST y'. (y' = 0 \<or> y' \<in> set xs) \<and> y' = 0) = 0
 2. \<And>x. \<lbrakk>\<forall>x\<in>set xs. x < 2 ^ n; 0 < n; x \<in> set ys; x \<in> set xs\<rbrakk> \<Longrightarrow> x = (GREATEST y'. (y' = 0 \<or> y' \<in> set xs) \<and> y' \<le> x)
 3. \<And>x. \<lbrakk>\<forall>x\<in>set xs. x < 2 ^ n; 0 < n; x \<in> set ys; 0 < x; x \<notin> set xs\<rbrakk> \<Longrightarrow> (GREATEST y. (y = 0 \<or> y \<in> set xs) \<and> y < x) = (GREATEST y'. (y' = 0 \<or> y' \<in> set xs) \<and> y' \<le> x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>set xs. x < 2 ^ n; 0 < n; 0 \<in> set ys\<rbrakk> \<Longrightarrow> (GREATEST y'. (y' = 0 \<or> y' \<in> set xs) \<and> y' = 0) = 0
[PROOF STEP]
by (metis (mono_tags, lifting) Greatest_equality le_zero_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x\<in>set xs. x < 2 ^ n; 0 < n; x \<in> set ys; x \<in> set xs\<rbrakk> \<Longrightarrow> x = (GREATEST y'. (y' = 0 \<or> y' \<in> set xs) \<and> y' \<le> x)
 2. \<And>x. \<lbrakk>\<forall>x\<in>set xs. x < 2 ^ n; 0 < n; x \<in> set ys; 0 < x; x \<notin> set xs\<rbrakk> \<Longrightarrow> (GREATEST y. (y = 0 \<or> y \<in> set xs) \<and> y < x) = (GREATEST y'. (y' = 0 \<or> y' \<in> set xs) \<and> y' \<le> x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>set xs. x < 2 ^ n; 0 < n; x_ \<in> set ys; x_ \<in> set xs\<rbrakk> \<Longrightarrow> x_ = (GREATEST y'. (y' = 0 \<or> y' \<in> set xs) \<and> y' \<le> x_)
[PROOF STEP]
by (metis (no_types, lifting) Greatest_equality order_refl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x\<in>set xs. x < 2 ^ n; 0 < n; x \<in> set ys; 0 < x; x \<notin> set xs\<rbrakk> \<Longrightarrow> (GREATEST y. (y = 0 \<or> y \<in> set xs) \<and> y < x) = (GREATEST y'. (y' = 0 \<or> y' \<in> set xs) \<and> y' \<le> x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>set xs. x < 2 ^ n; 0 < n; x_ \<in> set ys; 0 < x_; x_ \<notin> set xs\<rbrakk> \<Longrightarrow> (GREATEST y. (y = 0 \<or> y \<in> set xs) \<and> y < x_) = (GREATEST y'. (y' = 0 \<or> y' \<in> set xs) \<and> y' \<le> x_)
[PROOF STEP]
by (metis less_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma n_div_d_eq_1: "d \<in> {n div 2 + 1..n} \<Longrightarrow> \<lfloor>real n / real d\<rfloor> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d \<in> {n div 2 + 1..n} \<Longrightarrow> \<lfloor>real n / real d\<rfloor> = 1
[PROOF STEP]
by (cases "n = d") (auto simp: field_simps intro: floor_eq)


[STATEMENT]
lemma moebius_decomposition:
  assumes "c \<noteq> 0" and "a*d - b*c \<noteq> 0"
  shows "mk_moebius a b c d =
             moebius_translation (a/c) +
             moebius_rotation_dilatation ((b*c - a*d)/(c*c)) +
             moebius_reciprocal +
             moebius_translation (d/c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_moebius a b c d = moebius_translation (a / c) + moebius_rotation_dilatation ((b * c - a * d) / (c * c)) + moebius_reciprocal + moebius_translation (d / c)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0
a * d - b * c \<noteq> 0

goal (1 subgoal):
 1. mk_moebius a b c d = moebius_translation (a / c) + moebius_rotation_dilatation ((b * c - a * d) / (c * c)) + moebius_reciprocal + moebius_translation (d / c)
[PROOF STEP]
unfolding moebius_rotation_dilatation_def moebius_translation_def moebius_similarity_def plus_moebius_def moebius_reciprocal_def
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0
a * d - b * c \<noteq> 0

goal (1 subgoal):
 1. mk_moebius a b c d = moebius_comp (moebius_comp (moebius_comp (mk_moebius 1 (a / c) 0 1) (mk_moebius ((b * c - a * d) / (c * c)) 0 0 1)) (mk_moebius 0 1 1 0)) (mk_moebius 1 (d / c) 0 1)
[PROOF STEP]
by (simp add: field_simps) (transfer, transfer, auto simp add: field_simps, rule_tac x="1/c" in exI, simp)


[STATEMENT]
lemma size_mset_sum_mset_distrib: "size (sum_mset A :: 'a multiset) = sum_mset (image_mset size A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (\<Sum>\<^sub># A) = \<Sum>\<^sub># (image_mset size A)
[PROOF STEP]
by (induction A) auto


[STATEMENT]
lemma ab_semigroup_add_ow_Ball_def:
  "ab_semigroup_add_ow S pls \<longleftrightarrow>
    semigroup_add_ow S pls \<and> (\<forall>a\<in>S. \<forall>b\<in>S. pls a b = pls b a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ab_semigroup_add_ow S pls = (semigroup_add_ow S pls \<and> (\<forall>a\<in>S. \<forall>b\<in>S. pls a b = pls b a))
[PROOF STEP]
by  (auto simp: ab_semigroup_add_ow_def ab_semigroup_add_ow_axioms_def)