[STATEMENT]
lemma has_integral_scaleR_left:
  "(f has_integral y) S \<Longrightarrow> ((\<lambda>x. f x *\<^sub>R c) has_integral (y *\<^sub>R c)) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral y) S \<Longrightarrow> ((\<lambda>x. f x *\<^sub>R c) has_integral y *\<^sub>R c) S
[PROOF STEP]
using has_integral_linear[OF _ bounded_linear_scaleR_left]
[PROOF STATE]
proof (prove)
using this:
(?f has_integral ?y) ?S \<Longrightarrow> ((\<lambda>r. r *\<^sub>R ?x1) \<circ> ?f has_integral ?y *\<^sub>R ?x1) ?S

goal (1 subgoal):
 1. (f has_integral y) S \<Longrightarrow> ((\<lambda>x. f x *\<^sub>R c) has_integral y *\<^sub>R c) S
[PROOF STEP]
by (simp add: comp_def)


[STATEMENT]
lemma sorted_descending_tail: "sorted_descending (xs@[x]) \<longleftrightarrow> sorted_descending xs \<and> (\<forall>y\<in>set xs. x \<le> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_descending (xs @ [x]) = (sorted_descending xs \<and> (\<forall>y\<in>set xs. x \<le> y))
[PROOF STEP]
by(induction xs) auto


[STATEMENT]
lemma PiE_eq:
   "PiE I S = PiE I T \<longleftrightarrow> PiE I S = {} \<and> PiE I T = {} \<or> (\<forall>i \<in> I. S i = T i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Pi\<^sub>E I S = Pi\<^sub>E I T) = (Pi\<^sub>E I S = {} \<and> Pi\<^sub>E I T = {} \<or> (\<forall>i\<in>I. S i = T i))
[PROOF STEP]
by (auto simp: PiE_eq_iff PiE_eq_empty_iff)


[STATEMENT]
lemma intersect_nodes_finite:
    assumes "finite (DBA.nodes A)" "finite (DBA.nodes B)"
    shows "finite (DBA.nodes (intersect A B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (DBA.nodes (intersect A B))
[PROOF STEP]
using intersect'_nodes_finite assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (DBA.nodes ?A); finite (DBA.nodes ?B)\<rbrakk> \<Longrightarrow> finite (DGBA.nodes (intersect' ?A ?B))
finite (DBA.nodes A)
finite (DBA.nodes B)

goal (1 subgoal):
 1. finite (DBA.nodes (intersect A B))
[PROOF STEP]
by simp


[STATEMENT]
lemma powr_realpow_eventually:
  assumes "filterlim f at_top F"
  shows   "eventually (\<lambda>x. f x powr (real n) = f x ^ n) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x powr real n = f x ^ n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x powr real n = f x ^ n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top F
[PROOF STEP]
have "eventually (\<lambda>x. f x > 0) F"
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. 0 < f x
[PROOF STEP]
using filterlim_at_top_dense
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top F
filterlim ?f at_top ?F = (\<forall>Z. \<forall>\<^sub>F x in ?F. Z < ?f x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. 0 < f x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. 0 < f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x powr real n = f x ^ n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. 0 < f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x powr real n = f x ^ n
[PROOF STEP]
by eventually_elim (simp add: powr_realpow)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x powr real n = f x ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem final_state_correct:
  assumes "reachable (ts', ms, r)" "final (ts', ms, r)"
  shows "r = fold f ts start"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r = fold f ts start
[PROOF STEP]
using final_state_correct2[OF assms]
[PROOF STATE]
proof (prove)
using this:
r = fold_mset f start (mset ts)

goal (1 subgoal):
 1. r = fold f ts start
[PROOF STEP]
by (simp add: fold_mset_rewr)


[STATEMENT]
lemma omega_properties: "omega^n = 1" "omega \<noteq> 1"
  "(\<forall> m. omega^m = 1 \<and> m\<noteq>0 \<longrightarrow> m \<ge> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. omega ^ n = 1 &&& omega \<noteq> 1 &&& \<forall>m. omega ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m
[PROOF STEP]
unfolding omega_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME \<omega>. \<omega> ^ n = 1 \<and> \<omega> \<noteq> 1 \<and> (\<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m)) ^ n = 1 &&& (SOME \<omega>. \<omega> ^ n = 1 \<and> \<omega> \<noteq> 1 \<and> (\<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m)) \<noteq> 1 &&& \<forall>m. (SOME \<omega>. \<omega> ^ n = 1 \<and> \<omega> \<noteq> 1 \<and> (\<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m)) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m
[PROOF STEP]
using omega_exists
[PROOF STATE]
proof (prove)
using this:
\<exists>\<omega>. \<omega> ^ n = 1 \<and> \<omega> \<noteq> 1 \<and> (\<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m)

goal (1 subgoal):
 1. (SOME \<omega>. \<omega> ^ n = 1 \<and> \<omega> \<noteq> 1 \<and> (\<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m)) ^ n = 1 &&& (SOME \<omega>. \<omega> ^ n = 1 \<and> \<omega> \<noteq> 1 \<and> (\<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m)) \<noteq> 1 &&& \<forall>m. (SOME \<omega>. \<omega> ^ n = 1 \<and> \<omega> \<noteq> 1 \<and> (\<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m)) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m
[PROOF STEP]
by (smt (verit, best) verit_sko_ex')+


[STATEMENT]
lemma asymp_equiv_harm [asymp_equiv_intros]: "harm \<sim>[at_top] (\<lambda>n. ln (real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. harm \<sim>[sequentially] (\<lambda>n. ln (real n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. harm \<sim>[sequentially] (\<lambda>n. ln (real n))
[PROOF STEP]
have "(\<lambda>n. harm n - ln (real n)) \<in> O(\<lambda>_. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. harm n - ln (real n)) \<in> O(\<lambda>_. 1)
[PROOF STEP]
using euler_mascheroni_LIMSEQ
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. harm n - ln (real n)) \<longlonglongrightarrow> euler_mascheroni

goal (1 subgoal):
 1. (\<lambda>n. harm n - ln (real n)) \<in> O(\<lambda>_. 1)
[PROOF STEP]
by (intro bigoI_tendsto[where c = euler_mascheroni]) simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>n. harm n - ln (real n)) \<in> O(\<lambda>_. 1)

goal (1 subgoal):
 1. harm \<sim>[sequentially] (\<lambda>n. ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. harm n - ln (real n)) \<in> O(\<lambda>_. 1)

goal (1 subgoal):
 1. harm \<sim>[sequentially] (\<lambda>n. ln (real n))
[PROOF STEP]
have "(\<lambda>_. 1) \<in> o(\<lambda>n. ln (real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>_. 1) \<in> o(\<lambda>n. ln (real n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>_. 1) \<in> o(\<lambda>n. ln (real n))

goal (1 subgoal):
 1. harm \<sim>[sequentially] (\<lambda>n. ln (real n))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. harm n - ln (real n)) \<in> o(\<lambda>n. ln (real n))
[PROOF STEP]
have "(\<lambda>n. ln (real n) + (harm n - ln (real n))) \<sim>[at_top] (\<lambda>n. ln (real n))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. harm n - ln (real n)) \<in> o(\<lambda>n. ln (real n))

goal (1 subgoal):
 1. (\<lambda>n. ln (real n) + (harm n - ln (real n))) \<sim>[sequentially] (\<lambda>n. ln (real n))
[PROOF STEP]
by (subst asymp_equiv_add_right) simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ln (real n) + (harm n - ln (real n))) \<sim>[sequentially] (\<lambda>n. ln (real n))

goal (1 subgoal):
 1. harm \<sim>[sequentially] (\<lambda>n. ln (real n))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ln (real n) + (harm n - ln (real n))) \<sim>[sequentially] (\<lambda>n. ln (real n))

goal (1 subgoal):
 1. harm \<sim>[sequentially] (\<lambda>n. ln (real n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
harm \<sim>[sequentially] (\<lambda>n. ln (real n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma riesz_frechet_representation_existence:
  \<comment> \<open>Theorem 3.4 in @{cite conway2013course}\<close>
  fixes f::\<open>'a::chilbert_space \<Rightarrow> complex\<close>
  assumes a1: \<open>bounded_clinear f\<close>
  shows \<open>\<exists>t. \<forall>x.  f x = t \<bullet>\<^sub>C x\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
proof(cases \<open>\<forall> x. f x = 0\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>x. f x = 0 \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
 2. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<forall>x. f x = 0

goal (2 subgoals):
 1. \<forall>x. f x = 0 \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
 2. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x. f x = 0

goal (1 subgoal):
 1. \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
by (metis cinner_zero_left)
[PROOF STATE]
proof (state)
this:
\<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x

goal (1 subgoal):
 1. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>x. f x = 0)

goal (1 subgoal):
 1. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
obtain t where spant: \<open>orthogonal_complement (f -` {0}) = cspan {t}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t. orthogonal_complement (f -` {0}) = cspan {t} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using orthogonal_complement_kernel_functional
[PROOF STATE]
proof (prove)
using this:
bounded_clinear ?f \<Longrightarrow> \<exists>x. orthogonal_complement (?f -` {0}) = cspan {x}

goal (1 subgoal):
 1. (\<And>t. orthogonal_complement (f -` {0}) = cspan {t} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bounded_clinear ?f \<Longrightarrow> \<exists>x. orthogonal_complement (?f -` {0}) = cspan {x}
bounded_clinear f

goal (1 subgoal):
 1. (\<And>t. orthogonal_complement (f -` {0}) = cspan {t} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
orthogonal_complement (f -` {0}) = cspan {t}

goal (1 subgoal):
 1. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
have \<open>projection (orthogonal_complement (f -` {0})) x = ((t \<bullet>\<^sub>C x)/(t \<bullet>\<^sub>C t)) *\<^sub>C t\<close> for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projection (orthogonal_complement (f -` {0})) x = (t \<bullet>\<^sub>C x / (t \<bullet>\<^sub>C t)) *\<^sub>C t
[PROOF STEP]
apply (subst spant)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projection (cspan {t}) x = (t \<bullet>\<^sub>C x / (t \<bullet>\<^sub>C t)) *\<^sub>C t
[PROOF STEP]
by (rule projection_rank1)
[PROOF STATE]
proof (state)
this:
projection (orthogonal_complement (f -` {0})) ?x = (t \<bullet>\<^sub>C ?x / (t \<bullet>\<^sub>C t)) *\<^sub>C t

goal (1 subgoal):
 1. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
hence \<open>f (projection (orthogonal_complement (f -` {0})) x) = (((t \<bullet>\<^sub>C x))/(t \<bullet>\<^sub>C t)) * (f t)\<close> for x
[PROOF STATE]
proof (prove)
using this:
projection (orthogonal_complement (f -` {0})) ?x = (t \<bullet>\<^sub>C ?x / (t \<bullet>\<^sub>C t)) *\<^sub>C t

goal (1 subgoal):
 1. f (projection (orthogonal_complement (f -` {0})) x) = t \<bullet>\<^sub>C x / (t \<bullet>\<^sub>C t) * f t
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
projection (orthogonal_complement (f -` {0})) ?x = (t \<bullet>\<^sub>C ?x / (t \<bullet>\<^sub>C t)) *\<^sub>C t
bounded_clinear f

goal (1 subgoal):
 1. f (projection (orthogonal_complement (f -` {0})) x) = t \<bullet>\<^sub>C x / (t \<bullet>\<^sub>C t) * f t
[PROOF STEP]
unfolding bounded_clinear_def
[PROOF STATE]
proof (prove)
using this:
projection (orthogonal_complement (f -` {0})) ?x = (t \<bullet>\<^sub>C ?x / (t \<bullet>\<^sub>C t)) *\<^sub>C t
clinear f \<and> bounded_clinear_axioms f

goal (1 subgoal):
 1. f (projection (orthogonal_complement (f -` {0})) x) = t \<bullet>\<^sub>C x / (t \<bullet>\<^sub>C t) * f t
[PROOF STEP]
by (simp add: complex_vector.linear_scale)
[PROOF STATE]
proof (state)
this:
f (projection (orthogonal_complement (f -` {0})) ?x) = t \<bullet>\<^sub>C ?x / (t \<bullet>\<^sub>C t) * f t

goal (1 subgoal):
 1. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
hence l2: \<open>f (projection (orthogonal_complement (f -` {0})) x) = ((cnj (f t)/(t \<bullet>\<^sub>C t)) *\<^sub>C t) \<bullet>\<^sub>C x\<close> for x
[PROOF STATE]
proof (prove)
using this:
f (projection (orthogonal_complement (f -` {0})) ?x) = t \<bullet>\<^sub>C ?x / (t \<bullet>\<^sub>C t) * f t

goal (1 subgoal):
 1. f (projection (orthogonal_complement (f -` {0})) x) = (cnj (f t) / (t \<bullet>\<^sub>C t)) *\<^sub>C t \<bullet>\<^sub>C x
[PROOF STEP]
using complex_cnj_divide
[PROOF STATE]
proof (prove)
using this:
f (projection (orthogonal_complement (f -` {0})) ?x) = t \<bullet>\<^sub>C ?x / (t \<bullet>\<^sub>C t) * f t
cnj (?x / ?y) = cnj ?x / cnj ?y

goal (1 subgoal):
 1. f (projection (orthogonal_complement (f -` {0})) x) = (cnj (f t) / (t \<bullet>\<^sub>C t)) *\<^sub>C t \<bullet>\<^sub>C x
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
f (projection (orthogonal_complement (f -` {0})) ?x) = (cnj (f t) / (t \<bullet>\<^sub>C t)) *\<^sub>C t \<bullet>\<^sub>C ?x

goal (1 subgoal):
 1. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
have \<open>f (projection (f -` {0}) x) = 0\<close> for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (projection (f -` {0}) x) = 0
[PROOF STEP]
by (metis (no_types, lifting) assms bounded_clinear_def closed_csubspace.closed
        complex_vector.linear_subspace_vimage complex_vector.subspace_0 complex_vector.subspace_single_0
        csubspace_is_convex insert_absorb insert_not_empty kernel_is_closed_csubspace projection_in_image vimage_singleton_eq)
[PROOF STATE]
proof (state)
this:
f (projection (f -` {0}) ?x) = 0

goal (1 subgoal):
 1. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
hence "\<And>a b. f (projection (f -` {0}) a + b) = 0 + f b"
[PROOF STATE]
proof (prove)
using this:
f (projection (f -` {0}) ?x) = 0

goal (1 subgoal):
 1. \<And>a b. f (projection (f -` {0}) a + b) = 0 + f b
[PROOF STEP]
using additive.add assms
[PROOF STATE]
proof (prove)
using this:
f (projection (f -` {0}) ?x) = 0
additive ?f \<Longrightarrow> ?f (?x + ?y) = ?f ?x + ?f ?y
bounded_clinear f

goal (1 subgoal):
 1. \<And>a b. f (projection (f -` {0}) a + b) = 0 + f b
[PROOF STEP]
by (simp add: bounded_clinear_def complex_vector.linear_add)
[PROOF STATE]
proof (state)
this:
f (projection (f -` {0}) ?a + ?b) = 0 + f ?b

goal (1 subgoal):
 1. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
hence "\<And>a. 0 + f (projection (orthogonal_complement (f -` {0})) a) = f a"
[PROOF STATE]
proof (prove)
using this:
f (projection (f -` {0}) ?a + ?b) = 0 + f ?b

goal (1 subgoal):
 1. \<And>a. 0 + f (projection (orthogonal_complement (f -` {0})) a) = f a
[PROOF STEP]
apply (simp add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. (\<And>a b. f (projection (f -` {0}) a + b) = f b) \<Longrightarrow> f (a - projection (f -` {0}) a) = f a
[PROOF STEP]
by (metis add.commute diff_add_cancel)
[PROOF STATE]
proof (state)
this:
0 + f (projection (orthogonal_complement (f -` {0})) ?a) = f ?a

goal (1 subgoal):
 1. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
hence \<open>f x = ((cnj (f t)/(t \<bullet>\<^sub>C t)) *\<^sub>C t) \<bullet>\<^sub>C x\<close> for x
[PROOF STATE]
proof (prove)
using this:
0 + f (projection (orthogonal_complement (f -` {0})) ?a) = f ?a

goal (1 subgoal):
 1. f x = (cnj (f t) / (t \<bullet>\<^sub>C t)) *\<^sub>C t \<bullet>\<^sub>C x
[PROOF STEP]
by (simp add: l2)
[PROOF STATE]
proof (state)
this:
f ?x = (cnj (f t) / (t \<bullet>\<^sub>C t)) *\<^sub>C t \<bullet>\<^sub>C ?x

goal (1 subgoal):
 1. \<not> (\<forall>x. f x = 0) \<Longrightarrow> \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f ?x = (cnj (f t) / (t \<bullet>\<^sub>C t)) *\<^sub>C t \<bullet>\<^sub>C ?x

goal (1 subgoal):
 1. \<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>t. \<forall>x. f x = t \<bullet>\<^sub>C x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_max_mono: "A \<ge>\<^sub>m B \<Longrightarrow>
   A \<in> carrier_mat nr nc \<Longrightarrow> B \<in> carrier_mat nr nc \<Longrightarrow> C \<in> carrier_mat nr nc \<Longrightarrow>
   max\<^sub>m C A \<ge>\<^sub>m max\<^sub>m C B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<ge>\<^sub>m B; A \<in> carrier_mat nr nc; B \<in> carrier_mat nr nc; C \<in> carrier_mat nr nc\<rbrakk> \<Longrightarrow> max\<^sub>m C A \<ge>\<^sub>m max\<^sub>m C B
[PROOF STEP]
by (intro mat_geI[of _ nr nc], auto simp: max_mono mat_max_def)


[STATEMENT]
lemma gcard_single_1 [simp]: "gcard {x} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcard {x} = 1
[PROOF STEP]
by (simp add: gcard_eq_card one_V_def)


[STATEMENT]
lemma enn2real_0[simp]: "enn2real 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real 0 = 0
[PROOF STEP]
unfolding enn2real_def zero_ennreal.rep_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_ereal 0 = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma vintersection_VPow[simp]: "VPow (A \<inter>\<^sub>\<circ> B) = VPow A \<inter>\<^sub>\<circ> VPow B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VPow (A \<inter>\<^sub>\<circ> B) = VPow A \<inter>\<^sub>\<circ> VPow B
[PROOF STEP]
by auto


[STATEMENT]
lemma (in group) rcos_equation:
  assumes "subgroup H G"
  assumes p: "ha \<otimes> a = h \<otimes> b" "a \<in> carrier G" "b \<in> carrier G" "h \<in> H" "ha \<in> H" "hb \<in> H"
  shows "hb \<otimes> a \<in> (\<Union>h\<in>H. {h \<otimes> b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hb \<otimes> a \<in> (\<Union>h\<in>H. {h \<otimes> b})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hb \<otimes> a \<in> (\<Union>h\<in>H. {h \<otimes> b})
[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. hb \<otimes> a \<in> (\<Union>h\<in>H. {h \<otimes> b})
[PROOF STEP]
from p
[PROOF STATE]
proof (chain)
picking this:
ha \<otimes> a = h \<otimes> b
a \<in> carrier G
b \<in> carrier G
h \<in> H
ha \<in> H
hb \<in> H
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ha \<otimes> a = h \<otimes> b
a \<in> carrier G
b \<in> carrier G
h \<in> H
ha \<in> H
hb \<in> H

goal (1 subgoal):
 1. hb \<otimes> a \<in> (\<Union>h\<in>H. {h \<otimes> b})
[PROOF STEP]
by (rule_tac UN_I [of "hb \<otimes> ((inv ha) \<otimes> h)"]) (auto simp: inv_solve_left m_assoc)
[PROOF STATE]
proof (state)
this:
hb \<otimes> a \<in> (\<Union>h\<in>H. {h \<otimes> b})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_exp_compose_linear [simp]:
  "fps_exp (d::'a::field_char_0) oo (fps_const c * fps_X) = fps_exp (c * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_exp d oo fps_const c * fps_X = fps_exp (c * d)
[PROOF STEP]
by (simp add: fps_compose_linear fps_exp_def fps_eq_iff power_mult_distrib)


[STATEMENT]
lemma nonzero_positions_apply_infmatrix[simp]: "f 0 = 0 \<Longrightarrow> nonzero_positions (apply_infmatrix f A) \<subseteq> nonzero_positions A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (0::'b) = (0::'a) \<Longrightarrow> nonzero_positions (apply_infmatrix f A) \<subseteq> nonzero_positions A
[PROOF STEP]
by (rule subsetI, simp add: nonzero_positions_def apply_infmatrix_def, auto)


[STATEMENT]
lemma gcd_mult_add: "(0::nat) < n \<Longrightarrow> gcd (n * k + m) n = gcd m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> gcd (n * k + m) n = gcd m n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> gcd (n * k + m) n = gcd m n
[PROOF STEP]
assume "0 < n"
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> gcd (n * k + m) n = gcd m n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "gcd (n * k + m) n = gcd n (m mod n)"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. gcd (n * k + m) n = gcd n (m mod n)
[PROOF STEP]
by (simp add: gcd_non_0_nat add.commute)
[PROOF STATE]
proof (state)
this:
gcd (n * k + m) n = gcd n (m mod n)

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> gcd (n * k + m) n = gcd m n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
gcd (n * k + m) n = gcd n (m mod n)

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> gcd (n * k + m) n = gcd m n
[PROOF STEP]
from \<open>0 < n\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "\<dots> = gcd m n"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. gcd n (m mod n) = gcd m n
[PROOF STEP]
by (simp add: gcd_non_0_nat)
[PROOF STATE]
proof (state)
this:
gcd n (m mod n) = gcd m n

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> gcd (n * k + m) n = gcd m n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
gcd (n * k + m) n = gcd m n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
gcd (n * k + m) n = gcd m n

goal (1 subgoal):
 1. gcd (n * k + m) n = gcd m n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
gcd (n * k + m) n = gcd m n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma move_matrix_col_mult: "move_matrix ((A::('a::semiring_0) matrix) * B) 0 i = A * (move_matrix B 0 i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. move_matrix (A * B) 0 i = A * move_matrix B 0 i
[PROOF STEP]
apply (subst Rep_matrix_inject[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_matrix (move_matrix (A * B) 0 i) = Rep_matrix (A * move_matrix B 0 i)
[PROOF STEP]
apply (rule ext)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. Rep_matrix (move_matrix (A * B) 0 i) x xa = Rep_matrix (A * move_matrix B 0 i) x xa
[PROOF STEP]
apply (auto simp add: Rep_matrix_mult foldseq_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<not> int xa < i \<Longrightarrow> foldseq (+) (\<lambda>k. Rep_matrix A x k * Rep_matrix B k (nat (int xa - i))) (max (ncols A) (nrows B)) = foldseq (+) (\<lambda>k. Rep_matrix A x k * Rep_matrix B k (nat (int xa - i))) (max (ncols A) (nrows (move_matrix B 0 i)))
[PROOF STEP]
apply (rule_tac foldseq_zerotail[symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x xa. \<not> int xa < i \<Longrightarrow> (0::'a) + (0::'a) = (0::'a)
 2. \<And>x xa. \<not> int xa < i \<Longrightarrow> \<forall>ia\<ge>max (ncols A) (nrows (move_matrix B 0 i)). Rep_matrix A x ia * Rep_matrix B ia (nat (int xa - i)) = (0::'a)
 3. \<And>x xa. \<not> int xa < i \<Longrightarrow> max (ncols A) (nrows (move_matrix B 0 i)) \<le> max (ncols A) (nrows B)
[PROOF STEP]
apply (auto simp add: ncols zero_imp_mult_zero max1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<not> int xa < i \<Longrightarrow> nrows (move_matrix B 0 i) \<le> max (ncols A) (nrows B)
[PROOF STEP]
apply (rule order_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. \<not> int xa < i \<Longrightarrow> nrows (move_matrix B 0 i) \<le> ?y10 xa
 2. \<And>xa. \<not> int xa < i \<Longrightarrow> ?y10 xa \<le> max (ncols A) (nrows B)
[PROOF STEP]
apply (rule nrows_move_matrix_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<not> int xa < i \<Longrightarrow> nat (int (nrows B) + 0) \<le> max (ncols A) (nrows B)
[PROOF STEP]
apply (simp add: max2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mtx_invertibleI:
  assumes "A * B = 1" and "B * A = 1"
  shows "mtx_invertible A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mtx_invertible A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A * B = 1
B * A = 1

goal (1 subgoal):
 1. mtx_invertible A
[PROOF STEP]
unfolding mtx_invertible_def
[PROOF STATE]
proof (prove)
using this:
A * B = 1
B * A = 1

goal (1 subgoal):
 1. \<exists>A'. A' * A = 1 \<and> A * A' = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma last_index_append: "last_index (xs @ ys) x =
  (if x : set ys then size xs + last_index ys x
   else if x : set xs then last_index xs x else size xs + size ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last_index (xs @ ys) x = (if x \<in> set ys then length xs + last_index ys x else if x \<in> set xs then last_index xs x else length xs + length ys)
[PROOF STEP]
by (induct xs) (simp_all add: last_index_Cons last_index_size_conv)


[STATEMENT]
lemma min_max_set_dual: "(`) \<partial> \<circ> min_set = max_set \<circ> (`) \<partial>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (`) \<partial> \<circ> min_set = max_set \<circ> (`) \<partial>
[PROOF STEP]
unfolding max_set_def min_set_def fun_eq_iff comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<partial> ` {y \<in> x. \<forall>x\<in>x. x \<le> y \<longrightarrow> x = y} = {xa \<in> \<partial> ` x. \<forall>y\<in>\<partial> ` x. xa \<le> y \<longrightarrow> xa = y}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x xa xb. \<lbrakk>xb \<in> x; \<forall>x\<in>x. x \<le> xb \<longrightarrow> x = xb\<rbrakk> \<Longrightarrow> \<partial> xb \<in> \<partial> ` x
 2. \<And>x xa xb y xc. \<lbrakk>xb \<in> x; \<forall>x\<in>x. x \<le> xb \<longrightarrow> x = xb; xc \<in> x; \<partial> xb \<le> \<partial> xc\<rbrakk> \<Longrightarrow> \<partial> xb = \<partial> xc
 3. \<And>x xa xb. \<lbrakk>\<forall>y\<in>\<partial> ` x. \<partial> xb \<le> y \<longrightarrow> \<partial> xb = y; xb \<in> x\<rbrakk> \<Longrightarrow> \<partial> xb \<in> \<partial> ` {y \<in> x. \<forall>x\<in>x. x \<le> y \<longrightarrow> x = y}
[PROOF STEP]
using dual_dual_ord inj_dual_iff
[PROOF STATE]
proof (prove)
using this:
(\<partial> ?x \<le> \<partial> ?y) = (?y \<le> ?x)
(\<partial> ?x = \<partial> ?y) = (?x = ?y)

goal (3 subgoals):
 1. \<And>x xa xb. \<lbrakk>xb \<in> x; \<forall>x\<in>x. x \<le> xb \<longrightarrow> x = xb\<rbrakk> \<Longrightarrow> \<partial> xb \<in> \<partial> ` x
 2. \<And>x xa xb y xc. \<lbrakk>xb \<in> x; \<forall>x\<in>x. x \<le> xb \<longrightarrow> x = xb; xc \<in> x; \<partial> xb \<le> \<partial> xc\<rbrakk> \<Longrightarrow> \<partial> xb = \<partial> xc
 3. \<And>x xa xb. \<lbrakk>\<forall>y\<in>\<partial> ` x. \<partial> xb \<le> y \<longrightarrow> \<partial> xb = y; xb \<in> x\<rbrakk> \<Longrightarrow> \<partial> xb \<in> \<partial> ` {y \<in> x. \<forall>x\<in>x. x \<le> y \<longrightarrow> x = y}
[PROOF STEP]
by auto


[STATEMENT]
lemma real_add_left_mono:
  assumes le: "x \<le> y" shows "z + x \<le> z + (y::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z + x \<le> z + y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z + x \<le> z + y
[PROOF STEP]
have "z + x - (z + y) = (z + -z) + (x - y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z + x - (z + y) = z + - z + (x - y)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
z + x - (z + y) = z + - z + (x - y)

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

goal (1 subgoal):
 1. z + x \<le> z + y
[PROOF STEP]
by (simp add: real_le_eq_diff[of x] real_le_eq_diff[of "z+x"])
[PROOF STATE]
proof (state)
this:
z + x \<le> z + y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eSuc_max: "(max (x::eint) y) + 1 = max (x+1) (y+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max x y + 1 = max (x + 1) (y + 1)
[PROOF STEP]
by (simp add: max_def)


[STATEMENT]
lemma succ_greatereq_min: assumes "deg \<ge> 2" and "(x::nat) \<ge> mi" shows
  "vebt_succ (Node (Some (mi, ma)) deg treeList summary) x = (let l = low x (deg div 2); h = high x (deg div 2) in
                    if h < length treeList then

                            let maxlow = vebt_maxt (treeList ! h) in
                            (if maxlow \<noteq> None \<and> (Some l <\<^sub>o  maxlow) then
                                                    Some (2^(deg div 2)) *\<^sub>o Some h +\<^sub>o vebt_succ (treeList ! h) l
                             else let sc = vebt_succ summary h in
                             if sc = None then None
                             else Some (2^(deg div 2)) *\<^sub>o sc +\<^sub>o vebt_mint (treeList ! the sc) )

                     else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_succ (Node (Some (mi, ma)) deg treeList summary) x = (let l = low x (deg div 2); h = high x (deg div 2) in if h < length treeList then let maxlow = vebt_maxt (treeList ! h) in if maxlow \<noteq> None \<and> Some l <\<^sub>o maxlow then Some (2 ^ (deg div 2)) *\<^sub>o Some h +\<^sub>o vebt_succ (treeList ! h) l else let sc = vebt_succ summary h in if sc = None then None else Some (2 ^ (deg div 2)) *\<^sub>o sc +\<^sub>o vebt_mint (treeList ! the sc) else None)
[PROOF STEP]
by (smt add_numeral_left arith_simps(1) assms(1) assms(2) le_add_diff_inverse not_less numerals(1) plus_1_eq_Suc vebt_succ.simps(6))


[STATEMENT]
lemma X_inv [simp]:
  "X * X = 1\<^sub>m 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X * X = 1\<^sub>m 2
[PROOF STEP]
apply(simp add: X_def times_mat_def one_mat_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat 2 2 (\<lambda>(i, j). row (mat 2 2 (\<lambda>(i, j). if i = j then 0 else 1)) i \<bullet> col (mat 2 2 (\<lambda>(i, j). if i = j then 0 else 1)) j) = mat 2 2 (\<lambda>(i, j). if i = j then 1 else 0)
[PROOF STEP]
apply(rule cong_mat)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 2 = 2
 2. 2 = 2
 3. \<And>i j. \<lbrakk>i < 2; j < 2\<rbrakk> \<Longrightarrow> (case (i, j) of (i, j) \<Rightarrow> row (mat 2 2 (\<lambda>(i, j). if i = j then 0 else 1)) i \<bullet> col (mat 2 2 (\<lambda>(i, j). if i = j then 0 else 1)) j) = (case (i, j) of (i, j) \<Rightarrow> if i = j then 1 else 0)
[PROOF STEP]
by(auto simp: scalar_prod_def)


[STATEMENT]
theorem tailrec_transform':
    "m \<bind> REC (tailrec_body a b) = lfp (\<lambda>x. sup m (bind x a)) \<bind> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<bind> REC (tailrec_body a b) = lfp (\<lambda>x. sup m (x \<bind> a)) \<bind> b
[PROOF STEP]
unfolding tailrec_body_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<bind> REC (\<lambda>D s. sup (a s \<bind> D) (b s)) = lfp (\<lambda>x. sup m (x \<bind> a)) \<bind> b
[PROOF STEP]
by (rule tailrec_transform)


[STATEMENT]
lemma arith2:
  fixes t n q :: "nat"
  assumes h1:"t + n * t = q + n * q"
  shows "t = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t = q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
t + n * t = q + n * q

goal (1 subgoal):
 1. t = q
[PROOF STEP]
by (metis arith1 mult_Suc)


[STATEMENT]
lemma heap_top_max:
  assumes "t \<noteq> E" "is_heap t"
  shows "val t = Max_mset (multiset t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val t = Max_mset (multiset t)
[PROOF STEP]
proof (rule Max_eqI[symmetric])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite (set_mset (multiset t))
 2. \<And>y. y \<in># multiset t \<Longrightarrow> y \<le> val t
 3. val t \<in># multiset t
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite (set_mset (multiset t))
 2. \<And>y. y \<in># multiset t \<Longrightarrow> y \<le> val t
 3. val t \<in># multiset t
[PROOF STEP]
assume "y \<in> set_mset (multiset t)"
[PROOF STATE]
proof (state)
this:
y \<in># multiset t

goal (3 subgoals):
 1. finite (set_mset (multiset t))
 2. \<And>y. y \<in># multiset t \<Longrightarrow> y \<le> val t
 3. val t \<in># multiset t
[PROOF STEP]
thus "y \<le> val t"
[PROOF STATE]
proof (prove)
using this:
y \<in># multiset t

goal (1 subgoal):
 1. y \<le> val t
[PROOF STEP]
using heap_top_geq [of y t] \<open>is_heap t\<close>
[PROOF STATE]
proof (prove)
using this:
y \<in># multiset t
\<lbrakk>y \<in># multiset t; is_heap t\<rbrakk> \<Longrightarrow> y \<le> val t
is_heap t

goal (1 subgoal):
 1. y \<le> val t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y \<le> val t

goal (2 subgoals):
 1. finite (set_mset (multiset t))
 2. val t \<in># multiset t
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (set_mset (multiset t))
 2. val t \<in># multiset t
[PROOF STEP]
show "val t \<in> set_mset (multiset t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val t \<in># multiset t
[PROOF STEP]
using \<open>t \<noteq> E\<close>
[PROOF STATE]
proof (prove)
using this:
t \<noteq> E

goal (1 subgoal):
 1. val t \<in># multiset t
[PROOF STEP]
by (cases t) auto
[PROOF STATE]
proof (state)
this:
val t \<in># multiset t

goal (1 subgoal):
 1. finite (set_mset (multiset t))
[PROOF STEP]
qed simp


[STATEMENT]
lemma mem_lt_imp_MIN_lt:
  fixes s :: "nat set" and k :: nat
  assumes "(\<exists>x. x \<in> s \<and> x < k)"
  shows "(Inf s) < k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf s < k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf s < k
[PROOF STEP]
obtain x where 1: "x \<in> s" "x < k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> s; x < k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<exists>x. x \<in> s \<and> x < k

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> s; x < k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> s
x < k

goal (1 subgoal):
 1. Inf s < k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> s
x < k
[PROOF STEP]
have 2: "s \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
x \<in> s
x < k

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

goal (1 subgoal):
 1. Inf s < k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s \<noteq> {}
[PROOF STEP]
have "Inf s \<in> s"
[PROOF STATE]
proof (prove)
using this:
s \<noteq> {}

goal (1 subgoal):
 1. Inf s \<in> s
[PROOF STEP]
using Inf_nat_def LeastI
[PROOF STATE]
proof (prove)
using this:
s \<noteq> {}
Inf ?X = (LEAST n. n \<in> ?X)
?P ?k \<Longrightarrow> ?P (LEAST x. ?P x)

goal (1 subgoal):
 1. Inf s \<in> s
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Inf s \<in> s

goal (1 subgoal):
 1. Inf s < k
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Inf s \<in> s

goal (1 subgoal):
 1. Inf s < k
[PROOF STEP]
have "\<forall>x\<in>s. Inf s \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>s. Inf s \<le> x
[PROOF STEP]
by (simp add: cInf_lower)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>s. Inf s \<le> x

goal (1 subgoal):
 1. Inf s < k
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Inf s \<in> s
\<forall>x\<in>s. Inf s \<le> x
[PROOF STEP]
show "(Inf s) < k"
[PROOF STATE]
proof (prove)
using this:
Inf s \<in> s
\<forall>x\<in>s. Inf s \<le> x

goal (1 subgoal):
 1. Inf s < k
[PROOF STEP]
using assms leD
[PROOF STATE]
proof (prove)
using this:
Inf s \<in> s
\<forall>x\<in>s. Inf s \<le> x
\<exists>x. x \<in> s \<and> x < k
?y \<le> ?x \<Longrightarrow> \<not> ?x < ?y

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

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>NOTE type for 'k' had to be fixed (type unordered error; also not true for e.g. real sets).\<close>


[STATEMENT]
lemma Mp_shrink_modulus: assumes "poly_mod.eq_m (m * k) f g" "k \<noteq> 0"
  shows "f =m g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f =m g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f =m g
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
poly_mod.Mp (m * k) f = poly_mod.Mp (m * k) g
k \<noteq> 0
[PROOF STEP]
have a: "\<And> n. coeff f n mod (m * k) = coeff g n mod (m * k)"
[PROOF STATE]
proof (prove)
using this:
poly_mod.Mp (m * k) f = poly_mod.Mp (m * k) g
k \<noteq> 0

goal (1 subgoal):
 1. \<And>n. coeff f n mod (m * k) = coeff g n mod (m * k)
[PROOF STEP]
unfolding poly_eq_iff poly_mod.Mp_coeff
[PROOF STATE]
proof (prove)
using this:
\<forall>n. poly_mod.M (m * k) (coeff f n) = poly_mod.M (m * k) (coeff g n)
k \<noteq> 0

goal (1 subgoal):
 1. \<And>n. coeff f n mod (m * k) = coeff g n mod (m * k)
[PROOF STEP]
unfolding poly_mod.M_def
[PROOF STATE]
proof (prove)
using this:
\<forall>n. coeff f n mod (m * k) = coeff g n mod (m * k)
k \<noteq> 0

goal (1 subgoal):
 1. \<And>n. coeff f n mod (m * k) = coeff g n mod (m * k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coeff f ?n mod (m * k) = coeff g ?n mod (m * k)

goal (1 subgoal):
 1. f =m g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f =m g
[PROOF STEP]
unfolding poly_eq_iff poly_mod.Mp_coeff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. M (coeff f n) = M (coeff g n)
[PROOF STEP]
unfolding poly_mod.M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. coeff f n mod m = coeff g n mod m
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. coeff f n mod m = coeff g n mod m
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. coeff f n mod m = coeff g n mod m
[PROOF STEP]
show "coeff f n mod m = coeff g n mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff f n mod m = coeff g n mod m
[PROOF STEP]
using a[of n] \<open>k \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
coeff f n mod (m * k) = coeff g n mod (m * k)
k \<noteq> 0

goal (1 subgoal):
 1. coeff f n mod m = coeff g n mod m
[PROOF STEP]
by (metis mod_mult_right_eq mult.commute mult_cancel_left mult_mod_right)
[PROOF STATE]
proof (state)
this:
coeff f n mod m = coeff g n mod m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f =m g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "rec_lambda var app lam (App x y) = app x y (rec_lambda var app lam x) (rec_lambda var app lam y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_lambda var app lam (App x y) = app x y (rec_lambda var app lam x) (rec_lambda var app lam y)
[PROOF STEP]
nitpick [card = 1-3, expect = none]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_lambda var app lam (App x y) = app x y (rec_lambda var app lam x) (rec_lambda var app lam y)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma continuous_abs_powr [continuous_intros]:
  assumes "p > 0"
  shows "continuous_on UNIV (\<lambda>(x::real). \<bar>x\<bar> powr p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>x. \<bar>x\<bar> powr p)
[PROOF STEP]
apply (rule continuous_on_powr')
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on UNIV abs
 2. continuous_on UNIV (\<lambda>x. p)
 3. \<forall>x\<in>UNIV. 0 \<le> \<bar>x\<bar> \<and> (\<bar>x\<bar> = 0 \<longrightarrow> 0 < p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < p

goal (3 subgoals):
 1. continuous_on UNIV abs
 2. continuous_on UNIV (\<lambda>x. p)
 3. \<forall>x\<in>UNIV. 0 \<le> \<bar>x\<bar> \<and> (\<bar>x\<bar> = 0 \<longrightarrow> 0 < p)
[PROOF STEP]
by (auto intro: continuous_intros)


[STATEMENT]
lemma bl_to_bin_lt2p_drop: "bl_to_bin bs < 2 ^ length (dropWhile Not bs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bl_to_bin bs < 2 ^ length (dropWhile Not bs)
[PROOF STEP]
proof (induct bs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bl_to_bin [] < 2 ^ length (dropWhile Not [])
 2. \<And>a bs. bl_to_bin bs < 2 ^ length (dropWhile Not bs) \<Longrightarrow> bl_to_bin (a # bs) < 2 ^ length (dropWhile Not (a # bs))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. bl_to_bin [] < 2 ^ length (dropWhile Not [])
 2. \<And>a bs. bl_to_bin bs < 2 ^ length (dropWhile Not bs) \<Longrightarrow> bl_to_bin (a # bs) < 2 ^ length (dropWhile Not (a # bs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bl_to_bin [] < 2 ^ length (dropWhile Not [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bl_to_bin [] < 2 ^ length (dropWhile Not [])

goal (1 subgoal):
 1. \<And>a bs. bl_to_bin bs < 2 ^ length (dropWhile Not bs) \<Longrightarrow> bl_to_bin (a # bs) < 2 ^ length (dropWhile Not (a # bs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a bs. bl_to_bin bs < 2 ^ length (dropWhile Not bs) \<Longrightarrow> bl_to_bin (a # bs) < 2 ^ length (dropWhile Not (a # bs))
[PROOF STEP]
case (Cons b bs)
[PROOF STATE]
proof (state)
this:
bl_to_bin bs < 2 ^ length (dropWhile Not bs)

goal (1 subgoal):
 1. \<And>a bs. bl_to_bin bs < 2 ^ length (dropWhile Not bs) \<Longrightarrow> bl_to_bin (a # bs) < 2 ^ length (dropWhile Not (a # bs))
[PROOF STEP]
with bl_to_bin_lt2p_aux[where w=1]
[PROOF STATE]
proof (chain)
picking this:
bl_to_bin_aux ?bs 1 < (1 + 1) * 2 ^ length ?bs
bl_to_bin bs < 2 ^ length (dropWhile Not bs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
bl_to_bin_aux ?bs 1 < (1 + 1) * 2 ^ length ?bs
bl_to_bin bs < 2 ^ length (dropWhile Not bs)

goal (1 subgoal):
 1. bl_to_bin (b # bs) < 2 ^ length (dropWhile Not (b # bs))
[PROOF STEP]
by (simp add: bl_to_bin_def)
[PROOF STATE]
proof (state)
this:
bl_to_bin (b # bs) < 2 ^ length (dropWhile Not (b # bs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cardE_nz_aux[simp, intro!]:
  "card E \<noteq> 0" "card E \<ge> Suc 0" "card E > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card E \<noteq> 0 &&& Suc 0 \<le> card E &&& 0 < card E
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. card E \<noteq> 0
 2. Suc 0 \<le> card E
 3. 0 < card E
[PROOF STEP]
show "card E \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card E \<noteq> 0
[PROOF STEP]
by (simp add: E_not_empty)
[PROOF STATE]
proof (state)
this:
card E \<noteq> 0

goal (2 subgoals):
 1. Suc 0 \<le> card E
 2. 0 < card E
[PROOF STEP]
thus "card E \<ge> Suc 0"
[PROOF STATE]
proof (prove)
using this:
card E \<noteq> 0

goal (1 subgoal):
 1. Suc 0 \<le> card E
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
Suc 0 \<le> card E

goal (1 subgoal):
 1. 0 < card E
[PROOF STEP]
thus "card E > 0"
[PROOF STATE]
proof (prove)
using this:
Suc 0 \<le> card E

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_Union_le_sum_card:
  fixes U :: "'a set set"
  assumes "\<forall>u \<in> U. finite u"
  shows "card (\<Union>U) \<le> sum card U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union> U) \<le> sum card U
[PROOF STEP]
proof (cases "finite U")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite U \<Longrightarrow> card (\<Union> U) \<le> sum card U
 2. infinite U \<Longrightarrow> card (\<Union> U) \<le> sum card U
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite U

goal (2 subgoals):
 1. finite U \<Longrightarrow> card (\<Union> U) \<le> sum card U
 2. infinite U \<Longrightarrow> card (\<Union> U) \<le> sum card U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite U
[PROOF STEP]
show "card (\<Union>U) \<le> sum card U"
[PROOF STATE]
proof (prove)
using this:
infinite U

goal (1 subgoal):
 1. card (\<Union> U) \<le> sum card U
[PROOF STEP]
using card_eq_0_iff finite_UnionD
[PROOF STATE]
proof (prove)
using this:
infinite U
(card ?A = 0) = (?A = {} \<or> infinite ?A)
finite (\<Union> ?A) \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. card (\<Union> U) \<le> sum card U
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (\<Union> U) \<le> sum card U

goal (1 subgoal):
 1. finite U \<Longrightarrow> card (\<Union> U) \<le> sum card U
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite U \<Longrightarrow> card (\<Union> U) \<le> sum card U
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite U

goal (1 subgoal):
 1. finite U \<Longrightarrow> card (\<Union> U) \<le> sum card U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite U
[PROOF STEP]
show "card (\<Union>U) \<le> sum card U"
[PROOF STATE]
proof (prove)
using this:
finite U

goal (1 subgoal):
 1. card (\<Union> U) \<le> sum card U
[PROOF STEP]
proof (induct U rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card (\<Union> {}) \<le> sum card {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (\<Union> F) \<le> sum card F\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. card (\<Union> {}) \<le> sum card {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (\<Union> F) \<le> sum card F\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union> {}) \<le> sum card {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (\<Union> {}) \<le> sum card {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (\<Union> F) \<le> sum card F\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (\<Union> F) \<le> sum card F\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
card (\<Union> F) \<le> sum card F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (\<Union> F) \<le> sum card F\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
card (\<Union> F) \<le> sum card F
[PROOF STEP]
have "card(\<Union>(insert x F)) \<le> card(x) + card (\<Union>F)"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
card (\<Union> F) \<le> sum card F

goal (1 subgoal):
 1. card (\<Union> (insert x F)) \<le> card x + card (\<Union> F)
[PROOF STEP]
using card_Un_le
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
card (\<Union> F) \<le> sum card F
card (?A \<union> ?B) \<le> card ?A + card ?B

goal (1 subgoal):
 1. card (\<Union> (insert x F)) \<le> card x + card (\<Union> F)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (\<Union> (insert x F)) \<le> card x + card (\<Union> F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (\<Union> F) \<le> sum card F\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (\<Union> (insert x F)) \<le> card x + card (\<Union> F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (\<Union> F) \<le> sum card F\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
have "... \<le> card(x) + sum card F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card x + card (\<Union> F) \<le> card x + sum card F
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
card (\<Union> F) \<le> sum card F

goal (1 subgoal):
 1. card x + card (\<Union> F) \<le> card x + sum card F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card x + card (\<Union> F) \<le> card x + sum card F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (\<Union> F) \<le> sum card F\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card x + card (\<Union> F) \<le> card x + sum card F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (\<Union> F) \<le> sum card F\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
have "... = sum card (insert x F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card x + sum card F = sum card (insert x F)
[PROOF STEP]
using sum.insert_if and insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite ?A \<Longrightarrow> sum ?g (insert ?x ?A) = (if ?x \<in> ?A then sum ?g ?A else ?g ?x + sum ?g ?A)
finite F
x \<notin> F
card (\<Union> F) \<le> sum card F

goal (1 subgoal):
 1. card x + sum card F = sum card (insert x F)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card x + sum card F = sum card (insert x F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (\<Union> F) \<le> sum card F\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card (\<Union> (insert x F)) \<le> sum card (insert x F)

goal (1 subgoal):
 1. card (\<Union> (insert x F)) \<le> sum card (insert x F)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (\<Union> (insert x F)) \<le> sum card (insert x F)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (\<Union> U) \<le> sum card U

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_injective_image_segment_1:
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
  assumes contf: "continuous_on (closed_segment a b) f"
      and injf: "inj_on f (closed_segment a b)"
  shows "f ` (closed_segment a b) = closed_segment (f a) (f b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` closed_segment a b = closed_segment (f a) (f b)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
 2. closed_segment (f a) (f b) \<subseteq> f ` closed_segment a b
[PROOF STEP]
show "closed_segment (f a) (f b) \<subseteq> f ` closed_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment (f a) (f b) \<subseteq> f ` closed_segment a b
[PROOF STEP]
by (metis subset_continuous_image_segment_1 contf)
[PROOF STATE]
proof (state)
this:
closed_segment (f a) (f b) \<subseteq> f ` closed_segment a b

goal (1 subgoal):
 1. f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
show "f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
proof (cases "a = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
 2. a \<noteq> b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = b

goal (2 subgoals):
 1. a = b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
 2. a \<noteq> b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = b

goal (1 subgoal):
 1. f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> b
[PROOF STEP]
have fnot: "f a \<noteq> f b"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b

goal (1 subgoal):
 1. f a \<noteq> f b
[PROOF STEP]
using inj_onD injf
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
\<lbrakk>inj_on ?f ?A; ?f ?x = ?f ?y; ?x \<in> ?A; ?y \<in> ?A\<rbrakk> \<Longrightarrow> ?x = ?y
inj_on f (closed_segment a b)

goal (1 subgoal):
 1. f a \<noteq> f b
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f a \<noteq> f b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f a \<noteq> f b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
have "f a \<notin> open_segment (f c) (f b)" if c: "c \<in> closed_segment a b" for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a \<notin> open_segment (f c) (f b)
[PROOF STEP]
proof (clarsimp simp add: open_segment_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>f a \<in> closed_segment (f c) (f b); f a \<noteq> f b\<rbrakk> \<Longrightarrow> f a = f c
[PROOF STEP]
assume fa: "f a \<in> closed_segment (f c) (f b)"
[PROOF STATE]
proof (state)
this:
f a \<in> closed_segment (f c) (f b)

goal (1 subgoal):
 1. \<lbrakk>f a \<in> closed_segment (f c) (f b); f a \<noteq> f b\<rbrakk> \<Longrightarrow> f a = f c
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f a \<in> closed_segment (f c) (f b)

goal (1 subgoal):
 1. \<lbrakk>f a \<in> closed_segment (f c) (f b); f a \<noteq> f b\<rbrakk> \<Longrightarrow> f a = f c
[PROOF STEP]
have "closed_segment (f c) (f b) \<subseteq> f ` closed_segment c b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment (f c) (f b) \<subseteq> f ` closed_segment c b
[PROOF STEP]
by (meson closed_segment_subset contf continuous_on_subset convex_closed_segment ends_in_segment(2) subset_continuous_image_segment_1 that)
[PROOF STATE]
proof (state)
this:
closed_segment (f c) (f b) \<subseteq> f ` closed_segment c b

goal (1 subgoal):
 1. \<lbrakk>f a \<in> closed_segment (f c) (f b); f a \<noteq> f b\<rbrakk> \<Longrightarrow> f a = f c
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f a \<in> closed_segment (f c) (f b)
closed_segment (f c) (f b) \<subseteq> f ` closed_segment c b
[PROOF STEP]
have "f a \<in> f ` closed_segment c b"
[PROOF STATE]
proof (prove)
using this:
f a \<in> closed_segment (f c) (f b)
closed_segment (f c) (f b) \<subseteq> f ` closed_segment c b

goal (1 subgoal):
 1. f a \<in> f ` closed_segment c b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f a \<in> f ` closed_segment c b

goal (1 subgoal):
 1. \<lbrakk>f a \<in> closed_segment (f c) (f b); f a \<noteq> f b\<rbrakk> \<Longrightarrow> f a = f c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f a \<in> f ` closed_segment c b
[PROOF STEP]
have a: "a \<in> closed_segment c b"
[PROOF STATE]
proof (prove)
using this:
f a \<in> f ` closed_segment c b

goal (1 subgoal):
 1. a \<in> closed_segment c b
[PROOF STEP]
by (meson ends_in_segment inj_on_image_mem_iff injf subset_closed_segment that)
[PROOF STATE]
proof (state)
this:
a \<in> closed_segment c b

goal (1 subgoal):
 1. \<lbrakk>f a \<in> closed_segment (f c) (f b); f a \<noteq> f b\<rbrakk> \<Longrightarrow> f a = f c
[PROOF STEP]
have cb: "closed_segment c b \<subseteq> closed_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment c b \<subseteq> closed_segment a b
[PROOF STEP]
by (simp add: closed_segment_subset that)
[PROOF STATE]
proof (state)
this:
closed_segment c b \<subseteq> closed_segment a b

goal (1 subgoal):
 1. \<lbrakk>f a \<in> closed_segment (f c) (f b); f a \<noteq> f b\<rbrakk> \<Longrightarrow> f a = f c
[PROOF STEP]
show "f a = f c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a = f c
[PROOF STEP]
proof (rule between_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. between (f c, ?c) (f a)
 2. between (f a, ?c) (f c)
[PROOF STEP]
show "between (f c, f b) (f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. between (f c, f b) (f a)
[PROOF STEP]
by (simp add: between_mem_segment fa)
[PROOF STATE]
proof (state)
this:
between (f c, f b) (f a)

goal (1 subgoal):
 1. between (f a, f b) (f c)
[PROOF STEP]
show "between (f a, f b) (f c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. between (f a, f b) (f c)
[PROOF STEP]
by (metis a cb between_antisym between_mem_segment between_triv1 subset_iff)
[PROOF STATE]
proof (state)
this:
between (f a, f b) (f c)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f a = f c

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?c \<in> closed_segment a b \<Longrightarrow> f a \<notin> open_segment (f ?c) (f b)

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?c \<in> closed_segment a b \<Longrightarrow> f a \<notin> open_segment (f ?c) (f b)

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
have "f b \<notin> open_segment (f a) (f c)" if c: "c \<in> closed_segment a b" for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f b \<notin> open_segment (f a) (f c)
[PROOF STEP]
proof (clarsimp simp add: open_segment_def fnot eq_commute)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f b \<in> closed_segment (f a) (f c) \<Longrightarrow> f b = f c
[PROOF STEP]
assume fb: "f b \<in> closed_segment (f a) (f c)"
[PROOF STATE]
proof (state)
this:
f b \<in> closed_segment (f a) (f c)

goal (1 subgoal):
 1. f b \<in> closed_segment (f a) (f c) \<Longrightarrow> f b = f c
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f b \<in> closed_segment (f a) (f c)

goal (1 subgoal):
 1. f b \<in> closed_segment (f a) (f c) \<Longrightarrow> f b = f c
[PROOF STEP]
have "closed_segment (f a) (f c) \<subseteq> f ` closed_segment a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment (f a) (f c) \<subseteq> f ` closed_segment a c
[PROOF STEP]
by (meson contf continuous_on_subset ends_in_segment(1) subset_closed_segment subset_continuous_image_segment_1 that)
[PROOF STATE]
proof (state)
this:
closed_segment (f a) (f c) \<subseteq> f ` closed_segment a c

goal (1 subgoal):
 1. f b \<in> closed_segment (f a) (f c) \<Longrightarrow> f b = f c
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f b \<in> closed_segment (f a) (f c)
closed_segment (f a) (f c) \<subseteq> f ` closed_segment a c
[PROOF STEP]
have "f b \<in> f ` closed_segment a c"
[PROOF STATE]
proof (prove)
using this:
f b \<in> closed_segment (f a) (f c)
closed_segment (f a) (f c) \<subseteq> f ` closed_segment a c

goal (1 subgoal):
 1. f b \<in> f ` closed_segment a c
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f b \<in> f ` closed_segment a c

goal (1 subgoal):
 1. f b \<in> closed_segment (f a) (f c) \<Longrightarrow> f b = f c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f b \<in> f ` closed_segment a c
[PROOF STEP]
have b: "b \<in> closed_segment a c"
[PROOF STATE]
proof (prove)
using this:
f b \<in> f ` closed_segment a c

goal (1 subgoal):
 1. b \<in> closed_segment a c
[PROOF STEP]
by (meson ends_in_segment inj_on_image_mem_iff injf subset_closed_segment that)
[PROOF STATE]
proof (state)
this:
b \<in> closed_segment a c

goal (1 subgoal):
 1. f b \<in> closed_segment (f a) (f c) \<Longrightarrow> f b = f c
[PROOF STEP]
have ca: "closed_segment a c \<subseteq> closed_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment a c \<subseteq> closed_segment a b
[PROOF STEP]
by (simp add: closed_segment_subset that)
[PROOF STATE]
proof (state)
this:
closed_segment a c \<subseteq> closed_segment a b

goal (1 subgoal):
 1. f b \<in> closed_segment (f a) (f c) \<Longrightarrow> f b = f c
[PROOF STEP]
show "f b = f c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f b = f c
[PROOF STEP]
proof (rule between_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. between (f c, ?c) (f b)
 2. between (f b, ?c) (f c)
[PROOF STEP]
show "between (f c, f a) (f b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. between (f c, f a) (f b)
[PROOF STEP]
by (simp add: between_commute between_mem_segment fb)
[PROOF STATE]
proof (state)
this:
between (f c, f a) (f b)

goal (1 subgoal):
 1. between (f b, f a) (f c)
[PROOF STEP]
show "between (f b, f a) (f c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. between (f b, f a) (f c)
[PROOF STEP]
by (metis b between_antisym between_commute between_mem_segment between_triv2 that)
[PROOF STATE]
proof (state)
this:
between (f b, f a) (f c)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f b = f c

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?c \<in> closed_segment a b \<Longrightarrow> f b \<notin> open_segment (f a) (f ?c)

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f a \<noteq> f b
?c \<in> closed_segment a b \<Longrightarrow> f a \<notin> open_segment (f ?c) (f b)
?c \<in> closed_segment a b \<Longrightarrow> f b \<notin> open_segment (f a) (f ?c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f a \<noteq> f b
?c \<in> closed_segment a b \<Longrightarrow> f a \<notin> open_segment (f ?c) (f b)
?c \<in> closed_segment a b \<Longrightarrow> f b \<notin> open_segment (f a) (f ?c)

goal (1 subgoal):
 1. f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)
[PROOF STEP]
by (force simp: closed_segment_eq_real_ivl open_segment_eq_real_ivl split: if_split_asm)
[PROOF STATE]
proof (state)
this:
f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powr_eq_1_iff:
  assumes "a>0"
  shows "(a::real) powr b =1 \<longleftrightarrow> a=1 \<or> b=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a powr b = 1) = (a = 1 \<or> b = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a powr b = 1 \<Longrightarrow> a = 1 \<or> b = 0
 2. a = 1 \<or> b = 0 \<Longrightarrow> a powr b = 1
[PROOF STEP]
assume "a powr b = 1"
[PROOF STATE]
proof (state)
this:
a powr b = 1

goal (2 subgoals):
 1. a powr b = 1 \<Longrightarrow> a = 1 \<or> b = 0
 2. a = 1 \<or> b = 0 \<Longrightarrow> a powr b = 1
[PROOF STEP]
have "b * ln a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b * ln a = 0
[PROOF STEP]
using \<open>a powr b = 1\<close> ln_powr[of a b] assms
[PROOF STATE]
proof (prove)
using this:
a powr b = 1
a \<noteq> 0 \<Longrightarrow> ln (a powr b) = b * ln a
0 < a

goal (1 subgoal):
 1. b * ln a = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b * ln a = 0

goal (2 subgoals):
 1. a powr b = 1 \<Longrightarrow> a = 1 \<or> b = 0
 2. a = 1 \<or> b = 0 \<Longrightarrow> a powr b = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b * ln a = 0
[PROOF STEP]
have "b=0 \<or> ln a =0"
[PROOF STATE]
proof (prove)
using this:
b * ln a = 0

goal (1 subgoal):
 1. b = 0 \<or> ln a = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b = 0 \<or> ln a = 0

goal (2 subgoals):
 1. a powr b = 1 \<Longrightarrow> a = 1 \<or> b = 0
 2. a = 1 \<or> b = 0 \<Longrightarrow> a powr b = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b = 0 \<or> ln a = 0
[PROOF STEP]
show "a = 1 \<or> b = 0"
[PROOF STATE]
proof (prove)
using this:
b = 0 \<or> ln a = 0

goal (1 subgoal):
 1. a = 1 \<or> b = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b = 0 \<or> ln a = 0
0 < a

goal (1 subgoal):
 1. a = 1 \<or> b = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = 1 \<or> b = 0

goal (1 subgoal):
 1. a = 1 \<or> b = 0 \<Longrightarrow> a powr b = 1
[PROOF STEP]
qed (insert assms, auto)


[STATEMENT]
lemma set_split :
  assumes "separateAtoms L = (eq,les,leq,neq)"
  shows "set L = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set L = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
separateAtoms L = (eq, les, leq, neq)

goal (1 subgoal):
 1. set L = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
proof(induction L arbitrary :eq les leq neq)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>eqa les leq neq. separateAtoms [] = (eqa, les, leq, neq) \<Longrightarrow> set [] = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>a L eqa les leq neq. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (a # L) = (eqa, les, leq, neq)\<rbrakk> \<Longrightarrow> set (a # L) = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
separateAtoms [] = (eq, les, leq, neq)

goal (2 subgoals):
 1. \<And>eqa les leq neq. separateAtoms [] = (eqa, les, leq, neq) \<Longrightarrow> set [] = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>a L eqa les leq neq. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (a # L) = (eqa, les, leq, neq)\<rbrakk> \<Longrightarrow> set (a # L) = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
separateAtoms [] = (eq, les, leq, neq)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
separateAtoms [] = (eq, les, leq, neq)

goal (1 subgoal):
 1. set [] = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set [] = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)

goal (1 subgoal):
 1. \<And>a L eqa les leq neq. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (a # L) = (eqa, les, leq, neq)\<rbrakk> \<Longrightarrow> set (a # L) = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a L eqa les leq neq. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (a # L) = (eqa, les, leq, neq)\<rbrakk> \<Longrightarrow> set (a # L) = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
case (Cons At L)
[PROOF STATE]
proof (state)
this:
separateAtoms L = (?eq, ?les, ?leq, ?neq) \<Longrightarrow> set L = set (map EqUni ?eq @ map LessUni ?les @ map LeqUni ?leq @ map NeqUni ?neq)
separateAtoms (At # L) = (eq, les, leq, neq)

goal (1 subgoal):
 1. \<And>a L eqa les leq neq. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (a # L) = (eqa, les, leq, neq)\<rbrakk> \<Longrightarrow> set (a # L) = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
separateAtoms L = (?eq, ?les, ?leq, ?neq) \<Longrightarrow> set L = set (map EqUni ?eq @ map LessUni ?les @ map LeqUni ?leq @ map NeqUni ?neq)
separateAtoms (At # L) = (eq, les, leq, neq)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
separateAtoms L = (?eq, ?les, ?leq, ?neq) \<Longrightarrow> set L = set (map EqUni ?eq @ map LessUni ?les @ map LeqUni ?leq @ map NeqUni ?neq)
separateAtoms (At # L) = (eq, les, leq, neq)

goal (1 subgoal):
 1. set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
proof(cases At)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x1. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LessUni x1\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x2. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = EqUni x2\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 3. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 4. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
case (LessUni p)
[PROOF STATE]
proof (state)
this:
At = LessUni p

goal (4 subgoals):
 1. \<And>x1. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LessUni x1\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x2. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = EqUni x2\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 3. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 4. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
have "\<exists>les'. p#les' = les \<and> separateAtoms L = (eq, les', leq, neq)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>les'. p # les' = les \<and> separateAtoms L = (eq, les', leq, neq)
[PROOF STEP]
using Cons(2)
[PROOF STATE]
proof (prove)
using this:
separateAtoms (At # L) = (eq, les, leq, neq)

goal (1 subgoal):
 1. \<exists>les'. p # les' = les \<and> separateAtoms L = (eq, les', leq, neq)
[PROOF STEP]
unfolding LessUni
[PROOF STATE]
proof (prove)
using this:
separateAtoms (LessUni p # L) = (eq, les, leq, neq)

goal (1 subgoal):
 1. \<exists>les'. p # les' = les \<and> separateAtoms L = (eq, les', leq, neq)
[PROOF STEP]
apply (cases "separateAtoms L")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>separateAtoms (LessUni p # L) = (eq, les, leq, neq); separateAtoms L = (a, b, c, d)\<rbrakk> \<Longrightarrow> \<exists>les'. p # les' = les \<and> separateAtoms L = (eq, les', leq, neq)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>les'. p # les' = les \<and> separateAtoms L = (eq, les', leq, neq)

goal (4 subgoals):
 1. \<And>x1. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LessUni x1\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x2. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = EqUni x2\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 3. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 4. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>les'. p # les' = les \<and> separateAtoms L = (eq, les', leq, neq)
[PROOF STEP]
obtain les' where les' : "p#les' = les" "separateAtoms L = (eq, les', leq, neq)"
[PROOF STATE]
proof (prove)
using this:
\<exists>les'. p # les' = les \<and> separateAtoms L = (eq, les', leq, neq)

goal (1 subgoal):
 1. (\<And>les'. \<lbrakk>p # les' = les; separateAtoms L = (eq, les', leq, neq)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p # les' = les
separateAtoms L = (eq, les', leq, neq)

goal (4 subgoals):
 1. \<And>x1. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LessUni x1\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x2. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = EqUni x2\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 3. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 4. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
unfolding LessUni les'(1)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (LessUni p # L) = set (map EqUni eq @ map LessUni (p # les') @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
using Cons(1)[OF les'(2)]
[PROOF STATE]
proof (prove)
using this:
set L = set (map EqUni eq @ map LessUni les' @ map LeqUni leq @ map NeqUni neq)

goal (1 subgoal):
 1. set (LessUni p # L) = set (map EqUni eq @ map LessUni (p # les') @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)

goal (3 subgoals):
 1. \<And>x2. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = EqUni x2\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 3. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x2. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = EqUni x2\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 3. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
case (EqUni p)
[PROOF STATE]
proof (state)
this:
At = EqUni p

goal (3 subgoals):
 1. \<And>x2. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = EqUni x2\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 3. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
have "\<exists>eq'. p#eq' = eq \<and> separateAtoms L = (eq', les, leq, neq)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>eq'. p # eq' = eq \<and> separateAtoms L = (eq', les, leq, neq)
[PROOF STEP]
using Cons(2)
[PROOF STATE]
proof (prove)
using this:
separateAtoms (At # L) = (eq, les, leq, neq)

goal (1 subgoal):
 1. \<exists>eq'. p # eq' = eq \<and> separateAtoms L = (eq', les, leq, neq)
[PROOF STEP]
unfolding EqUni
[PROOF STATE]
proof (prove)
using this:
separateAtoms (EqUni p # L) = (eq, les, leq, neq)

goal (1 subgoal):
 1. \<exists>eq'. p # eq' = eq \<and> separateAtoms L = (eq', les, leq, neq)
[PROOF STEP]
apply (cases "separateAtoms L")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>separateAtoms (EqUni p # L) = (eq, les, leq, neq); separateAtoms L = (a, b, c, d)\<rbrakk> \<Longrightarrow> \<exists>eq'. p # eq' = eq \<and> separateAtoms L = (eq', les, leq, neq)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>eq'. p # eq' = eq \<and> separateAtoms L = (eq', les, leq, neq)

goal (3 subgoals):
 1. \<And>x2. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = EqUni x2\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 3. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>eq'. p # eq' = eq \<and> separateAtoms L = (eq', les, leq, neq)
[PROOF STEP]
obtain eq' where eq' : "p#eq' = eq" "separateAtoms L = (eq', les, leq, neq)"
[PROOF STATE]
proof (prove)
using this:
\<exists>eq'. p # eq' = eq \<and> separateAtoms L = (eq', les, leq, neq)

goal (1 subgoal):
 1. (\<And>eq'. \<lbrakk>p # eq' = eq; separateAtoms L = (eq', les, leq, neq)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p # eq' = eq
separateAtoms L = (eq', les, leq, neq)

goal (3 subgoals):
 1. \<And>x2. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = EqUni x2\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 3. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
unfolding EqUni eq'(1)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (EqUni p # L) = set (map EqUni (p # eq') @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
using Cons(1)[OF eq'(2)]
[PROOF STATE]
proof (prove)
using this:
set L = set (map EqUni eq' @ map LessUni les @ map LeqUni leq @ map NeqUni neq)

goal (1 subgoal):
 1. set (EqUni p # L) = set (map EqUni (p # eq') @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)

goal (2 subgoals):
 1. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
case (LeqUni p)
[PROOF STATE]
proof (state)
this:
At = LeqUni p

goal (2 subgoals):
 1. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
have "\<exists>leq'. p#leq' = leq \<and> separateAtoms L = (eq, les, leq', neq)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>leq'. p # leq' = leq \<and> separateAtoms L = (eq, les, leq', neq)
[PROOF STEP]
using Cons(2)
[PROOF STATE]
proof (prove)
using this:
separateAtoms (At # L) = (eq, les, leq, neq)

goal (1 subgoal):
 1. \<exists>leq'. p # leq' = leq \<and> separateAtoms L = (eq, les, leq', neq)
[PROOF STEP]
unfolding LeqUni
[PROOF STATE]
proof (prove)
using this:
separateAtoms (LeqUni p # L) = (eq, les, leq, neq)

goal (1 subgoal):
 1. \<exists>leq'. p # leq' = leq \<and> separateAtoms L = (eq, les, leq', neq)
[PROOF STEP]
apply (cases "separateAtoms L")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>separateAtoms (LeqUni p # L) = (eq, les, leq, neq); separateAtoms L = (a, b, c, d)\<rbrakk> \<Longrightarrow> \<exists>leq'. p # leq' = leq \<and> separateAtoms L = (eq, les, leq', neq)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>leq'. p # leq' = leq \<and> separateAtoms L = (eq, les, leq', neq)

goal (2 subgoals):
 1. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>leq'. p # leq' = leq \<and> separateAtoms L = (eq, les, leq', neq)
[PROOF STEP]
obtain leq' where leq' : "p#leq' = leq" "separateAtoms L = (eq, les, leq', neq)"
[PROOF STATE]
proof (prove)
using this:
\<exists>leq'. p # leq' = leq \<and> separateAtoms L = (eq, les, leq', neq)

goal (1 subgoal):
 1. (\<And>leq'. \<lbrakk>p # leq' = leq; separateAtoms L = (eq, les, leq', neq)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p # leq' = leq
separateAtoms L = (eq, les, leq', neq)

goal (2 subgoals):
 1. \<And>x3. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = LeqUni x3\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
 2. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
unfolding LeqUni leq'(1)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (LeqUni p # L) = set (map EqUni eq @ map LessUni les @ map LeqUni (p # leq') @ map NeqUni neq)
[PROOF STEP]
using Cons(1)[OF leq'(2)]
[PROOF STATE]
proof (prove)
using this:
set L = set (map EqUni eq @ map LessUni les @ map LeqUni leq' @ map NeqUni neq)

goal (1 subgoal):
 1. set (LeqUni p # L) = set (map EqUni eq @ map LessUni les @ map LeqUni (p # leq') @ map NeqUni neq)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)

goal (1 subgoal):
 1. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
case (NeqUni p)
[PROOF STATE]
proof (state)
this:
At = NeqUni p

goal (1 subgoal):
 1. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
have "\<exists>neq'. p#neq' = neq \<and> separateAtoms L = (eq, les, leq, neq')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>neq'. p # neq' = neq \<and> separateAtoms L = (eq, les, leq, neq')
[PROOF STEP]
using Cons(2)
[PROOF STATE]
proof (prove)
using this:
separateAtoms (At # L) = (eq, les, leq, neq)

goal (1 subgoal):
 1. \<exists>neq'. p # neq' = neq \<and> separateAtoms L = (eq, les, leq, neq')
[PROOF STEP]
unfolding NeqUni
[PROOF STATE]
proof (prove)
using this:
separateAtoms (NeqUni p # L) = (eq, les, leq, neq)

goal (1 subgoal):
 1. \<exists>neq'. p # neq' = neq \<and> separateAtoms L = (eq, les, leq, neq')
[PROOF STEP]
apply (cases "separateAtoms L")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>separateAtoms (NeqUni p # L) = (eq, les, leq, neq); separateAtoms L = (a, b, c, d)\<rbrakk> \<Longrightarrow> \<exists>neq'. p # neq' = neq \<and> separateAtoms L = (eq, les, leq, neq')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>neq'. p # neq' = neq \<and> separateAtoms L = (eq, les, leq, neq')

goal (1 subgoal):
 1. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>neq'. p # neq' = neq \<and> separateAtoms L = (eq, les, leq, neq')
[PROOF STEP]
obtain neq' where neq' : "p#neq' = neq" "separateAtoms L = (eq, les, leq, neq')"
[PROOF STATE]
proof (prove)
using this:
\<exists>neq'. p # neq' = neq \<and> separateAtoms L = (eq, les, leq, neq')

goal (1 subgoal):
 1. (\<And>neq'. \<lbrakk>p # neq' = neq; separateAtoms L = (eq, les, leq, neq')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p # neq' = neq
separateAtoms L = (eq, les, leq, neq')

goal (1 subgoal):
 1. \<And>x4. \<lbrakk>\<And>eqa les leq neq. separateAtoms L = (eqa, les, leq, neq) \<Longrightarrow> set L = set (map EqUni eqa @ map LessUni les @ map LeqUni leq @ map NeqUni neq); separateAtoms (At # L) = (eq, les, leq, neq); At = NeqUni x4\<rbrakk> \<Longrightarrow> set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)
[PROOF STEP]
unfolding NeqUni neq'(1)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (NeqUni p # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni (p # neq'))
[PROOF STEP]
using Cons(1)[OF neq'(2)]
[PROOF STATE]
proof (prove)
using this:
set L = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq')

goal (1 subgoal):
 1. set (NeqUni p # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni (p # neq'))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set (At # L) = set (map EqUni eq @ map LessUni les @ map LeqUni leq @ map NeqUni neq)

goal:
No subgoals!
[PROOF STEP]
qed