[STATEMENT]
lemma union_eqclass_decreases_components:
  assumes "CC F x \<noteq> CC F y" "e \<notin> F" "x\<in>V" "y\<in>V" "F \<subseteq> E" "e\<in>E" "joins x y e"
  shows "Suc (card (CCs (insert e F))) = card (CCs F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (card (CCs (insert e F))) = card (CCs F)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Suc (card (CCs (insert e F))) = card (CCs F)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
CC F x \<noteq> CC F y
[PROOF STEP]
have xny: "x\<noteq>y"
[PROOF STATE]
proof (prove)
using this:
CC F x \<noteq> CC F y

goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. Suc (card (CCs (insert e F))) = card (CCs F)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (card (CCs (insert e F))) = card (CCs F)
[PROOF STEP]
unfolding CCs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (card (V // connected (insert e F))) = card (V // connected F)
[PROOF STEP]
apply(simp only: insert_reachable[OF   assms(3-7)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (card (V // per_union (connected F) x y)) = card (V // connected F)
[PROOF STEP]
apply(rule unify2EquivClasses_alt)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. connected F `` {x} \<noteq> connected F `` {y}
 2. y \<in> V
 3. x \<in> V
 4. connected F \<subseteq> V \<times> V
 5. equiv V (connected F)
 6. finite V
[PROOF STEP]
apply(fact assms(1)[unfolded CC_def])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. y \<in> V
 2. x \<in> V
 3. connected F \<subseteq> V \<times> V
 4. equiv V (connected F)
 5. finite V
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. connected F \<subseteq> V \<times> V
 2. equiv V (connected F)
 3. finite V
[PROOF STEP]
apply (rule connected_in)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. F \<subseteq> E
 2. equiv V (connected F)
 3. finite V
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. equiv V (connected F)
 2. finite V
[PROOF STEP]
apply(rule equiv)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. F \<subseteq> E
 2. finite V
[PROOF STEP]
apply fact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite V
[PROOF STEP]
by (fact finiteV)
[PROOF STATE]
proof (state)
this:
Suc (card (CCs (insert e F))) = card (CCs F)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma arbitrary_union_of_Un:
   "\<lbrakk>(arbitrary union_of P) S; (arbitrary union_of P) T\<rbrakk>
           \<Longrightarrow> (arbitrary union_of P) (S \<union> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(arbitrary union_of P) S; (arbitrary union_of P) T\<rbrakk> \<Longrightarrow> (arbitrary union_of P) (S \<union> T)
[PROOF STEP]
using arbitrary_union_of_Union [of "{S,T}"]
[PROOF STATE]
proof (prove)
using this:
(\<And>Sa. Sa \<in> {S, T} \<Longrightarrow> (arbitrary union_of ?P) Sa) \<Longrightarrow> (arbitrary union_of ?P) (\<Union> {S, T})

goal (1 subgoal):
 1. \<lbrakk>(arbitrary union_of P) S; (arbitrary union_of P) T\<rbrakk> \<Longrightarrow> (arbitrary union_of P) (S \<union> T)
[PROOF STEP]
by auto


[STATEMENT]
lemma dist_fst_abs:
  fixes p :: point and l :: int
  shows "dist p (l, snd p) = \<bar>fst p - l\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = real_of_int \<bar>fst p - l\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = real_of_int \<bar>fst p - l\<bar>
[PROOF STEP]
have "dist p (l, snd p) = sqrt ((real_of_int (fst p) - l)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = sqrt ((real_of_int (fst p) - real_of_int l)\<^sup>2)
[PROOF STEP]
by (simp add: dist_prod_def dist_real_def prod.case_eq_if)
[PROOF STATE]
proof (state)
this:
dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = sqrt ((real_of_int (fst p) - real_of_int l)\<^sup>2)

goal (1 subgoal):
 1. dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = real_of_int \<bar>fst p - l\<bar>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = sqrt ((real_of_int (fst p) - real_of_int l)\<^sup>2)

goal (1 subgoal):
 1. dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = real_of_int \<bar>fst p - l\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = real_of_int \<bar>fst p - l\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_adjoint:
  shows "Complex_Matrix.adjoint (0\<^sub>m n m) = ((0\<^sub>m m n):: 'a::conjugatable_field Matrix.mat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint (0\<^sub>m n m) = 0\<^sub>m m n
[PROOF STEP]
by (rule eq_matI, (auto simp add: adjoint_eval))


[STATEMENT]
lemma sinh_0 [simp]: "sinh 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sinh (0::'a) = (0::'a)
[PROOF STEP]
by (simp add: sinh_def)


[STATEMENT]
lemma internal_induct_lemma:
  "\<And>X::nat set star.
    (0::hypnat) \<in> Iset X \<Longrightarrow> \<forall>n. n \<in> Iset X \<longrightarrow> n + 1 \<in> Iset X \<Longrightarrow> Iset X = (UNIV:: hypnat set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>0 \<in> Iset X; \<forall>n. n \<in> Iset X \<longrightarrow> n + 1 \<in> Iset X\<rbrakk> \<Longrightarrow> Iset X = UNIV
[PROOF STEP]
apply (transfer UNIV_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>0 \<in> X; \<forall>n. n \<in> X \<longrightarrow> n + 1 \<in> X\<rbrakk> \<Longrightarrow> X = UNIV
[PROOF STEP]
apply (rule equalityI [OF subset_UNIV subsetI])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X x. \<lbrakk>0 \<in> X; \<forall>n. n \<in> X \<longrightarrow> n + 1 \<in> X; x \<in> UNIV\<rbrakk> \<Longrightarrow> x \<in> X
[PROOF STEP]
apply (induct_tac x, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prob_subset_dom_subset:
  assumes "PROB1 \<subseteq> PROB2"
  shows "(prob_dom PROB1 \<subseteq> prob_dom PROB2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_dom PROB1 \<subseteq> prob_dom PROB2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
PROB1 \<subseteq> PROB2

goal (1 subgoal):
 1. prob_dom PROB1 \<subseteq> prob_dom PROB2
[PROOF STEP]
by (auto simp add: prob_dom_def)


[STATEMENT]
lemma fps_tan_deriv: "fps_deriv (fps_tan c) = fps_const c / (fps_cos c)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (fps_tan c) = fps_const c / (fps_cos c)\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fps_deriv (fps_tan c) = fps_const c / (fps_cos c)\<^sup>2
[PROOF STEP]
have th0: "fps_cos c $ 0 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_cos c $ 0 \<noteq> (0::'a)
[PROOF STEP]
by (simp add: fps_cos_def)
[PROOF STATE]
proof (state)
this:
fps_cos c $ 0 \<noteq> (0::'a)

goal (1 subgoal):
 1. fps_deriv (fps_tan c) = fps_const c / (fps_cos c)\<^sup>2
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
fps_cos c $ 0 \<noteq> (0::'a)
[PROOF STEP]
have "fps_cos c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
fps_cos c $ 0 \<noteq> (0::'a)

goal (1 subgoal):
 1. fps_cos c \<noteq> 0
[PROOF STEP]
by (intro notI) simp
[PROOF STATE]
proof (state)
this:
fps_cos c \<noteq> 0

goal (1 subgoal):
 1. fps_deriv (fps_tan c) = fps_const c / (fps_cos c)\<^sup>2
[PROOF STEP]
hence "fps_deriv (fps_tan c) =
           fps_const c * (fps_cos c^2 + fps_sin c^2) / (fps_cos c^2)"
[PROOF STATE]
proof (prove)
using this:
fps_cos c \<noteq> 0

goal (1 subgoal):
 1. fps_deriv (fps_tan c) = fps_const c * ((fps_cos c)\<^sup>2 + (fps_sin c)\<^sup>2) / (fps_cos c)\<^sup>2
[PROOF STEP]
by (simp add: fps_tan_def fps_divide_deriv power2_eq_square algebra_simps
                  fps_sin_deriv fps_cos_deriv fps_const_neg[symmetric] div_mult_swap
             del: fps_const_neg)
[PROOF STATE]
proof (state)
this:
fps_deriv (fps_tan c) = fps_const c * ((fps_cos c)\<^sup>2 + (fps_sin c)\<^sup>2) / (fps_cos c)\<^sup>2

goal (1 subgoal):
 1. fps_deriv (fps_tan c) = fps_const c / (fps_cos c)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_deriv (fps_tan c) = fps_const c * ((fps_cos c)\<^sup>2 + (fps_sin c)\<^sup>2) / (fps_cos c)\<^sup>2

goal (1 subgoal):
 1. fps_deriv (fps_tan c) = fps_const c / (fps_cos c)\<^sup>2
[PROOF STEP]
note fps_sin_cos_sum_of_squares
[PROOF STATE]
proof (state)
this:
(fps_cos ?c)\<^sup>2 + (fps_sin ?c)\<^sup>2 = 1

goal (1 subgoal):
 1. fps_deriv (fps_tan c) = fps_const c / (fps_cos c)\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fps_deriv (fps_tan c) = fps_const c * 1 / (fps_cos c)\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fps_deriv (fps_tan c) = fps_const c * 1 / (fps_cos c)\<^sup>2

goal (1 subgoal):
 1. fps_deriv (fps_tan c) = fps_const c / (fps_cos c)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fps_deriv (fps_tan c) = fps_const c / (fps_cos c)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hom_frag_diff:
  assumes "h \<in> hom (free_Abelian_group S) (free_Abelian_group T)" "Poly_Mapping.keys a \<subseteq> S" "Poly_Mapping.keys b \<subseteq> S"
  shows "h (a-b) = h a - h b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h (a - b) = h a - h b
[PROOF STEP]
by (metis (no_types, lifting) assms diff_conv_add_uminus hom_frag_add hom_frag_minus keys_minus)


[STATEMENT]
lemma ennexp_strict_mono2 [mono_intros]:
  assumes "x < y"
  shows "ennexp x < ennexp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennexp x < ennexp y
[PROOF STEP]
using ennexp_strict_mono assms
[PROOF STATE]
proof (prove)
using this:
strict_mono ennexp
x < y

goal (1 subgoal):
 1. ennexp x < ennexp y
[PROOF STEP]
unfolding strict_mono_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x < y \<longrightarrow> ennexp x < ennexp y
x < y

goal (1 subgoal):
 1. ennexp x < ennexp y
[PROOF STEP]
by auto


[STATEMENT]
lemma from_digits_digit:
  assumes "x < base ^ n"
  shows   "from_digits n (digit x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. from_digits n (digit x) = x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x < base ^ n

goal (1 subgoal):
 1. from_digits n (digit x) = x
[PROOF STEP]
unfolding digit_altdef from_digits_altdef
[PROOF STATE]
proof (prove)
using this:
x < base ^ n

goal (1 subgoal):
 1. (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
proof (induction n arbitrary: x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x < base ^ 0 \<Longrightarrow> (\<Sum>i<0. x div base ^ i mod base * base ^ i) = x
 2. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
x < base ^ 0

goal (2 subgoals):
 1. \<And>x. x < base ^ 0 \<Longrightarrow> (\<Sum>i<0. x div base ^ i mod base * base ^ i) = x
 2. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < base ^ 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x < base ^ 0

goal (1 subgoal):
 1. (\<Sum>i<0. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<0. x div base ^ i mod base * base ^ i) = x

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
?x < base ^ n \<Longrightarrow> (\<Sum>i<n. ?x div base ^ i mod base * base ^ i) = ?x
x < base ^ Suc n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
define x_less where "x_less = x mod base^n"
[PROOF STATE]
proof (state)
this:
x_less = x mod base ^ n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
define x_n where "x_n = x div base^n"
[PROOF STATE]
proof (state)
this:
x_n = x div base ^ n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
have "x_less < base^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_less < base ^ n
[PROOF STEP]
using x_less_def base_pos mod_less_divisor
[PROOF STATE]
proof (prove)
using this:
x_less = x mod base ^ n
0 < base
0 < ?n \<Longrightarrow> ?m mod ?n < ?n

goal (1 subgoal):
 1. x_less < base ^ n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
x_less < base ^ n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x_less < base ^ n
[PROOF STEP]
have IH_x_less:
    "(\<Sum>i<n. x_less div base ^ i mod base * base ^ i) = x_less"
[PROOF STATE]
proof (prove)
using this:
x_less < base ^ n

goal (1 subgoal):
 1. (\<Sum>i<n. x_less div base ^ i mod base * base ^ i) = x_less
[PROOF STEP]
using Suc.IH
[PROOF STATE]
proof (prove)
using this:
x_less < base ^ n
?x < base ^ n \<Longrightarrow> (\<Sum>i<n. ?x div base ^ i mod base * base ^ i) = ?x

goal (1 subgoal):
 1. (\<Sum>i<n. x_less div base ^ i mod base * base ^ i) = x_less
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. x_less div base ^ i mod base * base ^ i) = x_less

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
have "x_n < base"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_n < base
[PROOF STEP]
using \<open>x<base^Suc n\<close>
[PROOF STATE]
proof (prove)
using this:
x < base ^ Suc n

goal (1 subgoal):
 1. x_n < base
[PROOF STEP]
by auto (metis less_mult_imp_div_less x_n_def)
[PROOF STATE]
proof (state)
this:
x_n < base

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x_n < base
[PROOF STEP]
have "x_n mod base = x_n"
[PROOF STATE]
proof (prove)
using this:
x_n < base

goal (1 subgoal):
 1. x_n mod base = x_n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x_n mod base = x_n

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
have x_less_i_eq_x_i:"x mod base^n div base ^i mod base =
    x div base^i mod base" if "i<n" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod base ^ n div base ^ i mod base = x div base ^ i mod base
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x mod base ^ n div base ^ i mod base = x div base ^ i mod base
[PROOF STEP]
have "x div base^i mod base =
          ((x div base^n) * base^n + x mod base^n) div base^i mod base"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x div base ^ i mod base = (x div base ^ n * base ^ n + x mod base ^ n) div base ^ i mod base
[PROOF STEP]
using div_mult_mod_eq[of x "base^n"]
[PROOF STATE]
proof (prove)
using this:
x div base ^ n * base ^ n + x mod base ^ n = x

goal (1 subgoal):
 1. x div base ^ i mod base = (x div base ^ n * base ^ n + x mod base ^ n) div base ^ i mod base
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x div base ^ i mod base = (x div base ^ n * base ^ n + x mod base ^ n) div base ^ i mod base

goal (1 subgoal):
 1. x mod base ^ n div base ^ i mod base = x div base ^ i mod base
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x div base ^ i mod base = (x div base ^ n * base ^ n + x mod base ^ n) div base ^ i mod base

goal (1 subgoal):
 1. x mod base ^ n div base ^ i mod base = x div base ^ i mod base
[PROOF STEP]
have "\<dots> = x mod base^n div base^i mod base"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x div base ^ n * base ^ n + x mod base ^ n) div base ^ i mod base = x mod base ^ n div base ^ i mod base
[PROOF STEP]
using div_distrib[where a="x div base^n" and b = "x mod base^n"]
        that
[PROOF STATE]
proof (prove)
using this:
?i < ?n \<Longrightarrow> (x div base ^ n * base ^ ?n + x mod base ^ n) div base ^ ?i mod base = x mod base ^ n div base ^ ?i mod base
i < n

goal (1 subgoal):
 1. (x div base ^ n * base ^ n + x mod base ^ n) div base ^ i mod base = x mod base ^ n div base ^ i mod base
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x div base ^ n * base ^ n + x mod base ^ n) div base ^ i mod base = x mod base ^ n div base ^ i mod base

goal (1 subgoal):
 1. x mod base ^ n div base ^ i mod base = x div base ^ i mod base
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x div base ^ i mod base = x mod base ^ n div base ^ i mod base
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x div base ^ i mod base = x mod base ^ n div base ^ i mod base

goal (1 subgoal):
 1. x mod base ^ n div base ^ i mod base = x div base ^ i mod base
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x mod base ^ n div base ^ i mod base = x div base ^ i mod base

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i < n \<Longrightarrow> x mod base ^ n div base ^ ?i mod base = x div base ^ ?i mod base

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
have "x = (x_n mod base)*base^n + x_less"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = x_n mod base * base ^ n + x_less
[PROOF STEP]
unfolding \<open>x_n mod base=x_n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = x_n * base ^ n + x_less
[PROOF STEP]
using x_n_def x_less_def div_mod_decomp
[PROOF STATE]
proof (prove)
using this:
x_n = x div base ^ n
x_less = x mod base ^ n
?A = ?A div ?n * ?n + ?A mod ?n

goal (1 subgoal):
 1. x = x_n * base ^ n + x_less
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = x_n mod base * base ^ n + x_less

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = x_n mod base * base ^ n + x_less

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
have "\<dots> = (x div base^n mod base) * base^n +
                (\<Sum>i<n. x div base ^ i mod base * base ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_n mod base * base ^ n + x_less = x div base ^ n mod base * base ^ n + (\<Sum>i<n. x div base ^ i mod base * base ^ i)
[PROOF STEP]
using IH_x_less x_less_def x_less_i_eq_x_i x_n_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<n. x_less div base ^ i mod base * base ^ i) = x_less
x_less = x mod base ^ n
?i < n \<Longrightarrow> x mod base ^ n div base ^ ?i mod base = x div base ^ ?i mod base
x_n = x div base ^ n

goal (1 subgoal):
 1. x_n mod base * base ^ n + x_less = x div base ^ n mod base * base ^ n + (\<Sum>i<n. x div base ^ i mod base * base ^ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x_n mod base * base ^ n + x_less = x div base ^ n mod base * base ^ n + (\<Sum>i<n. x div base ^ i mod base * base ^ i)

goal (1 subgoal):
 1. \<And>n x. \<lbrakk>\<And>x. x < base ^ n \<Longrightarrow> (\<Sum>i<n. x div base ^ i mod base * base ^ i) = x; x < base ^ Suc n\<rbrakk> \<Longrightarrow> (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x = x div base ^ n mod base * base ^ n + (\<Sum>i<n. x div base ^ i mod base * base ^ i)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x = x div base ^ n mod base * base ^ n + (\<Sum>i<n. x div base ^ i mod base * base ^ i)

goal (1 subgoal):
 1. (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
using sum.atMost_Suc
[PROOF STATE]
proof (prove)
using this:
x = x div base ^ n mod base * base ^ n + (\<Sum>i<n. x div base ^ i mod base * base ^ i)
sum ?g {..Suc ?n} = sum ?g {..?n} + ?g (Suc ?n)

goal (1 subgoal):
 1. (\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x
[PROOF STEP]
by (simp add: add.commute)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<Suc n. x div base ^ i mod base * base ^ i) = x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma left_ideal_generated_subset:
  assumes "S \<subseteq> T"
  shows "left_ideal_generated S \<subseteq> left_ideal_generated T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. left_ideal_generated S \<subseteq> left_ideal_generated T
[PROOF STEP]
unfolding left_ideal_generated_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> {I. left_ideal I \<and> S \<subseteq> I} \<subseteq> \<Inter> {I. left_ideal I \<and> T \<subseteq> I}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> T

goal (1 subgoal):
 1. \<Inter> {I. left_ideal I \<and> S \<subseteq> I} \<subseteq> \<Inter> {I. left_ideal I \<and> T \<subseteq> I}
[PROOF STEP]
by auto


[STATEMENT]
lemma absolutely_integrable_on_combine:
  fixes f :: "real \<Rightarrow> 'a::euclidean_space"
  assumes "f absolutely_integrable_on {a..c}"
    and "f absolutely_integrable_on {c..b}"
    and "a \<le> c"
    and "c \<le> b"
  shows "f absolutely_integrable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f absolutely_integrable_on {a..b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on {a..c}
f absolutely_integrable_on {c..b}
a \<le> c
c \<le> b

goal (1 subgoal):
 1. f absolutely_integrable_on {a..b}
[PROOF STEP]
unfolding absolutely_integrable_on_def integrable_on_def
[PROOF STATE]
proof (prove)
using this:
(\<exists>y. (f has_integral y) {a..c}) \<and> (\<exists>y. ((\<lambda>x. norm (f x)) has_integral y) {a..c})
(\<exists>y. (f has_integral y) {c..b}) \<and> (\<exists>y. ((\<lambda>x. norm (f x)) has_integral y) {c..b})
a \<le> c
c \<le> b

goal (1 subgoal):
 1. (\<exists>y. (f has_integral y) {a..b}) \<and> (\<exists>y. ((\<lambda>x. norm (f x)) has_integral y) {a..b})
[PROOF STEP]
by (auto intro!: has_integral_combine)


[STATEMENT]
theorem complement_language:
    assumes "finite (nodes A)"
    shows "language (complement A) = streams (alphabet A) - language A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. language (complement A) = streams (alphabet A) - language A
[PROOF STEP]
proof (safe del: notI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> language (complement A) \<Longrightarrow> x \<in> streams (alphabet A)
 2. \<And>x. x \<in> language (complement A) \<Longrightarrow> x \<notin> language A
 3. \<And>x. \<lbrakk>x \<in> streams (alphabet A); x \<notin> language A\<rbrakk> \<Longrightarrow> x \<in> language (complement A)
[PROOF STEP]
have 1: "alphabet (complement A) = alphabet A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alphabet (complement A) = alphabet A
[PROOF STEP]
unfolding complement_def nba.sel
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alphabet A = alphabet A
[PROOF STEP]
by rule
[PROOF STATE]
proof (state)
this:
alphabet (complement A) = alphabet A

goal (3 subgoals):
 1. \<And>x. x \<in> language (complement A) \<Longrightarrow> x \<in> streams (alphabet A)
 2. \<And>x. x \<in> language (complement A) \<Longrightarrow> x \<notin> language A
 3. \<And>x. \<lbrakk>x \<in> streams (alphabet A); x \<notin> language A\<rbrakk> \<Longrightarrow> x \<in> language (complement A)
[PROOF STEP]
show "w \<in> streams (alphabet A)" if "w \<in> language (complement A)" for w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> streams (alphabet A)
[PROOF STEP]
using nba.language_alphabet that 1
[PROOF STATE]
proof (prove)
using this:
language ?A \<subseteq> streams (alphabet ?A)
w \<in> language (complement A)
alphabet (complement A) = alphabet A

goal (1 subgoal):
 1. w \<in> streams (alphabet A)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
?w \<in> language (complement A) \<Longrightarrow> ?w \<in> streams (alphabet A)

goal (2 subgoals):
 1. \<And>x. x \<in> language (complement A) \<Longrightarrow> x \<notin> language A
 2. \<And>x. \<lbrakk>x \<in> streams (alphabet A); x \<notin> language A\<rbrakk> \<Longrightarrow> x \<in> language (complement A)
[PROOF STEP]
show "w \<notin> language A" if "w \<in> language (complement A)" for w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<notin> language A
[PROOF STEP]
using complement_ranking ranking_language that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<in> language (complement ?A); \<And>f. ranking ?A ?w f \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
ranking ?A ?w ?f \<Longrightarrow> ?w \<notin> language ?A
w \<in> language (complement A)

goal (1 subgoal):
 1. w \<notin> language A
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?w \<in> language (complement A) \<Longrightarrow> ?w \<notin> language A

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> streams (alphabet A); x \<notin> language A\<rbrakk> \<Longrightarrow> x \<in> language (complement A)
[PROOF STEP]
show "w \<in> language (complement A)" if "w \<in> streams (alphabet A)" "w \<notin> language A" for w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> language (complement A)
[PROOF STEP]
using language_ranking ranking_complement assms that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (nodes ?A); ?w \<notin> language ?A\<rbrakk> \<Longrightarrow> ranking ?A ?w (rank ?A ?w)
\<lbrakk>finite (nodes ?A); ?w \<in> streams (alphabet ?A); ranking ?A ?w ?f\<rbrakk> \<Longrightarrow> ?w \<in> language (complement ?A)
finite (nodes A)
w \<in> streams (alphabet A)
w \<notin> language A

goal (1 subgoal):
 1. w \<in> language (complement A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>?w \<in> streams (alphabet A); ?w \<notin> language A\<rbrakk> \<Longrightarrow> ?w \<in> language (complement A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lim_inverse_n: "((\<lambda>n. inverse(of_nat n)) \<longlongrightarrow> (0::'a::real_normed_field)) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. inverse (of_nat n)) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
using lim_1_over_n
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (1::?'a) / of_nat n) \<longlonglongrightarrow> (0::?'a)

goal (1 subgoal):
 1. (\<lambda>n. inverse (of_nat n)) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
by (simp add: inverse_eq_divide)


[STATEMENT]
lemma powr_eventually_exp_ln: "eventually (\<lambda>x. (x::real) powr p = exp (p * ln x)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. x powr p = exp (p * ln x)
[PROOF STEP]
using eventually_gt_at_top[of "0::real"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. x powr p = exp (p * ln x)
[PROOF STEP]
unfolding powr_def
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. (if x = 0 then 0 else exp (p * ln x)) = exp (p * ln x)
[PROOF STEP]
by eventually_elim simp_all


[STATEMENT]
lemma ex_iter: "(\<exists>n. R (iter g a n)) = (if R a then True else (\<exists>n. R (iter g (g a) n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>n. R (iter g a n)) = (if R a then True else \<exists>n. R (iter g (g a) n))
[PROOF STEP]
apply (rule trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<exists>n. R (iter g a n)) = ?s
 2. ?s = (if R a then True else \<exists>n. R (iter g (g a) n))
[PROOF STEP]
apply (rule ex_iter')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (R a \<or> (\<exists>n. R (iter g (g a) n))) = (if R a then True else \<exists>n. R (iter g (g a) n))
[PROOF STEP]
apply (force )
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mult_mm_non_zero_l:
  assumes "mat_det A \<noteq> 0" and "B \<noteq> mat_zero"
  shows "A *\<^sub>m\<^sub>m B \<noteq> mat_zero"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>m\<^sub>m B \<noteq> mat_zero
[PROOF STEP]
using assms mat_zero_r
[PROOF STATE]
proof (prove)
using this:
mat_det A \<noteq> 0
B \<noteq> mat_zero
?A *\<^sub>m\<^sub>m mat_zero = mat_zero

goal (1 subgoal):
 1. A *\<^sub>m\<^sub>m B \<noteq> mat_zero
[PROOF STEP]
using mult_mm_inv_l[OF assms(1), of B mat_zero]
[PROOF STATE]
proof (prove)
using this:
mat_det A \<noteq> 0
B \<noteq> mat_zero
?A *\<^sub>m\<^sub>m mat_zero = mat_zero
A *\<^sub>m\<^sub>m B = mat_zero \<Longrightarrow> B = mat_inv A *\<^sub>m\<^sub>m mat_zero

goal (1 subgoal):
 1. A *\<^sub>m\<^sub>m B \<noteq> mat_zero
[PROOF STEP]
by auto