[STATEMENT]
lemma filterlim_at_top_iff_inverse_0:
  "eventually (\<lambda>x. 0 < f x) F \<Longrightarrow> (LIM x F. f x :> at_top) \<longleftrightarrow> ((inverse \<circ> f) \<longlongrightarrow> (0 :: real)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. 0 < f x \<Longrightarrow> filterlim f at_top F = ((inverse \<circ> f) \<longlongrightarrow> 0) F
[PROOF STEP]
using filterlim_inverse_at_top_iff [of "inverse \<circ> f"]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in ?F. 0 < (inverse \<circ> f) x \<Longrightarrow> (LIM x ?F. inverse ((inverse \<circ> f) x) :> at_top) = ((inverse \<circ> f) \<longlongrightarrow> 0) ?F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. 0 < f x \<Longrightarrow> filterlim f at_top F = ((inverse \<circ> f) \<longlongrightarrow> 0) F
[PROOF STEP]
by auto


[STATEMENT]
lemma binomial_mono:
  assumes "k \<le> k'" "2*k' \<le> n"
  shows   "n choose k \<le> n choose k'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n choose k \<le> n choose k'
[PROOF STEP]
using assms binomial_strict_mono[of k k' n]
[PROOF STATE]
proof (prove)
using this:
k \<le> k'
2 * k' \<le> n
\<lbrakk>k < k'; 2 * k' \<le> n\<rbrakk> \<Longrightarrow> n choose k < n choose k'

goal (1 subgoal):
 1. n choose k \<le> n choose k'
[PROOF STEP]
by (cases "k = k'") simp_all


[STATEMENT]
lemma has_integral_null_eq[simp]: "content (cbox a b) = 0 \<Longrightarrow> (f has_integral i) (cbox a b) \<longleftrightarrow> i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (cbox a b) = 0 \<Longrightarrow> (f has_integral i) (cbox a b) = (i = (0::'b))
[PROOF STEP]
by (auto simp add: has_integral_null dest!: integral_unique)


[STATEMENT]
lemma one_mat_ge_zero: "(1\<^sub>m n :: 'a :: ordered_semiring_1 mat) \<ge>\<^sub>m 0\<^sub>m n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m n \<ge>\<^sub>m 0\<^sub>m n n
[PROOF STEP]
by (intro mat_geI[of _ n n], auto simp: one_ge_zero ge_refl)


[STATEMENT]
lemma pell_valuation_uminus_uminus [simp]: "pell_valuation (-x, -y) = -pell_valuation (x, y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pell_valuation (- x, - y) = - pell_valuation (x, y)
[PROOF STEP]
by (simp add: pell_valuation_def)


[STATEMENT]
lemma fps_XD'_minus [simp]: "fps_XD' a (b - c :: 'a :: comm_ring_1 fps) = fps_XD' a b - fps_XD' a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_XD' a (b - c) = fps_XD' a b - fps_XD' a c
[PROOF STEP]
by (simp add: fps_XD'_def algebra_simps)


[STATEMENT]
lemma atLeast_iff[iff]: "(i \<in> {k\<le>\<^sub>a..}) = (k \<le>\<^sub>a i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<in> {k\<le>\<^sub>a..}) = (k \<le>\<^sub>a i)
[PROOF STEP]
unfolding ray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<in> {x \<in> UNIV. k \<le>\<^sub>a x}) = (k \<le>\<^sub>a i)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in finite_measure) finite_measure_Union':
  "A \<in> sets M \<Longrightarrow> B \<in> sets M \<Longrightarrow> measure M (A \<union> B) = measure M A + measure M (B - A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> sets M; B \<in> sets M\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (A \<union> B) = Sigma_Algebra.measure M A + Sigma_Algebra.measure M (B - A)
[PROOF STEP]
using finite_measure_Union[of A "B - A"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A \<in> sets M; B - A \<in> sets M; A \<inter> (B - A) = {}\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (A \<union> (B - A)) = Sigma_Algebra.measure M A + Sigma_Algebra.measure M (B - A)

goal (1 subgoal):
 1. \<lbrakk>A \<in> sets M; B \<in> sets M\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (A \<union> B) = Sigma_Algebra.measure M A + Sigma_Algebra.measure M (B - A)
[PROOF STEP]
by auto


[STATEMENT]
lemma exp_times_self_mono:
  assumes "x \<ge> -1" "x \<le> (y :: real)"
  shows   "x * exp x \<le> y * exp y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * exp x \<le> y * exp y
[PROOF STEP]
using exp_times_self_strict_mono[of x y] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- 1 \<le> x; x < y\<rbrakk> \<Longrightarrow> x * exp x < y * exp y
- 1 \<le> x
x \<le> y

goal (1 subgoal):
 1. x * exp x \<le> y * exp y
[PROOF STEP]
by (cases "x = y") auto


[STATEMENT]
lemma vector_cart:
  fixes f :: "real^'n \<Rightarrow> real"
  shows "(\<chi> i. f (axis i 1)) = (\<Sum>i\<in>Basis. f i *\<^sub>R i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i. f (axis i 1)) = (\<Sum>i\<in>Basis. f i *\<^sub>R i)
[PROOF STEP]
unfolding euclidean_eq_iff[where 'a="real^'n"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>b\<in>Basis. (\<chi>i. f (axis i 1)) \<bullet> b = (\<Sum>i\<in>Basis. f i *\<^sub>R i) \<bullet> b
[PROOF STEP]
by simp (simp add: Basis_vec_def inner_axis)


[STATEMENT]
theorem hinv_insrt: "hinv t \<Longrightarrow> hinv (insrt x t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hinv t \<Longrightarrow> hinv (insrt x t)
[PROOF STEP]
by (induct t) (simp_all add: Let_def height_hinv hinv_l_bal hinv_r_bal)


[STATEMENT]
lemma finite_HAStates [simp]:
  "finite (HAStates HA)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (HAStates HA)
[PROOF STEP]
apply (cut_tac Rep_hierauto_select)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (HAInitValue ?HA1, SAs ?HA1, HAEvents ?HA1, CompFun ?HA1) \<in> hierauto \<Longrightarrow> finite (HAStates HA)
[PROOF STEP]
apply (unfold hierauto_def HierAuto_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (HAInitValue ?HA1, SAs ?HA1, HAEvents ?HA1, CompFun ?HA1) \<in> {(D, F, E, G) |D F E G. \<Union> (SAEvents ` F) \<subseteq> E \<and> MutuallyDistinct F \<and> finite F \<and> IsCompFun F G} \<Longrightarrow> finite (HAStates HA)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<Union> (SAEvents ` SAs ?HA1) \<subseteq> HAEvents ?HA1; MutuallyDistinct (SAs ?HA1); finite (SAs ?HA1); IsCompFun (SAs ?HA1) (CompFun ?HA1)\<rbrakk> \<Longrightarrow> finite (HAStates HA)
[PROOF STEP]
apply (simp add: HAStates_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<Union> (SAEvents ` SAs ?HA1) \<subseteq> HAEvents ?HA1; MutuallyDistinct (SAs ?HA1); finite (SAs ?HA1); IsCompFun (SAs ?HA1) (CompFun ?HA1)\<rbrakk> \<Longrightarrow> finite (\<Union> (States ` SAs HA))
[PROOF STEP]
apply (rule finite_UN_I)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<Union> (SAEvents ` SAs ?HA1) \<subseteq> HAEvents ?HA1; MutuallyDistinct (SAs ?HA1); finite (SAs ?HA1); IsCompFun (SAs ?HA1) (CompFun ?HA1)\<rbrakk> \<Longrightarrow> finite (SAs HA)
 2. \<And>A. \<lbrakk>\<Union> (SAEvents ` SAs ?HA1) \<subseteq> HAEvents ?HA1; MutuallyDistinct (SAs ?HA1); finite (SAs ?HA1); IsCompFun (SAs ?HA1) (CompFun ?HA1); A \<in> SAs HA\<rbrakk> \<Longrightarrow> finite (States A)
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>\<Union> (SAEvents ` SAs HA) \<subseteq> HAEvents HA; MutuallyDistinct (SAs HA); finite (SAs HA); IsCompFun (SAs HA) (CompFun HA); A \<in> SAs HA\<rbrakk> \<Longrightarrow> finite (States A)
[PROOF STEP]
apply (rule finite_States)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma real_of_nat_div: "real (a div b) = real_of_int \<lfloor>real a / real b\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (a div b) = real_of_int \<lfloor>real a / real b\<rfloor>
[PROOF STEP]
by (subst floor_divide_of_nat_eq) auto


[STATEMENT]
lemma bezw_aux: "int (gcd x y) = fst (bezw x y) * int x + snd (bezw x y) * int y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (gcd x y) = fst (bezw x y) * int x + snd (bezw x y) * int y
[PROOF STEP]
proof (induct x y rule: gcd_nat_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>m. int (gcd m 0) = fst (bezw m 0) * int m + snd (bezw m 0) * int 0
 2. \<And>m n. \<lbrakk>0 < n; int (gcd n (m mod n)) = fst (bezw n (m mod n)) * int n + snd (bezw n (m mod n)) * int (m mod n)\<rbrakk> \<Longrightarrow> int (gcd m n) = fst (bezw m n) * int m + snd (bezw m n) * int n
[PROOF STEP]
case (step m n)
[PROOF STATE]
proof (state)
this:
0 < n
int (gcd n (m mod n)) = fst (bezw n (m mod n)) * int n + snd (bezw n (m mod n)) * int (m mod n)

goal (2 subgoals):
 1. \<And>m. int (gcd m 0) = fst (bezw m 0) * int m + snd (bezw m 0) * int 0
 2. \<And>m n. \<lbrakk>0 < n; int (gcd n (m mod n)) = fst (bezw n (m mod n)) * int n + snd (bezw n (m mod n)) * int (m mod n)\<rbrakk> \<Longrightarrow> int (gcd m n) = fst (bezw m n) * int m + snd (bezw m n) * int n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < n
int (gcd n (m mod n)) = fst (bezw n (m mod n)) * int n + snd (bezw n (m mod n)) * int (m mod n)
[PROOF STEP]
have "fst (bezw m n) * int m + snd (bezw m n) * int n - int (gcd m n)
             = int m * snd (bezw n (m mod n)) -
               (int (m mod n) * snd (bezw n (m mod n)) + int n * (int (m div n) * snd (bezw n (m mod n))))"
[PROOF STATE]
proof (prove)
using this:
0 < n
int (gcd n (m mod n)) = fst (bezw n (m mod n)) * int n + snd (bezw n (m mod n)) * int (m mod n)

goal (1 subgoal):
 1. fst (bezw m n) * int m + snd (bezw m n) * int n - int (gcd m n) = int m * snd (bezw n (m mod n)) - (int (m mod n) * snd (bezw n (m mod n)) + int n * (int (m div n) * snd (bezw n (m mod n))))
[PROOF STEP]
by (simp add: bezw_non_0 gcd_non_0_nat field_simps)
[PROOF STATE]
proof (state)
this:
fst (bezw m n) * int m + snd (bezw m n) * int n - int (gcd m n) = int m * snd (bezw n (m mod n)) - (int (m mod n) * snd (bezw n (m mod n)) + int n * (int (m div n) * snd (bezw n (m mod n))))

goal (2 subgoals):
 1. \<And>m. int (gcd m 0) = fst (bezw m 0) * int m + snd (bezw m 0) * int 0
 2. \<And>m n. \<lbrakk>0 < n; int (gcd n (m mod n)) = fst (bezw n (m mod n)) * int n + snd (bezw n (m mod n)) * int (m mod n)\<rbrakk> \<Longrightarrow> int (gcd m n) = fst (bezw m n) * int m + snd (bezw m n) * int n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fst (bezw m n) * int m + snd (bezw m n) * int n - int (gcd m n) = int m * snd (bezw n (m mod n)) - (int (m mod n) * snd (bezw n (m mod n)) + int n * (int (m div n) * snd (bezw n (m mod n))))

goal (2 subgoals):
 1. \<And>m. int (gcd m 0) = fst (bezw m 0) * int m + snd (bezw m 0) * int 0
 2. \<And>m n. \<lbrakk>0 < n; int (gcd n (m mod n)) = fst (bezw n (m mod n)) * int n + snd (bezw n (m mod n)) * int (m mod n)\<rbrakk> \<Longrightarrow> int (gcd m n) = fst (bezw m n) * int m + snd (bezw m n) * int n
[PROOF STEP]
have "\<dots> = int m * snd (bezw n (m mod n)) - (int (m mod n) + int (n * (m div n))) * snd (bezw n (m mod n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int m * snd (bezw n (m mod n)) - (int (m mod n) * snd (bezw n (m mod n)) + int n * (int (m div n) * snd (bezw n (m mod n)))) = int m * snd (bezw n (m mod n)) - (int (m mod n) + int (n * (m div n))) * snd (bezw n (m mod n))
[PROOF STEP]
by (simp add: distrib_right)
[PROOF STATE]
proof (state)
this:
int m * snd (bezw n (m mod n)) - (int (m mod n) * snd (bezw n (m mod n)) + int n * (int (m div n) * snd (bezw n (m mod n)))) = int m * snd (bezw n (m mod n)) - (int (m mod n) + int (n * (m div n))) * snd (bezw n (m mod n))

goal (2 subgoals):
 1. \<And>m. int (gcd m 0) = fst (bezw m 0) * int m + snd (bezw m 0) * int 0
 2. \<And>m n. \<lbrakk>0 < n; int (gcd n (m mod n)) = fst (bezw n (m mod n)) * int n + snd (bezw n (m mod n)) * int (m mod n)\<rbrakk> \<Longrightarrow> int (gcd m n) = fst (bezw m n) * int m + snd (bezw m n) * int n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int m * snd (bezw n (m mod n)) - (int (m mod n) * snd (bezw n (m mod n)) + int n * (int (m div n) * snd (bezw n (m mod n)))) = int m * snd (bezw n (m mod n)) - (int (m mod n) + int (n * (m div n))) * snd (bezw n (m mod n))

goal (2 subgoals):
 1. \<And>m. int (gcd m 0) = fst (bezw m 0) * int m + snd (bezw m 0) * int 0
 2. \<And>m n. \<lbrakk>0 < n; int (gcd n (m mod n)) = fst (bezw n (m mod n)) * int n + snd (bezw n (m mod n)) * int (m mod n)\<rbrakk> \<Longrightarrow> int (gcd m n) = fst (bezw m n) * int m + snd (bezw m n) * int n
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int m * snd (bezw n (m mod n)) - (int (m mod n) + int (n * (m div n))) * snd (bezw n (m mod n)) = 0
[PROOF STEP]
by (metis cancel_comm_monoid_add_class.diff_cancel mod_mult_div_eq of_nat_add)
[PROOF STATE]
proof (state)
this:
int m * snd (bezw n (m mod n)) - (int (m mod n) + int (n * (m div n))) * snd (bezw n (m mod n)) = 0

goal (2 subgoals):
 1. \<And>m. int (gcd m 0) = fst (bezw m 0) * int m + snd (bezw m 0) * int 0
 2. \<And>m n. \<lbrakk>0 < n; int (gcd n (m mod n)) = fst (bezw n (m mod n)) * int n + snd (bezw n (m mod n)) * int (m mod n)\<rbrakk> \<Longrightarrow> int (gcd m n) = fst (bezw m n) * int m + snd (bezw m n) * int n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fst (bezw m n) * int m + snd (bezw m n) * int n - int (gcd m n) = 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fst (bezw m n) * int m + snd (bezw m n) * int n - int (gcd m n) = 0

goal (1 subgoal):
 1. int (gcd m n) = fst (bezw m n) * int m + snd (bezw m n) * int n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (gcd m n) = fst (bezw m n) * int m + snd (bezw m n) * int n

goal (1 subgoal):
 1. \<And>m. int (gcd m 0) = fst (bezw m 0) * int m + snd (bezw m 0) * int 0
[PROOF STEP]
qed auto


[STATEMENT]
lemma nn_integral_lborel_eq_integral:
  fixes f::"'a::euclidean_space \<Rightarrow> real"
  assumes f: "f \<in> borel_measurable borel" "\<And>x. 0 \<le> f x" "(\<integral>\<^sup>+x. f x \<partial>lborel) < \<infinity>"
  shows "(\<integral>\<^sup>+x. f x \<partial>lborel) = integral UNIV f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal (integral UNIV f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal (integral UNIV f)
[PROOF STEP]
from f(3)
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel < \<infinity>
[PROOF STEP]
obtain r where r: "(\<integral>\<^sup>+x. f x \<partial>lborel) = ennreal r" "0 \<le> r"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel < \<infinity>

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal r; 0 \<le> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "\<integral>\<^sup>+x. f x \<partial>lborel" rule: ennreal_cases) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal r
0 \<le> r

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal (integral UNIV f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal r
0 \<le> r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal r
0 \<le> r

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal (integral UNIV f)
[PROOF STEP]
using nn_integral_has_integral[OF f(1,2) r]
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal r
0 \<le> r
(f has_integral r) UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal (integral UNIV f)
[PROOF STEP]
by (simp add: integral_unique)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal (integral UNIV f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_less_binomial_iff [simp]: "n choose k > 0 \<longleftrightarrow> k \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < n choose k) = (k \<le> n)
[PROOF STEP]
by (metis binomial_eq_0_iff not_less0 not_less zero_less_binomial)


[STATEMENT]
lemma norm_AadjA[simp]: \<open>norm (A* o\<^sub>C\<^sub>L A) = (norm A)\<^sup>2\<close> for A :: \<open>'a::chilbert_space \<Rightarrow>\<^sub>C\<^sub>L 'b::chilbert_space\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (A* o\<^sub>C\<^sub>L A) = (norm A)\<^sup>2
[PROOF STEP]
by (metis double_adj norm_AAadj norm_adj)


[STATEMENT]
lemma wf_converse:
  shows "(wfP r^--1) = (wf (relset\<inverse>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wfP (\<rightarrow>)\<inverse>\<inverse> = wf ({(x, y). x \<rightarrow> y}\<inverse>)
[PROOF STEP]
unfolding wfP_def converse_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(x, y). (\<rightarrow>)\<inverse>\<inverse> x y} = wf {(x, y). (\<lambda>x xa. (x, xa) \<in> {(x, y). x \<rightarrow> y})\<inverse>\<inverse> x y}
[PROOF STEP]
by simp


[STATEMENT]
lemma sum_sum_distr:
  assumes "finite X"
  and "finite Y"
  shows "\<Sum>((\<lambda>y. (\<Sum>X) \<cdot> (y :: 'a::dioid_one_zero)) ` Y) = \<Sum>{x \<cdot> y|x y. x \<in> X \<and> y \<in> Y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> ((\<cdot>) (\<Sum> X) ` Y) = \<Sum> {x \<cdot> y |x y. x \<in> X \<and> y \<in> Y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sum> ((\<cdot>) (\<Sum> X) ` Y) = \<Sum> {x \<cdot> y |x y. x \<in> X \<and> y \<in> Y}
[PROOF STEP]
have "\<Sum>((\<lambda>y. (\<Sum>X) \<cdot> y) ` Y) = \<Sum>{\<Sum>{x \<cdot> y |x. x \<in> X} |y. y \<in> Y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> ((\<cdot>) (\<Sum> X) ` Y) = \<Sum> {\<Sum> {x \<cdot> y |x. x \<in> X} |y. y \<in> Y}
[PROOF STEP]
by (auto simp add: sum_distr assms fset_to_im)
[PROOF STATE]
proof (state)
this:
\<Sum> ((\<cdot>) (\<Sum> X) ` Y) = \<Sum> {\<Sum> {x \<cdot> y |x. x \<in> X} |y. y \<in> Y}

goal (1 subgoal):
 1. \<Sum> ((\<cdot>) (\<Sum> X) ` Y) = \<Sum> {x \<cdot> y |x y. x \<in> X \<and> y \<in> Y}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Sum> ((\<cdot>) (\<Sum> X) ` Y) = \<Sum> {\<Sum> {x \<cdot> y |x. x \<in> X} |y. y \<in> Y}

goal (1 subgoal):
 1. \<Sum> ((\<cdot>) (\<Sum> X) ` Y) = \<Sum> {x \<cdot> y |x y. x \<in> X \<and> y \<in> Y}
[PROOF STEP]
by (simp add: assms sum_flatten2)
[PROOF STATE]
proof (state)
this:
\<Sum> ((\<cdot>) (\<Sum> X) ` Y) = \<Sum> {x \<cdot> y |x y. x \<in> X \<and> y \<in> Y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_in_Ints_mat_iff[simp]: "(-A) \<in> \<int>\<^sub>m \<longleftrightarrow> (A :: 'a :: ring_1 mat) \<in> \<int>\<^sub>m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- A \<in> \<int>\<^sub>m) = (A \<in> \<int>\<^sub>m)
[PROOF STEP]
unfolding Ints_mat_elements_mat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (elements_mat (- A) \<subseteq> \<int>) = (elements_mat A \<subseteq> \<int>)
[PROOF STEP]
by (auto simp: minus_in_Ints_iff)


[STATEMENT]
lemma openin_subtopology_diff_closed:
   "\<lbrakk>S \<subseteq> topspace X; closedin X T\<rbrakk> \<Longrightarrow> openin (subtopology X S) (S - T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> topspace X; closedin X T\<rbrakk> \<Longrightarrow> openin (subtopology X S) (S - T)
[PROOF STEP]
unfolding closedin_def openin_subtopology
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> topspace X; T \<subseteq> topspace X \<and> openin X (topspace X - T)\<rbrakk> \<Longrightarrow> \<exists>Ta. openin X Ta \<and> S - T = Ta \<inter> S
[PROOF STEP]
by (rule_tac x="topspace X - T" in exI) auto


[STATEMENT]
lemma lm064:
  "injectionsUniverse \<inter> (totalRels {} Y)  =  {{}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. injectionsUniverse \<inter> totalRels {} Y = {{}}
[PROOF STEP]
using lm062 lm063
[PROOF STATE]
proof (prove)
using this:
totalRels {} ?Y = {{}}
{} \<in> injectionsUniverse

goal (1 subgoal):
 1. injectionsUniverse \<inter> totalRels {} Y = {{}}
[PROOF STEP]
by fast


[STATEMENT]
lemma prod_of_cont_is_cont:
  assumes "is_Zp_continuous f"
  assumes "is_Zp_continuous g"
  shows "is_Zp_continuous (f \<otimes>\<^bsub>Fun Zp\<^esub> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_Zp_continuous (f \<otimes>\<^bsub>function_ring (carrier Zp) Zp\<^esub> g)
[PROOF STEP]
apply(rule is_Zp_continuousI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. f \<otimes>\<^bsub>function_ring (carrier Zp) Zp\<^esub> g \<in> carrier (function_ring (carrier Zp) Zp)
 2. \<And>s. is_Zp_cauchy s \<Longrightarrow> is_Zp_cauchy (f \<otimes>\<^bsub>function_ring (carrier Zp) Zp\<^esub> g \<circ> s)
[PROOF STEP]
using assms Zp_continuous_is_closed assms
[PROOF STATE]
proof (prove)
using this:
is_Zp_continuous f
is_Zp_continuous g
is_Zp_continuous ?f \<Longrightarrow> ?f \<in> carrier (function_ring (carrier Zp) Zp)
is_Zp_continuous f
is_Zp_continuous g

goal (2 subgoals):
 1. f \<otimes>\<^bsub>function_ring (carrier Zp) Zp\<^esub> g \<in> carrier (function_ring (carrier Zp) Zp)
 2. \<And>s. is_Zp_cauchy s \<Longrightarrow> is_Zp_cauchy (f \<otimes>\<^bsub>function_ring (carrier Zp) Zp\<^esub> g \<circ> s)
[PROOF STEP]
apply (simp add: fun_mult_closed)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. is_Zp_cauchy s \<Longrightarrow> is_Zp_cauchy (f \<otimes>\<^bsub>function_ring (carrier Zp) Zp\<^esub> g \<circ> s)
[PROOF STEP]
using  function_mult_comp_is_seq_mult[of _ f g] assms(1) assms(2) is_Zp_cauchy_imp_closed
    is_Zp_continuous_def prod_of_Zp_cauchy_is_Zp_cauchy
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?s \<in> carrier Zp\<^bsup>\<omega>\<^esup>; f \<in> carrier (function_ring (carrier Zp) Zp); g \<in> carrier (function_ring (carrier Zp) Zp)\<rbrakk> \<Longrightarrow> f \<otimes>\<^bsub>function_ring (carrier Zp) Zp\<^esub> g \<circ> ?s = (f \<circ> ?s) \<otimes>\<^bsub>Zp\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> ?s)
is_Zp_continuous f
is_Zp_continuous g
is_Zp_cauchy ?s \<Longrightarrow> ?s \<in> carrier Zp\<^bsup>\<omega>\<^esup>
is_Zp_continuous ?f = (?f \<in> carrier (function_ring (carrier Zp) Zp) \<and> (\<forall>s. is_Zp_cauchy s \<longrightarrow> is_Zp_cauchy (?f \<circ> s)))
\<lbrakk>is_Zp_cauchy ?s; is_Zp_cauchy ?t\<rbrakk> \<Longrightarrow> is_Zp_cauchy (?s \<otimes>\<^bsub>Zp\<^bsup>\<omega>\<^esup>\<^esub> ?t)

goal (1 subgoal):
 1. \<And>s. is_Zp_cauchy s \<Longrightarrow> is_Zp_cauchy (f \<otimes>\<^bsub>function_ring (carrier Zp) Zp\<^esub> g \<circ> s)
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_list_independent_pdevs: "sum_list (independent_pdevs xs) = sum_list xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (independent_pdevs xs) = sum_list xs
[PROOF STEP]
proof (induct xs rule: independent_pdevs.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sum_list (independent_pdevs []) = sum_list []
 2. \<And>x xs. (\<And>xa xb y xaa. \<lbrakk>xa = partition (coll 0 x) xs; (xb, y) = xa; xaa = x + sum_list xb\<rbrakk> \<Longrightarrow> sum_list (independent_pdevs y) = sum_list y) \<Longrightarrow> sum_list (independent_pdevs (x # xs)) = sum_list (x # xs)
[PROOF STEP]
case (2 y ys)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?xa = partition (coll 0 y) ys; (?xb, ?y) = ?xa; ?xaa = y + sum_list ?xb\<rbrakk> \<Longrightarrow> sum_list (independent_pdevs ?y) = sum_list ?y

goal (2 subgoals):
 1. sum_list (independent_pdevs []) = sum_list []
 2. \<And>x xs. (\<And>xa xb y xaa. \<lbrakk>xa = partition (coll 0 x) xs; (xb, y) = xa; xaa = x + sum_list xb\<rbrakk> \<Longrightarrow> sum_list (independent_pdevs y) = sum_list y) \<Longrightarrow> sum_list (independent_pdevs (x # xs)) = sum_list (x # xs)
[PROOF STEP]
from 2[OF refl prod.collapse refl]
[PROOF STATE]
proof (chain)
picking this:
sum_list (independent_pdevs (snd (partition (coll 0 y) ys))) = sum_list (snd (partition (coll 0 y) ys))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sum_list (independent_pdevs (snd (partition (coll 0 y) ys))) = sum_list (snd (partition (coll 0 y) ys))

goal (1 subgoal):
 1. sum_list (independent_pdevs (y # ys)) = sum_list (y # ys)
[PROOF STEP]
using sum_list_partition[of "coll 0 y" ys, symmetric]
[PROOF STATE]
proof (prove)
using this:
sum_list (independent_pdevs (snd (partition (coll 0 y) ys))) = sum_list (snd (partition (coll 0 y) ys))
sum_list ys = sum_list (filter (coll 0 y) ys) + sum_list (filter (Not \<circ> coll 0 y) ys)

goal (1 subgoal):
 1. sum_list (independent_pdevs (y # ys)) = sum_list (y # ys)
[PROOF STEP]
by (auto simp: Let_def)
[PROOF STATE]
proof (state)
this:
sum_list (independent_pdevs (y # ys)) = sum_list (y # ys)

goal (1 subgoal):
 1. sum_list (independent_pdevs []) = sum_list []
[PROOF STEP]
qed simp


[STATEMENT]
lemma mset_set_eq_iff[simp]:
  assumes "finite A" "finite B"
  shows "mset_set A = mset_set B \<longleftrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mset_set A = mset_set B) = (A = B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. (mset_set A = mset_set B) = (A = B)
[PROOF STEP]
by (fastforce dest: finite_set_mset_mset_set)


[STATEMENT]
lemma robdd_invar_ids_subset_subrobdds_rule :
assumes pre: "\<And>b2. b2 \<in> bs2 \<Longrightarrow> \<exists>b1 \<in> bs1. b2 \<in> (subrobdds b1)"
    and invar_bs1: "robdd_invar_ids bs1"
shows "robdd_invar_ids bs2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. robdd_invar_ids bs2
[PROOF STEP]
apply (rule robdd_invar_ids_subset_rule [of "subrobdds_set bs1"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. robdd_invar_ids (subrobdds_set bs1)
 2. bs2 \<subseteq> subrobdds_set bs1
[PROOF STEP]
apply (simp add: robdd_invar_ids_expand invar_bs1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bs2 \<subseteq> subrobdds_set bs1
[PROOF STEP]
apply (simp add: subset_iff pre subrobdds_set_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma edge_density_commute: "edge_density X Y G = edge_density Y X G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edge_density X Y G = edge_density Y X G
[PROOF STEP]
by (simp add: edge_density_def card_all_edges_between_commute mult.commute)


[STATEMENT]
lemma pm_of_idx_pm_plus: "pm_of_idx_pm xs (f + g) = pm_of_idx_pm xs f + pm_of_idx_pm xs g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pm_of_idx_pm xs (f + g) = pm_of_idx_pm xs f + pm_of_idx_pm xs g
[PROOF STEP]
by (rule poly_mapping_eqI, simp add: lookup_pm_of_idx_pm lookup_add when_def)


[STATEMENT]
lemma LeadsTo_UN:
     "(!!i. i \<in> I ==> F \<in> (A i) LeadsTo B) ==> F \<in> (\<Union>i \<in> I. A i) LeadsTo B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto>w B) \<Longrightarrow> F \<in> \<Union> (A ` I) \<longmapsto>w B
[PROOF STEP]
apply (blast intro: LeadsTo_Union)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ordertype_eqI:
  assumes "wf r" "total_on A r" "small A" "wf s"
          "bij_betw f A B" "(\<forall>x \<in> A. \<forall>y \<in> A. (f x, f y) \<in> s \<longleftrightarrow> (x,y) \<in> r)"
  shows "ordertype A r = ordertype B s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype A r = ordertype B s
[PROOF STEP]
by (metis assms bij_betw_imp_surj_on ordertype_inc_eq)


[STATEMENT]
theorem avl_insert_aux:
  assumes "avl t"
  shows "avl(insert x t)"
        "(height (insert x t) = height t \<or> height (insert x t) = height t + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. avl (AVL.insert x t) &&& height (AVL.insert x t) = height t \<or> height (AVL.insert x t) = height t + 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
avl t

goal (1 subgoal):
 1. avl (AVL.insert x t) &&& height (AVL.insert x t) = height t \<or> height (AVL.insert x t) = height t + 1
[PROOF STEP]
proof (induction t)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. avl ET \<Longrightarrow> avl (AVL.insert x ET)
 2. avl ET \<Longrightarrow> height (AVL.insert x ET) = height ET \<or> height (AVL.insert x ET) = height ET + 1
 3. \<And>x1 t1 t2 x4. \<lbrakk>avl t1 \<Longrightarrow> avl (AVL.insert x t1); avl t1 \<Longrightarrow> height (AVL.insert x t1) = height t1 \<or> height (AVL.insert x t1) = height t1 + 1; avl t2 \<Longrightarrow> avl (AVL.insert x t2); avl t2 \<Longrightarrow> height (AVL.insert x t2) = height t2 \<or> height (AVL.insert x t2) = height t2 + 1; avl (MKT x1 t1 t2 x4)\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT x1 t1 t2 x4))
 4. \<And>x1 t1 t2 x4. \<lbrakk>avl t1 \<Longrightarrow> avl (AVL.insert x t1); avl t1 \<Longrightarrow> height (AVL.insert x t1) = height t1 \<or> height (AVL.insert x t1) = height t1 + 1; avl t2 \<Longrightarrow> avl (AVL.insert x t2); avl t2 \<Longrightarrow> height (AVL.insert x t2) = height t2 \<or> height (AVL.insert x t2) = height t2 + 1; avl (MKT x1 t1 t2 x4)\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT x1 t1 t2 x4)) = height (MKT x1 t1 t2 x4) \<or> height (AVL.insert x (MKT x1 t1 t2 x4)) = height (MKT x1 t1 t2 x4) + 1
[PROOF STEP]
case (MKT n l r h)
[PROOF STATE]
proof (state)
this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1

goal (4 subgoals):
 1. avl ET \<Longrightarrow> avl (AVL.insert x ET)
 2. avl ET \<Longrightarrow> height (AVL.insert x ET) = height ET \<or> height (AVL.insert x ET) = height ET + 1
 3. \<And>x1 t1 t2 x4. \<lbrakk>avl t1 \<Longrightarrow> avl (AVL.insert x t1); avl t1 \<Longrightarrow> height (AVL.insert x t1) = height t1 \<or> height (AVL.insert x t1) = height t1 + 1; avl t2 \<Longrightarrow> avl (AVL.insert x t2); avl t2 \<Longrightarrow> height (AVL.insert x t2) = height t2 \<or> height (AVL.insert x t2) = height t2 + 1; avl (MKT x1 t1 t2 x4)\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT x1 t1 t2 x4))
 4. \<And>x1 t1 t2 x4. \<lbrakk>avl t1 \<Longrightarrow> avl (AVL.insert x t1); avl t1 \<Longrightarrow> height (AVL.insert x t1) = height t1 \<or> height (AVL.insert x t1) = height t1 + 1; avl t2 \<Longrightarrow> avl (AVL.insert x t2); avl t2 \<Longrightarrow> height (AVL.insert x t2) = height t2 \<or> height (AVL.insert x t2) = height t2 + 1; avl (MKT x1 t1 t2 x4)\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT x1 t1 t2 x4)) = height (MKT x1 t1 t2 x4) \<or> height (AVL.insert x (MKT x1 t1 t2 x4)) = height (MKT x1 t1 t2 x4) + 1
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
avl (MKT n l r h)

goal (4 subgoals):
 1. avl ET \<Longrightarrow> avl (AVL.insert x ET)
 2. avl ET \<Longrightarrow> height (AVL.insert x ET) = height ET \<or> height (AVL.insert x ET) = height ET + 1
 3. \<And>x1 t1 t2 x4. \<lbrakk>avl t1 \<Longrightarrow> avl (AVL.insert x t1); avl t1 \<Longrightarrow> height (AVL.insert x t1) = height t1 \<or> height (AVL.insert x t1) = height t1 + 1; avl t2 \<Longrightarrow> avl (AVL.insert x t2); avl t2 \<Longrightarrow> height (AVL.insert x t2) = height t2 \<or> height (AVL.insert x t2) = height t2 + 1; avl (MKT x1 t1 t2 x4)\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT x1 t1 t2 x4))
 4. \<And>x1 t1 t2 x4. \<lbrakk>avl t1 \<Longrightarrow> avl (AVL.insert x t1); avl t1 \<Longrightarrow> height (AVL.insert x t1) = height t1 \<or> height (AVL.insert x t1) = height t1 + 1; avl t2 \<Longrightarrow> avl (AVL.insert x t2); avl t2 \<Longrightarrow> height (AVL.insert x t2) = height t2 \<or> height (AVL.insert x t2) = height t2 + 1; avl (MKT x1 t1 t2 x4)\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT x1 t1 t2 x4)) = height (MKT x1 t1 t2 x4) \<or> height (AVL.insert x (MKT x1 t1 t2 x4)) = height (MKT x1 t1 t2 x4) + 1
[PROOF STEP]
with MKT
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)

goal (1 subgoal):
 1. avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
proof(cases "x = n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x = n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
 2. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = n

goal (2 subgoals):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x = n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
 2. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
with MKT 1
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x = n

goal (1 subgoal):
 1. avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
avl (AVL.insert x (MKT n l r h))

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> n

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
with MKT 1
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x \<noteq> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x \<noteq> n

goal (1 subgoal):
 1. avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
proof(cases "x<n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; x < n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
 2. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < n

goal (2 subgoals):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; x < n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
 2. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
with MKT 1
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x < n

goal (1 subgoal):
 1. avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
by (auto simp add:avl_mkt_bal_l simp del:mkt_bal_l.simps)
[PROOF STATE]
proof (state)
this:
avl (AVL.insert x (MKT n l r h))

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x < n

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
with MKT 1 \<open>x\<noteq>n\<close>
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x \<noteq> n
\<not> x < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x \<noteq> n
\<not> x < n

goal (1 subgoal):
 1. avl (AVL.insert x (MKT n l r h))
[PROOF STEP]
by (auto simp add:avl_mkt_bal_r simp del:mkt_bal_r.simps)
[PROOF STATE]
proof (state)
this:
avl (AVL.insert x (MKT n l r h))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
avl (AVL.insert x (MKT n l r h))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
avl (AVL.insert x (MKT n l r h))

goal (3 subgoals):
 1. avl ET \<Longrightarrow> avl (AVL.insert x ET)
 2. avl ET \<Longrightarrow> height (AVL.insert x ET) = height ET \<or> height (AVL.insert x ET) = height ET + 1
 3. \<And>x1 t1 t2 x4. \<lbrakk>avl t1 \<Longrightarrow> avl (AVL.insert x t1); avl t1 \<Longrightarrow> height (AVL.insert x t1) = height t1 \<or> height (AVL.insert x t1) = height t1 + 1; avl t2 \<Longrightarrow> avl (AVL.insert x t2); avl t2 \<Longrightarrow> height (AVL.insert x t2) = height t2 \<or> height (AVL.insert x t2) = height t2 + 1; avl (MKT x1 t1 t2 x4)\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT x1 t1 t2 x4)) = height (MKT x1 t1 t2 x4) \<or> height (AVL.insert x (MKT x1 t1 t2 x4)) = height (MKT x1 t1 t2 x4) + 1
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
avl (MKT n l r h)

goal (3 subgoals):
 1. avl ET \<Longrightarrow> avl (AVL.insert x ET)
 2. avl ET \<Longrightarrow> height (AVL.insert x ET) = height ET \<or> height (AVL.insert x ET) = height ET + 1
 3. \<And>x1 t1 t2 x4. \<lbrakk>avl t1 \<Longrightarrow> avl (AVL.insert x t1); avl t1 \<Longrightarrow> height (AVL.insert x t1) = height t1 \<or> height (AVL.insert x t1) = height t1 + 1; avl t2 \<Longrightarrow> avl (AVL.insert x t2); avl t2 \<Longrightarrow> height (AVL.insert x t2) = height t2 \<or> height (AVL.insert x t2) = height t2 + 1; avl (MKT x1 t1 t2 x4)\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT x1 t1 t2 x4)) = height (MKT x1 t1 t2 x4) \<or> height (AVL.insert x (MKT x1 t1 t2 x4)) = height (MKT x1 t1 t2 x4) + 1
[PROOF STEP]
from 2 MKT
[PROOF STATE]
proof (chain)
picking this:
avl (MKT n l r h)
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
avl (MKT n l r h)
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
proof(cases "x = n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>avl (MKT n l r h); avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; x = n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. \<lbrakk>avl (MKT n l r h); avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; x \<noteq> n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = n

goal (2 subgoals):
 1. \<lbrakk>avl (MKT n l r h); avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; x = n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. \<lbrakk>avl (MKT n l r h); avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; x \<noteq> n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
with MKT 1
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x = n

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal (1 subgoal):
 1. \<lbrakk>avl (MKT n l r h); avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; x \<noteq> n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>avl (MKT n l r h); avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; x \<noteq> n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> n

goal (1 subgoal):
 1. \<lbrakk>avl (MKT n l r h); avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; x \<noteq> n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
with MKT 1
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x \<noteq> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x \<noteq> n

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
proof(cases "x<n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; x < n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < n

goal (2 subgoals):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; x < n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
with MKT 2
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x < n

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
proof(cases "height (AVL.insert x l) = height r + 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x < n; height (AVL.insert x l) = height r + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x < n; height (AVL.insert x l) \<noteq> height r + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
height (AVL.insert x l) \<noteq> height r + 2

goal (2 subgoals):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x < n; height (AVL.insert x l) = height r + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x < n; height (AVL.insert x l) \<noteq> height r + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
with MKT 2 \<open>x < n\<close>
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x < n
height (AVL.insert x l) \<noteq> height r + 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
x < n
height (AVL.insert x l) \<noteq> height r + 2

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
by (auto simp del: mkt_bal_l.simps simp: height_mkt_bal_l2)
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x < n; height (AVL.insert x l) = height r + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x < n; height (AVL.insert x l) = height r + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
height (AVL.insert x l) = height r + 2

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x < n; height (AVL.insert x l) = height r + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
height (AVL.insert x l) = height r + 2
[PROOF STEP]
consider (a) "height (mkt_bal_l n (AVL.insert x l) r) = height r + 2"
          | (b) "height (mkt_bal_l n (AVL.insert x l) r) = height r + 3"
[PROOF STATE]
proof (prove)
using this:
height (AVL.insert x l) = height r + 2

goal (1 subgoal):
 1. \<lbrakk>height (mkt_bal_l n (AVL.insert x l) r) = height r + 2 \<Longrightarrow> thesis; height (mkt_bal_l n (AVL.insert x l) r) = height r + 3 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using MKT 2
[PROOF STATE]
proof (prove)
using this:
height (AVL.insert x l) = height r + 2
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)

goal (1 subgoal):
 1. \<lbrakk>height (mkt_bal_l n (AVL.insert x l) r) = height r + 2 \<Longrightarrow> thesis; height (mkt_bal_l n (AVL.insert x l) r) = height r + 3 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (atomize_elim, intro height_mkt_bal_l) simp_all
[PROOF STATE]
proof (state)
this:
\<lbrakk>height (mkt_bal_l n (AVL.insert x l) r) = height r + 2 \<Longrightarrow> ?thesis; height (mkt_bal_l n (AVL.insert x l) r) = height r + 3 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x < n; height (AVL.insert x l) = height r + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>height (mkt_bal_l n (AVL.insert x l) r) = height r + 2 \<Longrightarrow> ?thesis; height (mkt_bal_l n (AVL.insert x l) r) = height r + 3 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>height (mkt_bal_l n (AVL.insert x l) r) = height r + 2 \<Longrightarrow> ?thesis; height (mkt_bal_l n (AVL.insert x l) r) = height r + 3 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. height (mkt_bal_l n (AVL.insert x l) r) = height r + 2 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. height (mkt_bal_l n (AVL.insert x l) r) = height r + 3 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case a
[PROOF STATE]
proof (state)
this:
height (mkt_bal_l n (AVL.insert x l) r) = height r + 2

goal (2 subgoals):
 1. height (mkt_bal_l n (AVL.insert x l) r) = height r + 2 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. height (mkt_bal_l n (AVL.insert x l) r) = height r + 3 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
with 2 \<open>x < n\<close>
[PROOF STATE]
proof (chain)
picking this:
avl (MKT n l r h)
x < n
height (mkt_bal_l n (AVL.insert x l) r) = height r + 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl (MKT n l r h)
x < n
height (mkt_bal_l n (AVL.insert x l) r) = height r + 2

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
by (auto simp del: mkt_bal_l.simps)
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal (1 subgoal):
 1. height (mkt_bal_l n (AVL.insert x l) r) = height r + 3 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. height (mkt_bal_l n (AVL.insert x l) r) = height r + 3 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case b
[PROOF STATE]
proof (state)
this:
height (mkt_bal_l n (AVL.insert x l) r) = height r + 3

goal (1 subgoal):
 1. height (mkt_bal_l n (AVL.insert x l) r) = height r + 3 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
with True 1 MKT(2) \<open>x < n\<close>
[PROOF STATE]
proof (chain)
picking this:
height (AVL.insert x l) = height r + 2
avl (MKT n l r h)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
x < n
height (mkt_bal_l n (AVL.insert x l) r) = height r + 3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
height (AVL.insert x l) = height r + 2
avl (MKT n l r h)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
x < n
height (mkt_bal_l n (AVL.insert x l) r) = height r + 3

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
by (simp del: mkt_bal_l.simps) arith
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x < n

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
with MKT 2
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
\<not> x < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
\<not> x < n

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
proof(cases "height (AVL.insert x r) = height l + 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); \<not> x < n; height (AVL.insert x r) = height l + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); \<not> x < n; height (AVL.insert x r) \<noteq> height l + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
height (AVL.insert x r) \<noteq> height l + 2

goal (2 subgoals):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); \<not> x < n; height (AVL.insert x r) = height l + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); \<not> x < n; height (AVL.insert x r) \<noteq> height l + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
with MKT 2 \<open>\<not>x < n\<close>
[PROOF STATE]
proof (chain)
picking this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
\<not> x < n
height (AVL.insert x r) \<noteq> height l + 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)
\<not> x < n
height (AVL.insert x r) \<noteq> height l + 2

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
by (auto simp del: mkt_bal_r.simps simp: height_mkt_bal_r2)
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); \<not> x < n; height (AVL.insert x r) = height l + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); \<not> x < n; height (AVL.insert x r) = height l + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
height (AVL.insert x r) = height l + 2

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); \<not> x < n; height (AVL.insert x r) = height l + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
height (AVL.insert x r) = height l + 2
[PROOF STEP]
consider (a) "height (mkt_bal_r n l (AVL.insert x r)) = height l + 2"
          | (b) "height (mkt_bal_r n l (AVL.insert x r)) = height l + 3"
[PROOF STATE]
proof (prove)
using this:
height (AVL.insert x r) = height l + 2

goal (1 subgoal):
 1. \<lbrakk>height (mkt_bal_r n l (AVL.insert x r)) = height l + 2 \<Longrightarrow> thesis; height (mkt_bal_r n l (AVL.insert x r)) = height l + 3 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using MKT 2
[PROOF STATE]
proof (prove)
using this:
height (AVL.insert x r) = height l + 2
avl l \<Longrightarrow> avl (AVL.insert x l)
avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1
avl r \<Longrightarrow> avl (AVL.insert x r)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
avl (MKT n l r h)

goal (1 subgoal):
 1. \<lbrakk>height (mkt_bal_r n l (AVL.insert x r)) = height l + 2 \<Longrightarrow> thesis; height (mkt_bal_r n l (AVL.insert x r)) = height l + 3 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (atomize_elim, intro height_mkt_bal_r) simp_all
[PROOF STATE]
proof (state)
this:
\<lbrakk>height (mkt_bal_r n l (AVL.insert x r)) = height l + 2 \<Longrightarrow> ?thesis; height (mkt_bal_r n l (AVL.insert x r)) = height l + 3 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<lbrakk>avl l \<Longrightarrow> avl (AVL.insert x l); avl l \<Longrightarrow> height (AVL.insert x l) = height l \<or> height (AVL.insert x l) = height l + 1; avl r \<Longrightarrow> avl (AVL.insert x r); avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1; avl (MKT n l r h); \<not> x < n; height (AVL.insert x r) = height l + 2\<rbrakk> \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>height (mkt_bal_r n l (AVL.insert x r)) = height l + 2 \<Longrightarrow> ?thesis; height (mkt_bal_r n l (AVL.insert x r)) = height l + 3 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>height (mkt_bal_r n l (AVL.insert x r)) = height l + 2 \<Longrightarrow> ?thesis; height (mkt_bal_r n l (AVL.insert x r)) = height l + 3 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. height (mkt_bal_r n l (AVL.insert x r)) = height l + 2 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. height (mkt_bal_r n l (AVL.insert x r)) = height l + 3 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case a
[PROOF STATE]
proof (state)
this:
height (mkt_bal_r n l (AVL.insert x r)) = height l + 2

goal (2 subgoals):
 1. height (mkt_bal_r n l (AVL.insert x r)) = height l + 2 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
 2. height (mkt_bal_r n l (AVL.insert x r)) = height l + 3 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
with 2 \<open>\<not>x < n\<close>
[PROOF STATE]
proof (chain)
picking this:
avl (MKT n l r h)
\<not> x < n
height (mkt_bal_r n l (AVL.insert x r)) = height l + 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
avl (MKT n l r h)
\<not> x < n
height (mkt_bal_r n l (AVL.insert x r)) = height l + 2

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
by (auto simp del: mkt_bal_r.simps)
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal (1 subgoal):
 1. height (mkt_bal_r n l (AVL.insert x r)) = height l + 3 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. height (mkt_bal_r n l (AVL.insert x r)) = height l + 3 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
case b
[PROOF STATE]
proof (state)
this:
height (mkt_bal_r n l (AVL.insert x r)) = height l + 3

goal (1 subgoal):
 1. height (mkt_bal_r n l (AVL.insert x r)) = height l + 3 \<Longrightarrow> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
with True 1 MKT(4) \<open>\<not>x < n\<close>
[PROOF STATE]
proof (chain)
picking this:
height (AVL.insert x r) = height l + 2
avl (MKT n l r h)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
\<not> x < n
height (mkt_bal_r n l (AVL.insert x r)) = height l + 3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
height (AVL.insert x r) = height l + 2
avl (MKT n l r h)
avl r \<Longrightarrow> height (AVL.insert x r) = height r \<or> height (AVL.insert x r) = height r + 1
\<not> x < n
height (mkt_bal_r n l (AVL.insert x r)) = height l + 3

goal (1 subgoal):
 1. height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1
[PROOF STEP]
by (simp del: mkt_bal_r.simps) arith
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) \<or> height (AVL.insert x (MKT n l r h)) = height (MKT n l r h) + 1

goal (2 subgoals):
 1. avl ET \<Longrightarrow> avl (AVL.insert x ET)
 2. avl ET \<Longrightarrow> height (AVL.insert x ET) = height ET \<or> height (AVL.insert x ET) = height ET + 1
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma AR_homeomorphic_AR:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes "AR T" "S homeomorphic T"
    shows "AR S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AR S
[PROOF STEP]
unfolding AR_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>U S'. S homeomorphic S' \<and> closedin (top_of_set U) S' \<longrightarrow> S' retract_of U
[PROOF STEP]
by (metis assms AR_imp_absolute_retract homeomorphic_trans [of _ S] homeomorphic_sym)


[STATEMENT]
lemma \<Phi>_sum_mset: "\<Phi> t = (\<Sum>s \<in># subtrees_mset t. 6*e*imbal s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Phi> t = (\<Sum>s\<in>#subtrees_mset t. 6 * e * real (imbal s))
[PROOF STEP]
proof(induction t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<Phi> \<langle>\<rangle> = (\<Sum>s\<in>#subtrees_mset \<langle>\<rangle>. 6 * e * real (imbal s))
 2. \<And>t1 x2 t2. \<lbrakk>\<Phi> t1 = (\<Sum>s\<in>#subtrees_mset t1. 6 * e * real (imbal s)); \<Phi> t2 = (\<Sum>s\<in>#subtrees_mset t2. 6 * e * real (imbal s))\<rbrakk> \<Longrightarrow> \<Phi> \<langle>t1, x2, t2\<rangle> = (\<Sum>s\<in>#subtrees_mset \<langle>t1, x2, t2\<rangle>. 6 * e * real (imbal s))
[PROOF STEP]
case Leaf
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<Phi> \<langle>\<rangle> = (\<Sum>s\<in>#subtrees_mset \<langle>\<rangle>. 6 * e * real (imbal s))
 2. \<And>t1 x2 t2. \<lbrakk>\<Phi> t1 = (\<Sum>s\<in>#subtrees_mset t1. 6 * e * real (imbal s)); \<Phi> t2 = (\<Sum>s\<in>#subtrees_mset t2. 6 * e * real (imbal s))\<rbrakk> \<Longrightarrow> \<Phi> \<langle>t1, x2, t2\<rangle> = (\<Sum>s\<in>#subtrees_mset \<langle>t1, x2, t2\<rangle>. 6 * e * real (imbal s))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Phi> \<langle>\<rangle> = (\<Sum>s\<in>#subtrees_mset \<langle>\<rangle>. 6 * e * real (imbal s))
[PROOF STEP]
by(simp add: imbal.simps)
[PROOF STATE]
proof (state)
this:
\<Phi> \<langle>\<rangle> = (\<Sum>s\<in>#subtrees_mset \<langle>\<rangle>. 6 * e * real (imbal s))

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>\<Phi> t1 = (\<Sum>s\<in>#subtrees_mset t1. 6 * e * real (imbal s)); \<Phi> t2 = (\<Sum>s\<in>#subtrees_mset t2. 6 * e * real (imbal s))\<rbrakk> \<Longrightarrow> \<Phi> \<langle>t1, x2, t2\<rangle> = (\<Sum>s\<in>#subtrees_mset \<langle>t1, x2, t2\<rangle>. 6 * e * real (imbal s))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>\<Phi> t1 = (\<Sum>s\<in>#subtrees_mset t1. 6 * e * real (imbal s)); \<Phi> t2 = (\<Sum>s\<in>#subtrees_mset t2. 6 * e * real (imbal s))\<rbrakk> \<Longrightarrow> \<Phi> \<langle>t1, x2, t2\<rangle> = (\<Sum>s\<in>#subtrees_mset \<langle>t1, x2, t2\<rangle>. 6 * e * real (imbal s))
[PROOF STEP]
case Node
[PROOF STATE]
proof (state)
this:
\<Phi> t1_ = (\<Sum>s\<in>#subtrees_mset t1_. 6 * e * real (imbal s))
\<Phi> t2_ = (\<Sum>s\<in>#subtrees_mset t2_. 6 * e * real (imbal s))

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>\<Phi> t1 = (\<Sum>s\<in>#subtrees_mset t1. 6 * e * real (imbal s)); \<Phi> t2 = (\<Sum>s\<in>#subtrees_mset t2. 6 * e * real (imbal s))\<rbrakk> \<Longrightarrow> \<Phi> \<langle>t1, x2, t2\<rangle> = (\<Sum>s\<in>#subtrees_mset \<langle>t1, x2, t2\<rangle>. 6 * e * real (imbal s))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<Phi> t1_ = (\<Sum>s\<in>#subtrees_mset t1_. 6 * e * real (imbal s))
\<Phi> t2_ = (\<Sum>s\<in>#subtrees_mset t2_. 6 * e * real (imbal s))

goal (1 subgoal):
 1. \<Phi> \<langle>t1_, x2_, t2_\<rangle> = (\<Sum>s\<in>#subtrees_mset \<langle>t1_, x2_, t2_\<rangle>. 6 * e * real (imbal s))
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
\<Phi> \<langle>t1_, x2_, t2_\<rangle> = (\<Sum>s\<in>#subtrees_mset \<langle>t1_, x2_, t2_\<rangle>. 6 * e * real (imbal s))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inv_mult_units:
  "[| x \<in> Units G; y \<in> Units G |] ==> inv (x \<otimes> y) = inv y \<otimes> inv x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> Units G; y \<in> Units G\<rbrakk> \<Longrightarrow> inv (x \<otimes> y) = inv y \<otimes> inv x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<in> Units G; y \<in> Units G\<rbrakk> \<Longrightarrow> inv (x \<otimes> y) = inv y \<otimes> inv x
[PROOF STEP]
assume G: "x \<in> Units G"  "y \<in> Units G"
[PROOF STATE]
proof (state)
this:
x \<in> Units G
y \<in> Units G

goal (1 subgoal):
 1. \<lbrakk>x \<in> Units G; y \<in> Units G\<rbrakk> \<Longrightarrow> inv (x \<otimes> y) = inv y \<otimes> inv x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> Units G
y \<in> Units G
[PROOF STEP]
have "x \<in> carrier G"  "y \<in> carrier G"
[PROOF STATE]
proof (prove)
using this:
x \<in> Units G
y \<in> Units G

goal (1 subgoal):
 1. x \<in> carrier G &&& y \<in> carrier G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier G
y \<in> carrier G

goal (1 subgoal):
 1. \<lbrakk>x \<in> Units G; y \<in> Units G\<rbrakk> \<Longrightarrow> inv (x \<otimes> y) = inv y \<otimes> inv x
[PROOF STEP]
with G
[PROOF STATE]
proof (chain)
picking this:
x \<in> Units G
y \<in> Units G
x \<in> carrier G
y \<in> carrier G
[PROOF STEP]
have "inv (x \<otimes> y) \<otimes> (x \<otimes> y) = (inv y \<otimes> inv x) \<otimes> (x \<otimes> y)"
[PROOF STATE]
proof (prove)
using this:
x \<in> Units G
y \<in> Units G
x \<in> carrier G
y \<in> carrier G

goal (1 subgoal):
 1. inv (x \<otimes> y) \<otimes> (x \<otimes> y) = inv y \<otimes> inv x \<otimes> (x \<otimes> y)
[PROOF STEP]
by (simp add: m_assoc) (simp add: m_assoc [symmetric])
[PROOF STATE]
proof (state)
this:
inv (x \<otimes> y) \<otimes> (x \<otimes> y) = inv y \<otimes> inv x \<otimes> (x \<otimes> y)

goal (1 subgoal):
 1. \<lbrakk>x \<in> Units G; y \<in> Units G\<rbrakk> \<Longrightarrow> inv (x \<otimes> y) = inv y \<otimes> inv x
[PROOF STEP]
with G
[PROOF STATE]
proof (chain)
picking this:
x \<in> Units G
y \<in> Units G
inv (x \<otimes> y) \<otimes> (x \<otimes> y) = inv y \<otimes> inv x \<otimes> (x \<otimes> y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> Units G
y \<in> Units G
inv (x \<otimes> y) \<otimes> (x \<otimes> y) = inv y \<otimes> inv x \<otimes> (x \<otimes> y)

goal (1 subgoal):
 1. inv (x \<otimes> y) = inv y \<otimes> inv x
[PROOF STEP]
by (simp del: Units_l_inv)
[PROOF STATE]
proof (state)
this:
inv (x \<otimes> y) = inv y \<otimes> inv x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma from_cnf_normalize_cnf: "from_cnf (normalize_cnf xs) = from_cnf xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. from_cnf (normalize_cnf xs) = from_cnf xs
[PROOF STEP]
apply (induct_tac xs, simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list. from_cnf (normalize_cnf list) = from_cnf list \<Longrightarrow> from_cnf (case list of [] \<Rightarrow> [a] | y # ys \<Rightarrow> (if a < y then [] else [a]) @ normalize_cnf list) = \<omega> ** a + from_cnf list
[PROOF STEP]
apply (case_tac list, simp, clarsimp simp del: normalize_cnf_Cons)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a aa lista. \<lbrakk>from_cnf (normalize_cnf (aa # lista)) = \<omega> ** aa + from_cnf lista; a < aa\<rbrakk> \<Longrightarrow> \<omega> ** aa + from_cnf lista = \<omega> ** a + (\<omega> ** aa + from_cnf lista)
[PROOF STEP]
apply (simp add: ordinal_plus_assoc[symmetric] absorb_omega_exp2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cong_transitivity:
  assumes "Cong A B C D" and "Cong C D E F"
  shows "Cong A B E F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cong A B E F
[PROOF STEP]
by (meson assms(1) assms(2) cong_inner_transitivity cong_pseudo_reflexivity)


[STATEMENT]
lemma numeral_le_ceiling [simp]: "numeral v \<le> \<lceil>x\<rceil> \<longleftrightarrow> numeral v - 1 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral v \<le> \<lceil>x\<rceil>) = (numeral v - (1::'a) < x)
[PROOF STEP]
by (simp add: le_ceiling_iff)


[STATEMENT]
lemma bt_map_compose: "bt_map (f o g) t = bt_map f (bt_map g t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bt_map (f \<circ> g) t = bt_map f (bt_map g t)
[PROOF STEP]
apply (induct t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. bt_map (f \<circ> g) Lf = bt_map f (bt_map g Lf)
 2. \<And>x1 t1 t2. \<lbrakk>bt_map (f \<circ> g) t1 = bt_map f (bt_map g t1); bt_map (f \<circ> g) t2 = bt_map f (bt_map g t2)\<rbrakk> \<Longrightarrow> bt_map (f \<circ> g) (Br x1 t1 t2) = bt_map f (bt_map g (Br x1 t1 t2))
[PROOF STEP]
apply (metis bt_map.simps(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 t1 t2. \<lbrakk>bt_map (f \<circ> g) t1 = bt_map f (bt_map g t1); bt_map (f \<circ> g) t2 = bt_map f (bt_map g t2)\<rbrakk> \<Longrightarrow> bt_map (f \<circ> g) (Br x1 t1 t2) = bt_map f (bt_map g (Br x1 t1 t2))
[PROOF STEP]
by (metis bt_map.simps(2) o_eq_dest_lhs)


[STATEMENT]
lemma Cons_less_Cons [simp]: "a # x <\<^sub>l b # y \<longleftrightarrow> a < b \<or> a = b \<and> x <\<^sub>l y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a # x <\<^sub>l b # y) = (a < b \<or> a = b \<and> x <\<^sub>l y)
[PROOF STEP]
by (simp add: list_lex_less_def)


[STATEMENT]
lemma singular_chain_mono:
   "\<lbrakk>singular_chain p (subtopology X T) c;  T \<subseteq> S\<rbrakk>
        \<Longrightarrow> singular_chain p (subtopology X S) c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>singular_chain p (subtopology X T) c; T \<subseteq> S\<rbrakk> \<Longrightarrow> singular_chain p (subtopology X S) c
[PROOF STEP]
unfolding singular_chain_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Poly_Mapping.keys c \<subseteq> singular_simplex_set p (subtopology X T); T \<subseteq> S\<rbrakk> \<Longrightarrow> Poly_Mapping.keys c \<subseteq> singular_simplex_set p (subtopology X S)
[PROOF STEP]
using singular_simplex_mono
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>singular_simplex ?p (subtopology ?X ?T) ?f; ?T \<subseteq> ?S\<rbrakk> \<Longrightarrow> singular_simplex ?p (subtopology ?X ?S) ?f

goal (1 subgoal):
 1. \<lbrakk>Poly_Mapping.keys c \<subseteq> singular_simplex_set p (subtopology X T); T \<subseteq> S\<rbrakk> \<Longrightarrow> Poly_Mapping.keys c \<subseteq> singular_simplex_set p (subtopology X S)
[PROOF STEP]
by blast


[STATEMENT]
lemma prime_div_set: assumes "prime n" shows "divisor_set n = {n, 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_set n = {n, 1}
[PROOF STEP]
using divisor_def assms divisor_set  prime_nat_iff
[PROOF STATE]
proof (prove)
using this:
?n divisor ?m \<equiv> 1 \<le> ?n \<and> ?n \<le> ?m \<and> ?n dvd ?m
prime n
divisor_set ?m = {n. n divisor ?m}
prime ?n = (1 < ?n \<and> (\<forall>m. m dvd ?n \<longrightarrow> m = 1 \<or> m = ?n))

goal (1 subgoal):
 1. divisor_set n = {n, 1}
[PROOF STEP]
by auto


[STATEMENT]
lemma bitAND_distrib: "2^c * (a && b) = (2^c * a) && (2^c * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b
[PROOF STEP]
proof (induction c)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 2 ^ 0 * (a && b) = 2 ^ 0 * a && 2 ^ 0 * b
 2. \<And>c. 2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b \<Longrightarrow> 2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. 2 ^ 0 * (a && b) = 2 ^ 0 * a && 2 ^ 0 * b
 2. \<And>c. 2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b \<Longrightarrow> 2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ 0 * (a && b) = 2 ^ 0 * a && 2 ^ 0 * b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ 0 * (a && b) = 2 ^ 0 * a && 2 ^ 0 * b

goal (1 subgoal):
 1. \<And>c. 2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b \<Longrightarrow> 2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. 2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b \<Longrightarrow> 2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
case (Suc c)
[PROOF STATE]
proof (state)
this:
2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b

goal (1 subgoal):
 1. \<And>c. 2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b \<Longrightarrow> 2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
have "2 ^ Suc c * (a && b) = 2 * (2 ^ c * (a && b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ Suc c * (a && b) = 2 * (2 ^ c * (a && b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ Suc c * (a && b) = 2 * (2 ^ c * (a && b))

goal (1 subgoal):
 1. \<And>c. 2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b \<Longrightarrow> 2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 ^ Suc c * (a && b) = 2 * (2 ^ c * (a && b))

goal (1 subgoal):
 1. \<And>c. 2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b \<Longrightarrow> 2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
have "... = 2 * ((2^c * a) && (2^c * b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (2 ^ c * (a && b)) = 2 * (2 ^ c * a && 2 ^ c * b)
[PROOF STEP]
using Suc.IH
[PROOF STATE]
proof (prove)
using this:
2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b

goal (1 subgoal):
 1. 2 * (2 ^ c * (a && b)) = 2 * (2 ^ c * a && 2 ^ c * b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * (2 ^ c * (a && b)) = 2 * (2 ^ c * a && 2 ^ c * b)

goal (1 subgoal):
 1. \<And>c. 2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b \<Longrightarrow> 2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * (2 ^ c * (a && b)) = 2 * (2 ^ c * a && 2 ^ c * b)

goal (1 subgoal):
 1. \<And>c. 2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b \<Longrightarrow> 2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
have "... = ((2^Suc c * a) && (2^Suc c * b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (2 ^ c * a && 2 ^ c * b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
using aux_bitAND_distrib[of "2^c * a" "2^c * b"]
[PROOF STATE]
proof (prove)
using this:
2 * (2 ^ c * a && 2 ^ c * b) = 2 * (2 ^ c * a) && 2 * (2 ^ c * b)

goal (1 subgoal):
 1. 2 * (2 ^ c * a && 2 ^ c * b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
by (auto simp add: ab_semigroup_mult_class.mult_ac(1))
[PROOF STATE]
proof (state)
this:
2 * (2 ^ c * a && 2 ^ c * b) = 2 ^ Suc c * a && 2 ^ Suc c * b

goal (1 subgoal):
 1. \<And>c. 2 ^ c * (a && b) = 2 ^ c * a && 2 ^ c * b \<Longrightarrow> 2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b

goal (1 subgoal):
 1. 2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ Suc c * (a && b) = 2 ^ Suc c * a && 2 ^ Suc c * b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma evenperm_swap: "evenperm (transpose a b) = (a = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. evenperm (Transposition.transpose a b) = (a = b)
[PROOF STEP]
by (rule evenperm_unique[where n="if a = b then 0 else 1"]) (simp_all add: swapidseq_swap)


[STATEMENT]
lemma (in group) lcosets_part_G:
  assumes "subgroup H G"
  shows "\<Union>(lcosets H) = carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (lcosets H) = carrier G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (lcosets H) = carrier G
[PROOF STEP]
interpret subgroup H G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (lcosets H) = carrier G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (lcosets H) = carrier G
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Union> (lcosets H) \<subseteq> carrier G
 2. carrier G \<subseteq> \<Union> (lcosets H)
[PROOF STEP]
apply (force simp add: LCOSETS_def l_coset_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier G \<subseteq> \<Union> (lcosets H)
[PROOF STEP]
apply (auto simp add: LCOSETS_def intro: lcos_self assms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<Union> (lcosets H) = carrier G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fCollect_conj_eq:
  "finite (Collect P) \<Longrightarrow> finite (Collect Q) \<Longrightarrow> {|x. P x \<and> Q x|} = fCollect P |\<inter>| fCollect Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (Collect P); finite (Collect Q)\<rbrakk> \<Longrightarrow> {|x. P x \<and> Q x|} = fCollect P |\<inter>| fCollect Q
[PROOF STEP]
by auto


[STATEMENT]
lemma fps_left_inverse_eq_fps_right_inverse_comm:
  fixes   f :: "'a::comm_ring_1 fps"
  assumes f0: "x * f$0 = 1"
  shows   "fps_left_inverse f x = fps_right_inverse f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_left_inverse f x = fps_right_inverse f x
[PROOF STEP]
using   assms fps_left_inverse_eq_fps_right_inverse[of x f x]
[PROOF STATE]
proof (prove)
using this:
x * f $ 0 = (1::'a)
\<lbrakk>x * f $ 0 = (1::'a); f $ 0 * x = (1::'a)\<rbrakk> \<Longrightarrow> fps_left_inverse f x = fps_right_inverse f x

goal (1 subgoal):
 1. fps_left_inverse f x = fps_right_inverse f x
[PROOF STEP]
by      (simp add: mult.commute)