[STATEMENT]
lemma "(X :: _ :: semigroup_add set) + Y + Z = X + (Y + Z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X + Y + Z = X + (Y + Z)
[PROOF STEP]
by (fact add.assoc[applicative_lifted set])


[STATEMENT]
lemma mset_points_distinct_diff_one: "distinct_mset (mset_set (\<V> - {x}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_mset (mset_set (\<V> - {x}))
[PROOF STEP]
by (meson count_mset_set_le_one distinct_mset_count_less_1)


[STATEMENT]
lemma tank_arith:
  assumes "0 \<le> (\<tau>::real)" and "0 < c\<^sub>o" and "c\<^sub>o < c\<^sub>i"
  shows "\<forall>\<tau>\<in>{0..\<tau>}. \<tau> \<le> - ((hmin - y) / c\<^sub>o) \<Longrightarrow>  hmin \<le> y - c\<^sub>o * \<tau>"
    and "\<forall>\<tau>\<in>{0..\<tau>}. \<tau> \<le> (hmax - y) / (c\<^sub>i - c\<^sub>o) \<Longrightarrow>  (c\<^sub>i - c\<^sub>o) * \<tau> + y \<le> hmax"
    and "hmin \<le> y \<Longrightarrow> hmin \<le> (c\<^sub>i - c\<^sub>o) * \<tau> + y"
    and "y \<le> hmax \<Longrightarrow> y - c\<^sub>o * \<tau> \<le> hmax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>\<tau>\<in>{0..\<tau>}. \<tau> \<le> - ((hmin - y) / c\<^sub>o) \<Longrightarrow> hmin \<le> y - c\<^sub>o \<cdot> \<tau>) &&& (\<forall>\<tau>\<in>{0..\<tau>}. \<tau> \<le> (hmax - y) / (c\<^sub>i - c\<^sub>o) \<Longrightarrow> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y \<le> hmax)) &&& (hmin \<le> y \<Longrightarrow> hmin \<le> (c\<^sub>i - c\<^sub>o) \<cdot> \<tau> + y) &&& (y \<le> hmax \<Longrightarrow> y - c\<^sub>o \<cdot> \<tau> \<le> hmax)
[PROOF STEP]
apply(simp_all add: field_simps le_divide_eq assms)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. hmin \<le> y \<Longrightarrow> hmin + \<tau> \<cdot> c\<^sub>o \<le> y + \<tau> \<cdot> c\<^sub>i
 2. y \<le> hmax \<Longrightarrow> y \<le> hmax + \<tau> \<cdot> c\<^sub>o
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<tau>
0 < c\<^sub>o
c\<^sub>o < c\<^sub>i

goal (2 subgoals):
 1. hmin \<le> y \<Longrightarrow> hmin + \<tau> \<cdot> c\<^sub>o \<le> y + \<tau> \<cdot> c\<^sub>i
 2. y \<le> hmax \<Longrightarrow> y \<le> hmax + \<tau> \<cdot> c\<^sub>o
[PROOF STEP]
apply (meson add_mono less_eq_real_def mult_left_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> hmax \<Longrightarrow> y \<le> hmax + \<tau> \<cdot> c\<^sub>o
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<tau>
0 < c\<^sub>o
c\<^sub>o < c\<^sub>i

goal (1 subgoal):
 1. y \<le> hmax \<Longrightarrow> y \<le> hmax + \<tau> \<cdot> c\<^sub>o
[PROOF STEP]
by (meson add_increasing2 less_eq_real_def mult_nonneg_nonneg)


[STATEMENT]
lemma insert_dom_less_eq:
  "\<lbrakk> x \<notin> dom f; x \<notin> dom f'; dom (f(x \<mapsto> y)) = dom (f'(x \<mapsto> y')) \<rbrakk>
  \<Longrightarrow> dom f = dom f'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> dom f; x \<notin> dom f'; dom (f(x \<mapsto> y)) = dom (f'(x \<mapsto> y'))\<rbrakk> \<Longrightarrow> dom f = dom f'
[PROOF STEP]
by auto


[STATEMENT]
lemma card_face_cycle_sets_da':
    "card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
have "S = G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'}
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. segment G.face_cycle_succ a a \<union> segment G.face_cycle_succ a' a' = G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'}
[PROOF STEP]
using diff_face_not_in
[PROOF STATE]
proof (prove)
using this:
a \<notin> G.face_cycle_set a'
a' \<notin> G.face_cycle_set a

goal (1 subgoal):
 1. segment G.face_cycle_succ a a \<union> segment G.face_cycle_succ a' a' = G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'}
[PROOF STEP]
by (auto simp: segment_x_x_eq G.permutation_face_cycle_succ G.face_cycle_set_def)
[PROOF STATE]
proof (state)
this:
S = G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'}

goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S = G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'}

goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
S = G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'}

goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
assume "x \<in> S"
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
[PROOF STEP]
have "x \<in> arcs H \<inter> (G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'})"
[PROOF STATE]
proof (prove)
using this:
x \<in> S

goal (1 subgoal):
 1. x \<in> arcs H \<inter> (G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'})
[PROOF STEP]
unfolding \<open>S = _\<close> arcs_H
[PROOF STATE]
proof (prove)
using this:
x \<in> G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'}

goal (1 subgoal):
 1. x \<in> (arcs G - {a, a'}) \<inter> (G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'})
[PROOF STEP]
using a_in
[PROOF STATE]
proof (prove)
using this:
x \<in> G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'}
a \<in> arcs G

goal (1 subgoal):
 1. x \<in> (arcs G - {a, a'}) \<inter> (G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'})
[PROOF STEP]
by (auto intro: G.in_face_cycle_setD)
[PROOF STATE]
proof (state)
this:
x \<in> arcs H \<inter> (G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'})

goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> arcs H \<inter> (G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'})
[PROOF STEP]
have "H.face_cycle_set x = S"
[PROOF STATE]
proof (prove)
using this:
x \<in> arcs H \<inter> (G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'})

goal (1 subgoal):
 1. H.face_cycle_set x = S
[PROOF STEP]
using H_fcs_eq_for_a HJ_fcs_eq_for_a'
[PROOF STATE]
proof (prove)
using this:
x \<in> arcs H \<inter> (G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'})
?b \<in> arcs H \<inter> G.face_cycle_set a \<Longrightarrow> H.face_cycle_set ?b = S
?b \<in> arcs H \<inter> G.face_cycle_set a' \<Longrightarrow> H.face_cycle_set ?b = S

goal (1 subgoal):
 1. H.face_cycle_set x = S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
H.face_cycle_set x = S

goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x6 \<in> S \<Longrightarrow> H.face_cycle_set ?x6 = S

goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x6 \<in> S \<Longrightarrow> H.face_cycle_set ?x6 = S
[PROOF STEP]
have "H.face_cycle_set ` S = (if S = {} then {} else {S})"
[PROOF STATE]
proof (prove)
using this:
?x6 \<in> S \<Longrightarrow> H.face_cycle_set ?x6 = S

goal (1 subgoal):
 1. H.face_cycle_set ` S = (if S = {} then {} else {S})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
H.face_cycle_set ` S = (if S = {} then {} else {S})

goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S = G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'}
H.face_cycle_set ` S = (if S = {} then {} else {S})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S = G.face_cycle_set a \<union> G.face_cycle_set a' - {a, a'}
H.face_cycle_set ` S = (if S = {} then {} else {S})

goal (1 subgoal):
 1. card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)
[PROOF STEP]
by (simp add: card_face_cycle_sets_da0)
[PROOF STATE]
proof (state)
this:
card H.face_cycle_sets = card G.face_cycle_sets - card {G.face_cycle_set a, G.face_cycle_set a'} + (if S = {} then 0 else 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Fun_hfun_to_arr:
    assumes "hfun B C F"
    shows "Fun (hfun_to_arr B C F) = restrict (\<lambda>x. arr_of (happ F (elem_of x))) (arr_of ` hfset B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fun (hfun_to_arr B C F) = (\<lambda>x\<^bold>\<in>arr_of ` hfset B. arr_of (happ F (elem_of x)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Fun (hfun_to_arr B C F) = (\<lambda>x\<^bold>\<in>arr_of ` hfset B. arr_of (happ F (elem_of x)))
[PROOF STEP]
have "arr (hfun_to_arr B C F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr (hfun_to_arr B C F)
[PROOF STEP]
using assms hfun_to_arr_in_hom
[PROOF STATE]
proof (prove)
using this:
hfun B C F
hfun ?B ?C ?F \<Longrightarrow> \<guillemotleft>hfun_to_arr ?B ?C ?F : hf_to_ide ?B \<rightarrow> hf_to_ide ?C\<guillemotright>

goal (1 subgoal):
 1. arr (hfun_to_arr B C F)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
arr (hfun_to_arr B C F)

goal (1 subgoal):
 1. Fun (hfun_to_arr B C F) = (\<lambda>x\<^bold>\<in>arr_of ` hfset B. arr_of (happ F (elem_of x)))
[PROOF STEP]
hence "arr (mkArr (arr_of ` hfset B) (arr_of ` hfset C) (\<lambda>x. arr_of (happ F (elem_of x))))"
[PROOF STATE]
proof (prove)
using this:
arr (hfun_to_arr B C F)

goal (1 subgoal):
 1. arr (mkArr (arr_of ` hfset B) (arr_of ` hfset C) (\<lambda>x. arr_of (happ F (elem_of x))))
[PROOF STEP]
using hfun_to_arr_def
[PROOF STATE]
proof (prove)
using this:
arr (hfun_to_arr B C F)
hfun_to_arr ?B ?C ?F = mkArr (arr_of ` hfset ?B) (arr_of ` hfset ?C) (\<lambda>x. arr_of (happ ?F (elem_of x)))

goal (1 subgoal):
 1. arr (mkArr (arr_of ` hfset B) (arr_of ` hfset C) (\<lambda>x. arr_of (happ F (elem_of x))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
arr (mkArr (arr_of ` hfset B) (arr_of ` hfset C) (\<lambda>x. arr_of (happ F (elem_of x))))

goal (1 subgoal):
 1. Fun (hfun_to_arr B C F) = (\<lambda>x\<^bold>\<in>arr_of ` hfset B. arr_of (happ F (elem_of x)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
arr (mkArr (arr_of ` hfset B) (arr_of ` hfset C) (\<lambda>x. arr_of (happ F (elem_of x))))

goal (1 subgoal):
 1. Fun (hfun_to_arr B C F) = (\<lambda>x\<^bold>\<in>arr_of ` hfset B. arr_of (happ F (elem_of x)))
[PROOF STEP]
using assms hfun_to_arr_def Fun_mkArr
[PROOF STATE]
proof (prove)
using this:
arr (mkArr (arr_of ` hfset B) (arr_of ` hfset C) (\<lambda>x. arr_of (happ F (elem_of x))))
hfun B C F
hfun_to_arr ?B ?C ?F = mkArr (arr_of ` hfset ?B) (arr_of ` hfset ?C) (\<lambda>x. arr_of (happ ?F (elem_of x)))
arr (mkArr ?A ?B ?F) \<Longrightarrow> Fun (mkArr ?A ?B ?F) = restrict ?F ?A

goal (1 subgoal):
 1. Fun (hfun_to_arr B C F) = (\<lambda>x\<^bold>\<in>arr_of ` hfset B. arr_of (happ F (elem_of x)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Fun (hfun_to_arr B C F) = (\<lambda>x\<^bold>\<in>arr_of ` hfset B. arr_of (happ F (elem_of x)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma FINITE_ALL_DISTINCT_LISTS_i:
  fixes P
  assumes "finite P"
  shows "
    {p. distinct p \<and> set p \<subseteq> P}
    = {[]} \<union> (\<Union> ((\<lambda>e. {e # p0 | p0. distinct p0 \<and> set p0 \<subseteq> (P - {e})}) ` P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
let ?A="{p. distinct p \<and> set p \<subseteq> P }"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
let ?B="{[]} \<union> (\<Union> ((\<lambda>e. {e # p0 | p0. distinct p0 \<and> set p0 \<subseteq> (P - {e})}) ` P))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
assume P: "a \<in> ?A"
[PROOF STATE]
proof (state)
this:
a \<in> {p. distinct p \<and> set p \<subseteq> P}

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
have "a \<in> ?B"
[PROOF STATE]
proof (prove)
using this:
a \<in> {p. distinct p \<and> set p \<subseteq> P}

goal (1 subgoal):
 1. a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
proof (cases a)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
text \<open> The empty list is distinct and its corresponding set is the empty set which is a
            trivial subset of `?B`. The `Nil` case can therefore be derived by automation. \<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
case (Cons h list)
[PROOF STATE]
proof (state)
this:
a = h # list

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
a = h # list

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
let ?b'="h"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
a \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
have "set a \<subseteq> P"
[PROOF STATE]
proof (prove)
using this:
a \<in> {p. distinct p \<and> set p \<subseteq> P}

goal (1 subgoal):
 1. set a \<subseteq> P
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set a \<subseteq> P

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set a \<subseteq> P
[PROOF STEP]
have "set list \<subseteq> (P - {h})"
[PROOF STATE]
proof (prove)
using this:
set a \<subseteq> P

goal (1 subgoal):
 1. set list \<subseteq> P - {h}
[PROOF STEP]
using P dual_order.trans local.Cons
[PROOF STATE]
proof (prove)
using this:
set a \<subseteq> P
a \<in> {p. distinct p \<and> set p \<subseteq> P}
\<lbrakk>?b \<le> ?a; ?c \<le> ?b\<rbrakk> \<Longrightarrow> ?c \<le> ?a
a = h # list

goal (1 subgoal):
 1. set list \<subseteq> P - {h}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set list \<subseteq> P - {h}

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
set list \<subseteq> P - {h}

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set list \<subseteq> P - {h}

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
from P Cons
[PROOF STATE]
proof (chain)
picking this:
a \<in> {p. distinct p \<and> set p \<subseteq> P}
a = h # list
[PROOF STEP]
have "distinct list"
[PROOF STATE]
proof (prove)
using this:
a \<in> {p. distinct p \<and> set p \<subseteq> P}
a = h # list

goal (1 subgoal):
 1. distinct list
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
distinct list

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set list \<subseteq> P - {h}
distinct list
[PROOF STEP]
have "a \<in> ((\<lambda>e. {e # p0 | p0. distinct p0 \<and> set p0 \<subseteq> (P - {e})}) ?b')"
[PROOF STATE]
proof (prove)
using this:
set list \<subseteq> P - {h}
distinct list

goal (1 subgoal):
 1. a \<in> {h # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {h}}
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
set list \<subseteq> P - {h}
distinct list
a = h # list

goal (1 subgoal):
 1. a \<in> {h # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {h}}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<in> {h # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {h}}

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<in> {h # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {h}}

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
a \<in> {h # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {h}}

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
from P Cons
[PROOF STATE]
proof (chain)
picking this:
a \<in> {p. distinct p \<and> set p \<subseteq> P}
a = h # list
[PROOF STEP]
have "?b' \<in> set a"
[PROOF STATE]
proof (prove)
using this:
a \<in> {p. distinct p \<and> set p \<subseteq> P}
a = h # list

goal (1 subgoal):
 1. h \<in> set a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h \<in> set a

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
h \<in> set a

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
a \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
have "set a \<subseteq> P"
[PROOF STATE]
proof (prove)
using this:
a \<in> {p. distinct p \<and> set p \<subseteq> P}

goal (1 subgoal):
 1. set a \<subseteq> P
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set a \<subseteq> P

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
h \<in> set a
set a \<subseteq> P
[PROOF STEP]
have "?b' \<in> P"
[PROOF STATE]
proof (prove)
using this:
h \<in> set a
set a \<subseteq> P

goal (1 subgoal):
 1. h \<in> P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h \<in> P

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
h \<in> P

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a \<in> {h # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {h}}
h \<in> P
[PROOF STEP]
have
            "\<exists>b' \<in> P. a \<in> ((\<lambda>e. {e # p0 | p0. distinct p0 \<and> set p0 \<subseteq> (P - {e})}) b')"
[PROOF STATE]
proof (prove)
using this:
a \<in> {h # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {h}}
h \<in> P

goal (1 subgoal):
 1. \<exists>b'\<in>P. a \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
\<exists>b'\<in>P. a \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<exists>b'\<in>P. a \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>b'\<in>P. a \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}
[PROOF STEP]
obtain b' where
          "b' \<in> P" "a \<in> ((\<lambda>e. {e # p0 | p0. distinct p0 \<and> set p0 \<subseteq> (P - {e})}) b')"
[PROOF STATE]
proof (prove)
using this:
\<exists>b'\<in>P. a \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}

goal (1 subgoal):
 1. (\<And>b'. \<lbrakk>b' \<in> P; a \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b' \<in> P
a \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}

goal (2 subgoals):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
 2. \<And>aa list. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = aa # list\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b' \<in> P
a \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b' \<in> P
a \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}

goal (1 subgoal):
 1. a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})

goal (1 subgoal):
 1. \<lbrakk>a \<in> {p. distinct p \<and> set p \<subseteq> P}; a = []\<rbrakk> \<Longrightarrow> a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
qed blast
[PROOF STATE]
proof (state)
this:
a \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?a2 \<in> {p. distinct p \<and> set p \<subseteq> P} \<Longrightarrow> ?a2 \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?a2 \<in> {p. distinct p \<and> set p \<subseteq> P} \<Longrightarrow> ?a2 \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
have "?A \<subseteq> ?B"
[PROOF STATE]
proof (prove)
using this:
?a2 \<in> {p. distinct p \<and> set p \<subseteq> P} \<Longrightarrow> ?a2 \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} \<subseteq> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{p. distinct p \<and> set p \<subseteq> P} \<subseteq> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
{p. distinct p \<and> set p \<subseteq> P} \<subseteq> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{p. distinct p \<and> set p \<subseteq> P} \<subseteq> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
{p. distinct p \<and> set p \<subseteq> P} \<subseteq> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
{p. distinct p \<and> set p \<subseteq> P} \<subseteq> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
assume P: "b \<in> ?B"
[PROOF STATE]
proof (state)
this:
b \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
have "b \<in> ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
text \<open> The empty list is in `?B` by construction. The `Nil` case can therefore be derived
          straightforwardly.\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
proof (cases b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b = [] \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
 2. \<And>a list. b = a # list \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
case (Cons a list)
[PROOF STATE]
proof (state)
this:
b = a # list

goal (2 subgoals):
 1. b = [] \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
 2. \<And>a list. b = a # list \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
from P Cons
[PROOF STATE]
proof (chain)
picking this:
b \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
b = a # list
[PROOF STEP]
obtain b' where a:
          "b' \<in> P" "b \<in> {b' # p0 | p0. distinct p0 \<and> set p0 \<subseteq> (P - {b'})}"
[PROOF STATE]
proof (prove)
using this:
b \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
b = a # list

goal (1 subgoal):
 1. (\<And>b'. \<lbrakk>b' \<in> P; b \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
b' \<in> P
b \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}

goal (2 subgoals):
 1. b = [] \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
 2. \<And>a list. b = a # list \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b' \<in> P
b \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}
[PROOF STEP]
obtain p0 where b: "b = b' # p0" "distinct p0" "set p0 \<subseteq> (P - {b'})"
[PROOF STATE]
proof (prove)
using this:
b' \<in> P
b \<in> {b' # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {b'}}

goal (1 subgoal):
 1. (\<And>p0. \<lbrakk>b = b' # p0; distinct p0; set p0 \<subseteq> P - {b'}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b = b' # p0
distinct p0
set p0 \<subseteq> P - {b'}

goal (2 subgoals):
 1. b = [] \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
 2. \<And>a list. b = a # list \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b = b' # p0
distinct p0
set p0 \<subseteq> P - {b'}
[PROOF STEP]
have "distinct (b' # p0)"
[PROOF STATE]
proof (prove)
using this:
b = b' # p0
distinct p0
set p0 \<subseteq> P - {b'}

goal (1 subgoal):
 1. distinct (b' # p0)
[PROOF STEP]
by (simp add: subset_Diff_insert)
[PROOF STATE]
proof (state)
this:
distinct (b' # p0)

goal (2 subgoals):
 1. b = [] \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
 2. \<And>a list. b = a # list \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
distinct (b' # p0)

goal (2 subgoals):
 1. b = [] \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
 2. \<And>a list. b = a # list \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
have "set (b' # p0) \<subseteq> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (b' # p0) \<subseteq> P
[PROOF STEP]
using a(1) b(3)
[PROOF STATE]
proof (prove)
using this:
b' \<in> P
set p0 \<subseteq> P - {b'}

goal (1 subgoal):
 1. set (b' # p0) \<subseteq> P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (b' # p0) \<subseteq> P

goal (2 subgoals):
 1. b = [] \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
 2. \<And>a list. b = a # list \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
distinct (b' # p0)
set (b' # p0) \<subseteq> P
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
distinct (b' # p0)
set (b' # p0) \<subseteq> P

goal (1 subgoal):
 1. b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
using b(1)
[PROOF STATE]
proof (prove)
using this:
distinct (b' # p0)
set (b' # p0) \<subseteq> P
b = b' # p0

goal (1 subgoal):
 1. b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
b \<in> {p. distinct p \<and> set p \<subseteq> P}

goal (1 subgoal):
 1. b = [] \<Longrightarrow> b \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
b \<in> {p. distinct p \<and> set p \<subseteq> P}

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?b2 \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}}) \<Longrightarrow> ?b2 \<in> {p. distinct p \<and> set p \<subseteq> P}

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?b2 \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}}) \<Longrightarrow> ?b2 \<in> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
have "?B \<subseteq> ?A"
[PROOF STATE]
proof (prove)
using this:
?b2 \<in> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}}) \<Longrightarrow> ?b2 \<in> {p. distinct p \<and> set p \<subseteq> P}

goal (1 subgoal):
 1. {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}}) \<subseteq> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}}) \<subseteq> {p. distinct p \<and> set p \<subseteq> P}

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
{[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}}) \<subseteq> {p. distinct p \<and> set p \<subseteq> P}

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{p. distinct p \<and> set p \<subseteq> P} \<subseteq> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
{[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}}) \<subseteq> {p. distinct p \<and> set p \<subseteq> P}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{p. distinct p \<and> set p \<subseteq> P} \<subseteq> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
{[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}}) \<subseteq> {p. distinct p \<and> set p \<subseteq> P}

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
using set_eq_subset
[PROOF STATE]
proof (prove)
using this:
{p. distinct p \<and> set p \<subseteq> P} \<subseteq> {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
{[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}}) \<subseteq> {p. distinct p \<and> set p \<subseteq> P}
(?A = ?B) = (?A \<subseteq> ?B \<and> ?B \<subseteq> ?A)

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{p. distinct p \<and> set p \<subseteq> P} = {[]} \<union> (\<Union>e\<in>P. {e # p0 |p0. distinct p0 \<and> set p0 \<subseteq> P - {e}})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ennreal_divide_numeral: "0 \<le> x \<Longrightarrow> ennreal x / numeral b = ennreal (x / numeral b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> ennreal x / numeral b = ennreal (x / numeral b)
[PROOF STEP]
by (subst divide_ennreal[symmetric]) auto


[STATEMENT]
lemma singlPart_inj_on[simp]:
"inj_on (image f) (singlPart I) = inj_on f I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((`) f) (singlPart I) = inj_on f I
[PROOF STEP]
unfolding inj_on_def singlPart_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>{{i} |i. i \<in> I}. \<forall>y\<in>{{i} |i. i \<in> I}. f ` x = f ` y \<longrightarrow> x = y) = (\<forall>x\<in>I. \<forall>y\<in>I. f x = f y \<longrightarrow> x = y)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>x. (\<exists>i. x = {i} \<and> i \<in> I) \<longrightarrow> (\<forall>y. (\<exists>i. y = {i} \<and> i \<in> I) \<longrightarrow> f ` x = f ` y \<longrightarrow> x = y); x \<in> I; y \<in> I; f x = f y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (metis image_insert insertI1 insert_absorb insert_code singleton_inject)


[STATEMENT]
lemma x_less_2_0_1':
  fixes x :: "'a::len word"
  shows "\<lbrakk>LENGTH('a) \<noteq> 1; x < 2\<rbrakk> \<Longrightarrow> x = 0 \<or> x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>LENGTH('a) \<noteq> 1; x < 2\<rbrakk> \<Longrightarrow> x = 0 \<or> x = 1
[PROOF STEP]
apply (cases \<open>2 \<le> LENGTH('a)\<close>)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>LENGTH('a) \<noteq> 1; x < 2; 2 \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> x = 0 \<or> x = 1
 2. \<lbrakk>LENGTH('a) \<noteq> 1; x < 2; \<not> 2 \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> x = 0 \<or> x = 1
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < 2; 2 \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> x = 0 \<or> x = 1
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>take_bit LENGTH('a) x < take_bit LENGTH('a) 2; 2 \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> take_bit LENGTH('a) x = take_bit LENGTH('a) 0 \<or> take_bit LENGTH('a) x = take_bit LENGTH('a) 1
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>take_bit LENGTH('a) x < 2; 2 \<le> LENGTH('a); take_bit LENGTH('a) x \<noteq> 1\<rbrakk> \<Longrightarrow> take_bit LENGTH('a) x = 0
[PROOF STEP]
apply (metis add.commute add.right_neutral even_two_times_div_two mod_div_trivial mod_pos_pos_trivial mult.commute mult_zero_left not_less not_take_bit_negative odd_two_times_div_two_succ)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma tau_ideal1: "\<lbrakk>\<tau> x = x; y \<le> x\<rbrakk> \<Longrightarrow> \<tau> y = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<tau> x = x; y \<le> x\<rbrakk> \<Longrightarrow> \<tau> y = y
[PROOF STEP]
by (metis local.dual_order.trans tau_def term_p_subid_var)


[STATEMENT]
lemma eq_infI[intro 0]:
      assumes "w\<^sub>1 \<preceq>\<^sub>I w\<^sub>2" "w\<^sub>2 \<preceq>\<^sub>I w\<^sub>1"
      shows "w\<^sub>1 =\<^sub>I w\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w\<^sub>1 =\<^sub>I w\<^sub>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
w\<^sub>1 \<preceq>\<^sub>I w\<^sub>2
w\<^sub>2 \<preceq>\<^sub>I w\<^sub>1

goal (1 subgoal):
 1. w\<^sub>1 =\<^sub>I w\<^sub>2
[PROOF STEP]
unfolding eq_inf_def
[PROOF STATE]
proof (prove)
using this:
w\<^sub>1 \<preceq>\<^sub>I w\<^sub>2
w\<^sub>2 \<preceq>\<^sub>I w\<^sub>1

goal (1 subgoal):
 1. w\<^sub>1 \<preceq>\<^sub>I w\<^sub>2 \<and> w\<^sub>2 \<preceq>\<^sub>I w\<^sub>1
[PROOF STEP]
by auto


[STATEMENT]
lemma leq_refl [simp]: "x \<le>\<^sub>\<S> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le>\<^sub>\<S> x
[PROOF STEP]
unfolding leq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<oplus> x = x
[PROOF STEP]
by simp


[STATEMENT]
theorem gt_compat_arg: "s' >\<^sub>t s \<Longrightarrow> App s' t >\<^sub>t App s t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s' >\<^sub>t s \<Longrightarrow> App s' t >\<^sub>t App s t
[PROOF STEP]
unfolding basic_gt_iff_gt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.kbo_std.gt s' s \<Longrightarrow> local.kbo_std.gt (App s' t) (App s t)
[PROOF STEP]
by (rule kbo_std.gt_compat_arg[simplified])


[STATEMENT]
lemma cl_empty [simp]: "lattice L ==> cl L {} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice L \<Longrightarrow> cl L {} = {}
[PROOF STEP]
by (simp add: cl_ident empty_in_lattice)


[STATEMENT]
lemma star_left_induct_equal:
  "z \<squnion> x * y = y \<Longrightarrow> x\<^sup>\<star> * z \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<squnion> x * y = y \<Longrightarrow> x\<^sup>\<star> * z \<le> y
[PROOF STEP]
by (simp add: star_left_induct)


[STATEMENT]
lemma connected_arc_image: "arc g \<Longrightarrow> connected(path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arc g \<Longrightarrow> connected (path_image g)
[PROOF STEP]
by (metis connected_path_image arc_imp_path)


[STATEMENT]
lemma listrel1_mono:
  "r \<subseteq> s \<Longrightarrow> listrel1 r \<subseteq> listrel1 s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<subseteq> s \<Longrightarrow> listrel1 r \<subseteq> listrel1 s
[PROOF STEP]
unfolding listrel1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<subseteq> s \<Longrightarrow> {(xs, ys). \<exists>us z z' vs. xs = us @ z # vs \<and> (z, z') \<in> r \<and> ys = us @ z' # vs} \<subseteq> {(xs, ys). \<exists>us z z' vs. xs = us @ z # vs \<and> (z, z') \<in> s \<and> ys = us @ z' # vs}
[PROOF STEP]
by blast


[STATEMENT]
lemma law_restrict_carrier: "carrier (law_restrict R) = carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (law_restrict R) = carrier R
[PROOF STEP]
by (simp add: law_restrict_def ring.defs)


[STATEMENT]
lemma cr_vrat_bi_unqie[transfer_rule]: "bi_unique cr_vrat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bi_unique cr_vrat
[PROOF STEP]
unfolding cr_vrat_def bi_unique_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y z. x = y\<^sub>\<rat> \<longrightarrow> x = z\<^sub>\<rat> \<longrightarrow> y = z) \<and> (\<forall>x y z. x = z\<^sub>\<rat> \<longrightarrow> y = z\<^sub>\<rat> \<longrightarrow> x = y)
[PROOF STEP]
by (simp add: inj_eq inj_vrat_of_rat)


[STATEMENT]
lemma sqrt_greater_zero_iff [simp]: "sqrt n > 0 \<longleftrightarrow> n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < local.sqrt n) = (0 < n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0 < local.sqrt n) = (0 < n)
[PROOF STEP]
have *: "0 < Max {m. m\<^sup>2 \<le> n} \<longleftrightarrow> (\<exists>a\<in>{m. m\<^sup>2 \<le> n}. 0 < a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < Max {m. m\<^sup>2 \<le> n}) = (\<exists>a\<in>{m. m\<^sup>2 \<le> n}. 0 < a)
[PROOF STEP]
by (rule Max_gr_iff) (fact sqrt_aux)+
[PROOF STATE]
proof (state)
this:
(0 < Max {m. m\<^sup>2 \<le> n}) = (\<exists>a\<in>{m. m\<^sup>2 \<le> n}. 0 < a)

goal (1 subgoal):
 1. (0 < local.sqrt n) = (0 < n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < local.sqrt n) = (0 < n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < local.sqrt n \<Longrightarrow> 0 < n
 2. 0 < n \<Longrightarrow> 0 < local.sqrt n
[PROOF STEP]
assume "0 < sqrt n"
[PROOF STATE]
proof (state)
this:
0 < local.sqrt n

goal (2 subgoals):
 1. 0 < local.sqrt n \<Longrightarrow> 0 < n
 2. 0 < n \<Longrightarrow> 0 < local.sqrt n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < local.sqrt n
[PROOF STEP]
have "0 < Max {m. m\<^sup>2 \<le> n}"
[PROOF STATE]
proof (prove)
using this:
0 < local.sqrt n

goal (1 subgoal):
 1. 0 < Max {m. m\<^sup>2 \<le> n}
[PROOF STEP]
by (simp add: sqrt_def)
[PROOF STATE]
proof (state)
this:
0 < Max {m. m\<^sup>2 \<le> n}

goal (2 subgoals):
 1. 0 < local.sqrt n \<Longrightarrow> 0 < n
 2. 0 < n \<Longrightarrow> 0 < local.sqrt n
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
(0 < Max {m. m\<^sup>2 \<le> n}) = (\<exists>a\<in>{m. m\<^sup>2 \<le> n}. 0 < a)
0 < Max {m. m\<^sup>2 \<le> n}
[PROOF STEP]
show "0 < n"
[PROOF STATE]
proof (prove)
using this:
(0 < Max {m. m\<^sup>2 \<le> n}) = (\<exists>a\<in>{m. m\<^sup>2 \<le> n}. 0 < a)
0 < Max {m. m\<^sup>2 \<le> n}

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

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> 0 < local.sqrt n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> 0 < local.sqrt n
[PROOF STEP]
assume "0 < n"
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> 0 < local.sqrt n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "1\<^sup>2 \<le> n \<and> 0 < (1::nat)"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. 1\<^sup>2 \<le> n \<and> 0 < 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1\<^sup>2 \<le> n \<and> 0 < 1

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> 0 < local.sqrt n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1\<^sup>2 \<le> n \<and> 0 < 1
[PROOF STEP]
have "\<exists>q. q\<^sup>2 \<le> n \<and> 0 < q"
[PROOF STATE]
proof (prove)
using this:
1\<^sup>2 \<le> n \<and> 0 < 1

goal (1 subgoal):
 1. \<exists>q. q\<^sup>2 \<le> n \<and> 0 < q
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>q. q\<^sup>2 \<le> n \<and> 0 < q

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> 0 < local.sqrt n
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
(0 < Max {m. m\<^sup>2 \<le> n}) = (\<exists>a\<in>{m. m\<^sup>2 \<le> n}. 0 < a)
\<exists>q. q\<^sup>2 \<le> n \<and> 0 < q
[PROOF STEP]
have "0 < Max {m. m\<^sup>2 \<le> n}"
[PROOF STATE]
proof (prove)
using this:
(0 < Max {m. m\<^sup>2 \<le> n}) = (\<exists>a\<in>{m. m\<^sup>2 \<le> n}. 0 < a)
\<exists>q. q\<^sup>2 \<le> n \<and> 0 < q

goal (1 subgoal):
 1. 0 < Max {m. m\<^sup>2 \<le> n}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < Max {m. m\<^sup>2 \<le> n}

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> 0 < local.sqrt n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < Max {m. m\<^sup>2 \<le> n}
[PROOF STEP]
show "0 < sqrt n"
[PROOF STATE]
proof (prove)
using this:
0 < Max {m. m\<^sup>2 \<le> n}

goal (1 subgoal):
 1. 0 < local.sqrt n
[PROOF STEP]
by  (simp add: sqrt_def)
[PROOF STATE]
proof (state)
this:
0 < local.sqrt n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(0 < local.sqrt n) = (0 < n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vsnd_arrow_vrange: "\<R>\<^sub>\<circ> (vsnd_arrow A B\<lparr>ArrVal\<rparr>) \<subseteq>\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (vsnd_arrow A B\<lparr>ArrVal\<rparr>) \<subseteq>\<^sub>\<circ> B
[PROOF STEP]
unfolding vsnd_arrow_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (VLambda (A \<times>\<^sub>\<circ> B) vsnd) \<subseteq>\<^sub>\<circ> B
[PROOF STEP]
proof(intro vrange_VLambda_vsubset)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> vsnd x \<in>\<^sub>\<circ> B
[PROOF STEP]
fix ab
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> vsnd x \<in>\<^sub>\<circ> B
[PROOF STEP]
assume "ab \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B"
[PROOF STATE]
proof (state)
this:
ab \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> vsnd x \<in>\<^sub>\<circ> B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ab \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B
[PROOF STEP]
obtain a b where ab_def: "ab = \<langle>a, b\<rangle>" and b: "b \<in>\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
using this:
ab \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>ab = \<langle>a, b\<rangle>; b \<in>\<^sub>\<circ> B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by clarsimp
[PROOF STATE]
proof (state)
this:
ab = \<langle>a, b\<rangle>
b \<in>\<^sub>\<circ> B

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> vsnd x \<in>\<^sub>\<circ> B
[PROOF STEP]
from b
[PROOF STATE]
proof (chain)
picking this:
b \<in>\<^sub>\<circ> B
[PROOF STEP]
show "vsnd ab \<in>\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
using this:
b \<in>\<^sub>\<circ> B

goal (1 subgoal):
 1. vsnd ab \<in>\<^sub>\<circ> B
[PROOF STEP]
unfolding ab_def
[PROOF STATE]
proof (prove)
using this:
b \<in>\<^sub>\<circ> B

goal (1 subgoal):
 1. vsnd \<langle>a, b\<rangle> \<in>\<^sub>\<circ> B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vsnd ab \<in>\<^sub>\<circ> B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inc_def:
  assumes "a \<in> carrier Z\<^sub>p"
  shows "\<iota> a = frac a \<one>\<^bsub>Z\<^sub>p\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<iota> a = fraction Z\<^sub>p a \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
using assms inc_equation[of a] \<iota>_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Z\<^sub>p
a \<in> carrier Z\<^sub>p \<Longrightarrow> Frac_inc Z\<^sub>p a = fraction Z\<^sub>p a \<one>\<^bsub>Z\<^sub>p\<^esub>
\<iota> \<equiv> Frac_inc Z\<^sub>p

goal (1 subgoal):
 1. \<iota> a = fraction Z\<^sub>p a \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
by auto


[STATEMENT]
lemma permutation_edge_succ: "permutation (edge_succ M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutation (edge_succ M)
[PROOF STEP]
by (metis edge_succ_permutes finite_arcs permutation_permutes)


[STATEMENT]
lemma height_Leaf: "height t = 0 \<longleftrightarrow> t = Leaf"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (height t = 0) = (t = Leaf)
[PROOF STEP]
by (induction t) (auto)


[STATEMENT]
lemma scan_length[simp]: "length (scan f xs a) = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (scan f xs a) = length xs
[PROOF STEP]
by (induct xs arbitrary: a) (auto)


[STATEMENT]
lemma (in valid_unMultigraph) is_trail_split':"is_trail v (p1@(u,w,u')#p2) v'
    \<Longrightarrow> is_trail v p1 u \<and> (u,w,u')\<in>E \<and> is_trail u' p2 v'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_trail v (p1 @ (u, w, u') # p2) v' \<Longrightarrow> is_trail v p1 u \<and> (u, w, u') \<in> E \<and> is_trail u' p2 v'
[PROOF STEP]
by (metis is_trail.simps(2) is_trail_split)


[STATEMENT]
lemma dg_Set_ArrVal_vdomain[dg_Set_cs_simps, dg_cs_simps]:
  assumes "T : A \<mapsto>\<^bsub>dg_Set \<alpha>\<^esub> B"
  shows "\<D>\<^sub>\<circ> (T\<lparr>ArrVal\<rparr>) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (T\<lparr>ArrVal\<rparr>) = A
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (T\<lparr>ArrVal\<rparr>) = A
[PROOF STEP]
interpret T: arr_Set \<alpha> T
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr_Set \<alpha> T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
T : A \<mapsto>\<^bsub>dg_Set \<alpha>\<^esub> B

goal (1 subgoal):
 1. arr_Set \<alpha> T
[PROOF STEP]
by (auto simp: dg_Set_is_arrD)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (T\<lparr>ArrVal\<rparr>) = A
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
T : A \<mapsto>\<^bsub>dg_Set \<alpha>\<^esub> B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
T : A \<mapsto>\<^bsub>dg_Set \<alpha>\<^esub> B

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (T\<lparr>ArrVal\<rparr>) = A
[PROOF STEP]
by (auto simp: dg_Set_is_arrD dg_Set_cs_simps)
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> (T\<lparr>ArrVal\<rparr>) = A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Scons_inject:
    "[| Scons M N = Scons M' N';  [| M=M';  N=N' |] ==> P |] ==> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Scons M N = Scons M' N'; \<lbrakk>M = M'; N = N'\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by (iprover dest: Scons_inject1 Scons_inject2)


[STATEMENT]
lemma in_set_lookup_inserts_tries:
  "(v \<in> set(lookup_tries (inserts_tries key vs t) (key v))) =
   (v \<in> set vs \<union> set(lookup_tries t (key v)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v \<in> set (lookup_tries (inserts_tries key vs t) (key v))) = (v \<in> set vs \<union> set (lookup_tries t (key v)))
[PROOF STEP]
by(induct vs arbitrary: t)
  (auto simp add: inserts_tries_def set_lookup_insert_tries)


[STATEMENT]
lemma iso_comp:
  assumes "ChamberComplexIsomorphism Y Z g"
  shows   "ChamberComplexIsomorphism X Z (g\<circ>f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ChamberComplexIsomorphism X Z (g \<circ> f)
[PROOF STEP]
by      (
            rule ChamberComplexIsomorphism.intro, rule comp,
            rule ChamberComplexIsomorphism.axioms(1),
            rule assms, unfold_locales, rule bij_betw_trans,
            rule bij_betw_vertices,
            rule ChamberComplexIsomorphism.bij_betw_vertices,
            rule assms
          )
          (simp add:
            setsetmapim_comp surj_simplex_map assms
            ChamberComplexIsomorphism.surj_simplex_map
          )


[STATEMENT]
lemma pderiv_diff: "pderiv ((p :: _ :: idom poly) - q) = pderiv p - pderiv q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (p - q) = pderiv p - pderiv q
[PROOF STEP]
by (rule poly_eqI) (simp add: coeff_pderiv algebra_simps)


[STATEMENT]
lemma sin_0_iff_canon:
  assumes "sin \<phi> = 0" and "-pi < \<phi>" and "\<phi> \<le> pi"
  shows "\<phi> = 0 \<or> \<phi> = pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> = 0 \<or> \<phi> = pi
[PROOF STEP]
using assms sin_eq_0_pi
[PROOF STATE]
proof (prove)
using this:
sin \<phi> = 0
- pi < \<phi>
\<phi> \<le> pi
\<lbrakk>- pi < ?x; ?x < pi; sin ?x = 0\<rbrakk> \<Longrightarrow> ?x = 0

goal (1 subgoal):
 1. \<phi> = 0 \<or> \<phi> = pi
[PROOF STEP]
by force


[STATEMENT]
lemma bigo_bounded: "\<forall>x. 0 \<le> f x \<Longrightarrow> \<forall>x. f x \<le> g x \<Longrightarrow> f \<in> O(g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. f x \<le> g x\<rbrakk> \<Longrightarrow> f \<in> O(g)
[PROOF STEP]
apply (erule bigo_bounded_alt [of f 1 g])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. f x \<le> g x \<Longrightarrow> \<forall>x. f x \<le> (1::'b) * g x
[PROOF STEP]
by (metis mult_1)


[STATEMENT]
lemma partition_rev_filter_conv :
  "partition_rev P (yes, no) xs = (rev (filter P xs) @ yes,  rev (filter (Not \<circ> P) xs) @ no)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_rev P (yes, no) xs = (rev (filter P xs) @ yes, rev (filter (Not \<circ> P) xs) @ no)
[PROOF STEP]
by (induct xs arbitrary: yes no) (simp_all)


[STATEMENT]
lemma lm002:
  assumes "finite G"
  shows "all_partitions G  =  set ` (set (all_partitions_alg G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_partitions G = set ` set (all_partitions_alg G)
[PROOF STEP]
using assms sortingSameSet all_partitions_alg_def all_partitions_paper_equiv_alg
        distinct_sorted_list_of_set image_set
[PROOF STATE]
proof (prove)
using this:
finite G
finite ?X \<Longrightarrow> set (sorted_list_of_set ?X) = ?X
all_partitions_alg ?X = all_partitions_list (sorted_list_of_set ?X)
distinct ?xs \<Longrightarrow> set (map set (all_partitions_list ?xs)) = all_partitions (set ?xs)
distinct (sorted_list_of_set ?A)
?f ` set ?xs = set (map ?f ?xs)

goal (1 subgoal):
 1. all_partitions G = set ` set (all_partitions_alg G)
[PROOF STEP]
by metis


[STATEMENT]
lemma le_fbox_choice_iff: "P \<le> |(\<lambda>s. F s \<union> G s)] Q \<longleftrightarrow> P \<le> |F] Q \<and> P \<le> |G] Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<le> |(\<lambda>s. F s \<union> G s)] Q) = (P \<le> |F] Q \<and> P \<le> |G] Q)
[PROOF STEP]
unfolding fbox_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<le> (\<lambda>s. \<forall>s'. s' \<in> F s \<union> G s \<longrightarrow> Q s')) = (P \<le> (\<lambda>s. \<forall>s'. s' \<in> F s \<longrightarrow> Q s') \<and> P \<le> (\<lambda>s. \<forall>s'. s' \<in> G s \<longrightarrow> Q s'))
[PROOF STEP]
by auto

\<comment> \<open> Sequential composition \<close>


[STATEMENT]
lemma shows "(simplicial_complex_induced_by_monotone_boolean_function n) \<in>
          boolean_functions.monotone_bool_fun_set n
          \<rightarrow> (simplicial_complex_set::nat set set set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function n \<in> boolean_functions.monotone_bool_fun_set n \<rightarrow> simplicial_complex_set
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> boolean_functions.monotone_bool_fun_set n \<Longrightarrow> simplicial_complex_induced_by_monotone_boolean_function n x \<in> simplicial_complex_set
[PROOF STEP]
fix x::"bool vec \<Rightarrow> bool"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> boolean_functions.monotone_bool_fun_set n \<Longrightarrow> simplicial_complex_induced_by_monotone_boolean_function n x \<in> simplicial_complex_set
[PROOF STEP]
assume x: "x \<in> boolean_functions.monotone_bool_fun_set n"
[PROOF STATE]
proof (state)
this:
x \<in> boolean_functions.monotone_bool_fun_set n

goal (1 subgoal):
 1. \<And>x. x \<in> boolean_functions.monotone_bool_fun_set n \<Longrightarrow> simplicial_complex_induced_by_monotone_boolean_function n x \<in> simplicial_complex_set
[PROOF STEP]
show "simplicial_complex_induced_by_monotone_boolean_function n x \<in> simplicial_complex_set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function n x \<in> simplicial_complex_set
[PROOF STEP]
using monotone_bool_fun_induces_simplicial_complex [of x] x
[PROOF STATE]
proof (prove)
using this:
boolean_functions.monotone_bool_fun n x \<Longrightarrow> simplicial_complex (simplicial_complex_induced_by_monotone_boolean_function n x)
x \<in> boolean_functions.monotone_bool_fun_set n

goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function n x \<in> simplicial_complex_set
[PROOF STEP]
unfolding boolean_functions.monotone_bool_fun_set_def
[PROOF STATE]
proof (prove)
using this:
boolean_functions.monotone_bool_fun n x \<Longrightarrow> simplicial_complex (simplicial_complex_induced_by_monotone_boolean_function n x)
x \<in> Collect (boolean_functions.monotone_bool_fun n)

goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function n x \<in> simplicial_complex_set
[PROOF STEP]
unfolding boolean_functions.monotone_bool_fun_def simplicial_complex_set_def
[PROOF STATE]
proof (prove)
using this:
mono_on (carrier_vec n) x \<Longrightarrow> simplicial_complex (simplicial_complex_induced_by_monotone_boolean_function n x)
x \<in> Collect (mono_on (carrier_vec n))

goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function n x \<in> Collect simplicial_complex
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
simplicial_complex_induced_by_monotone_boolean_function n x \<in> simplicial_complex_set

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_of_rpo_constraint_of_cnf:
  assumes "rpo_constraint_of_cnf cnf = (s,t)"
  and "size_cnf cnf = n"
  shows "term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
obtain as bs S NS where mp: "multiset_problem_of_cnf cnf = (as, bs, S, NS)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>as bs S NS. multiset_problem_of_cnf cnf = (as, bs, S, NS) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "multiset_problem_of_cnf cnf", auto)
[PROOF STATE]
proof (state)
this:
multiset_problem_of_cnf cnf = (as, bs, S, NS)

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
from size_of_multiset_problem_of_cnf[OF mp assms(2)]
[PROOF STATE]
proof (chain)
picking this:
length as \<le> 2 * n
length bs \<le> 2 * n
length S \<le> n
length NS \<le> 3 * n
[PROOF STEP]
have las: "length as \<le> 2 * n" "length bs \<le> 2 * n"
[PROOF STATE]
proof (prove)
using this:
length as \<le> 2 * n
length bs \<le> 2 * n
length S \<le> n
length NS \<le> 3 * n

goal (1 subgoal):
 1. length as \<le> 2 * n &&& length bs \<le> 2 * n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length as \<le> 2 * n
length bs \<le> 2 * n

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
have tl: "term_lists_of_cnf cnf = (map (ms_elem_to_term cnf) as, map (ms_elem_to_term cnf) bs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. term_lists_of_cnf cnf = (map (ms_elem_to_term cnf) as, map (ms_elem_to_term cnf) bs)
[PROOF STEP]
unfolding term_lists_of_cnf_def mp split
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map (ms_elem_to_term cnf) as, map (ms_elem_to_term cnf) bs) = (map (ms_elem_to_term cnf) as, map (ms_elem_to_term cnf) bs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
term_lists_of_cnf cnf = (map (ms_elem_to_term cnf) as, map (ms_elem_to_term cnf) bs)

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
from assms(1)[unfolded rpo_constraint_of_cnf_def tl split]
[PROOF STATE]
proof (chain)
picking this:
(Fun G (map (ms_elem_to_term cnf) as), Fun H (map (ms_elem_to_term cnf) bs)) = (s, t)
[PROOF STEP]
have st: "s = Fun G (map (ms_elem_to_term cnf) as)" "t = Fun H (map (ms_elem_to_term cnf) bs)"
[PROOF STATE]
proof (prove)
using this:
(Fun G (map (ms_elem_to_term cnf) as), Fun H (map (ms_elem_to_term cnf) bs)) = (s, t)

goal (1 subgoal):
 1. s = Fun G (map (ms_elem_to_term cnf) as) &&& t = Fun H (map (ms_elem_to_term cnf) bs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
s = Fun G (map (ms_elem_to_term cnf) as)
t = Fun H (map (ms_elem_to_term cnf) bs)

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
have [simp]: "term_size (if b then Var (Inr x) :: (FSyms, 'a + nat) Term.term else Fun A []) = 1" for b x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. term_size (if b then Var (Inr x) else Fun A []) = 1
[PROOF STEP]
by (cases b, auto)
[PROOF STATE]
proof (state)
this:
term_size (if ?b then Var (Inr ?x) else Fun A []) = 1

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
have len_n: "length cnf \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length cnf \<le> n
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
size_cnf cnf = n

goal (1 subgoal):
 1. length cnf \<le> n
[PROOF STEP]
unfolding size_cnf_def
[PROOF STATE]
proof (prove)
using this:
sum_list (map length cnf) + length cnf = n

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

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
have "term_size (ms_elem_to_term cnf a) \<le> 3 + length cnf" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. term_size (ms_elem_to_term cnf a) \<le> 3 + length cnf
[PROOF STEP]
by (cases "(cnf,a)" rule: ms_elem_to_term.cases, auto simp: o_def sum_list_triv)
[PROOF STATE]
proof (state)
this:
term_size (ms_elem_to_term cnf ?a) \<le> 3 + length cnf

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
term_size (ms_elem_to_term cnf ?a) \<le> 3 + length cnf

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
have "\<dots> \<le> 3 + n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 + length cnf \<le> 3 + n
[PROOF STEP]
using len_n
[PROOF STATE]
proof (prove)
using this:
length cnf \<le> n

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

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
term_size (ms_elem_to_term cnf ?a1) \<le> 3 + n
[PROOF STEP]
have size_ms: "term_size (ms_elem_to_term cnf a) \<le> 3 + n" for a
[PROOF STATE]
proof (prove)
using this:
term_size (ms_elem_to_term cnf ?a1) \<le> 3 + n

goal (1 subgoal):
 1. term_size (ms_elem_to_term cnf a) \<le> 3 + n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
term_size (ms_elem_to_term cnf ?a) \<le> 3 + n

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
term_size (ms_elem_to_term cnf ?a) \<le> 3 + n

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
assume "u \<in> {s,t}"
[PROOF STATE]
proof (state)
this:
u \<in> {s, t}

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<in> {s, t}
[PROOF STEP]
obtain G cs where "cs \<in> {as, bs}" and u: "u = Fun G (map (ms_elem_to_term cnf) cs)"
[PROOF STATE]
proof (prove)
using this:
u \<in> {s, t}

goal (1 subgoal):
 1. (\<And>cs G. \<lbrakk>cs \<in> {as, bs}; u = Fun G (map (ms_elem_to_term cnf) cs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding st
[PROOF STATE]
proof (prove)
using this:
u \<in> {Fun G (map (ms_elem_to_term cnf) as), Fun H (map (ms_elem_to_term cnf) bs)}

goal (1 subgoal):
 1. (\<And>cs G. \<lbrakk>cs \<in> {as, bs}; u = Fun G (map (ms_elem_to_term cnf) cs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cs \<in> {as, bs}
u = Fun G (map (ms_elem_to_term cnf) cs)

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
hence lcs: "length cs \<le> 2 * n"
[PROOF STATE]
proof (prove)
using this:
cs \<in> {as, bs}
u = Fun G (map (ms_elem_to_term cnf) cs)

goal (1 subgoal):
 1. length cs \<le> 2 * n
[PROOF STEP]
using las
[PROOF STATE]
proof (prove)
using this:
cs \<in> {as, bs}
u = Fun G (map (ms_elem_to_term cnf) cs)
length as \<le> 2 * n
length bs \<le> 2 * n

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

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
have "term_size u = 1 + (\<Sum>x\<leftarrow>cs. term_size (ms_elem_to_term cnf x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. term_size u = 1 + (\<Sum>x\<leftarrow>cs. term_size (ms_elem_to_term cnf x))
[PROOF STEP]
unfolding u
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. term_size (Fun G (map (ms_elem_to_term cnf) cs)) = 1 + (\<Sum>x\<leftarrow>cs. term_size (ms_elem_to_term cnf x))
[PROOF STEP]
by (simp add: o_def size_list_conv_sum_list)
[PROOF STATE]
proof (state)
this:
term_size u = 1 + (\<Sum>x\<leftarrow>cs. term_size (ms_elem_to_term cnf x))

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
term_size u = 1 + (\<Sum>x\<leftarrow>cs. term_size (ms_elem_to_term cnf x))

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
have "\<dots> \<le> 1 + (\<Sum>x\<leftarrow>cs. 3 + n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + (\<Sum>x\<leftarrow>cs. term_size (ms_elem_to_term cnf x)) \<le> 1 + (\<Sum>x\<leftarrow>cs. 3 + n)
[PROOF STEP]
by (intro add_mono lcs le_refl sum_list_mono size_ms)
[PROOF STATE]
proof (state)
this:
1 + (\<Sum>x\<leftarrow>cs. term_size (ms_elem_to_term cnf x)) \<le> 1 + (\<Sum>x\<leftarrow>cs. 3 + n)

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 + (\<Sum>x\<leftarrow>cs. term_size (ms_elem_to_term cnf x)) \<le> 1 + (\<Sum>x\<leftarrow>cs. 3 + n)

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
have "\<dots> \<le> 1 + (2 * n) * (3 + n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + (\<Sum>x\<leftarrow>cs. 3 + n) \<le> 1 + 2 * n * (3 + n)
[PROOF STEP]
unfolding sum_list_triv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + of_nat (length cs) * (3 + n) \<le> 1 + 2 * n * (3 + n)
[PROOF STEP]
by (intro add_mono le_refl mult_mono, insert lcs, auto)
[PROOF STATE]
proof (state)
this:
1 + (\<Sum>x\<leftarrow>cs. 3 + n) \<le> 1 + 2 * n * (3 + n)

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 + (\<Sum>x\<leftarrow>cs. 3 + n) \<le> 1 + 2 * n * (3 + n)

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
have "\<dots> = 2 * n^2 + 6 * n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + 2 * n * (3 + n) = 2 * n\<^sup>2 + 6 * n + 1
[PROOF STEP]
by (simp add: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
1 + 2 * n * (3 + n) = 2 * n\<^sup>2 + 6 * n + 1

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
term_size u \<le> 2 * n\<^sup>2 + 6 * n + 1
[PROOF STEP]
have "term_size u \<le> 2 * n\<^sup>2 + 6 * n + 1"
[PROOF STATE]
proof (prove)
using this:
term_size u \<le> 2 * n\<^sup>2 + 6 * n + 1

goal (1 subgoal):
 1. term_size u \<le> 2 * n\<^sup>2 + 6 * n + 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
term_size u \<le> 2 * n\<^sup>2 + 6 * n + 1

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?u2 \<in> {s, t} \<Longrightarrow> term_size ?u2 \<le> 2 * n\<^sup>2 + 6 * n + 1

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
from this[of s] this[of t]
[PROOF STATE]
proof (chain)
picking this:
s \<in> {s, t} \<Longrightarrow> term_size s \<le> 2 * n\<^sup>2 + 6 * n + 1
t \<in> {s, t} \<Longrightarrow> term_size t \<le> 2 * n\<^sup>2 + 6 * n + 1
[PROOF STEP]
show "term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2"
[PROOF STATE]
proof (prove)
using this:
s \<in> {s, t} \<Longrightarrow> term_size s \<le> 2 * n\<^sup>2 + 6 * n + 1
t \<in> {s, t} \<Longrightarrow> term_size t \<le> 2 * n\<^sup>2 + 6 * n + 1

goal (1 subgoal):
 1. term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
term_size s + term_size t \<le> 4 * n\<^sup>2 + 12 * n + 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem integer_partitions_enum_distinct:
  "distinct (integer_partitions_enum n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (integer_partitions_enum n)
[PROOF STEP]
using integer_partitions_enum_aux_distinct
[PROOF STATE]
proof (prove)
using this:
distinct (integer_partitions_enum_aux ?n ?m)

goal (1 subgoal):
 1. distinct (integer_partitions_enum n)
[PROOF STEP]
by simp


[STATEMENT]
lemma conv_radius_cong:
  assumes "eventually (\<lambda>x. norm (f x) = norm (g x)) sequentially"
  shows   "conv_radius f = conv_radius g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius f = conv_radius g
[PROOF STEP]
unfolding conv_radius_altdef
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>n. inverse (ereal (root n (norm (f n))))) = liminf (\<lambda>n. inverse (ereal (root n (norm (g n)))))
[PROOF STEP]
by (intro Liminf_eq eventually_mono [OF assms]) auto


[STATEMENT]
lemma mult_inj_if_coprime_nat:
  "inj_on f A \<Longrightarrow> inj_on g B \<Longrightarrow> (\<And>a b. \<lbrakk>a\<in>A; b\<in>B\<rbrakk> \<Longrightarrow> coprime (f a) (g b)) \<Longrightarrow>
    inj_on (\<lambda>(a, b). f a * g b) (A \<times> B)"
  for f :: "'a \<Rightarrow> nat" and g :: "'b \<Rightarrow> nat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f A; inj_on g B; \<And>a b. \<lbrakk>a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> coprime (f a) (g b)\<rbrakk> \<Longrightarrow> inj_on (\<lambda>(a, b). f a * g b) (A \<times> B)
[PROOF STEP]
by (auto simp: inj_on_def coprime_crossproduct_nat simp del: One_nat_def)


[STATEMENT]
lemma Carmichael_mult_coprime:
  assumes "coprime m n"
  shows   "Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
proof (cases "m \<le> 1 \<or> n \<le> 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m \<le> 1 \<or> n \<le> 1 \<Longrightarrow> Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
 2. \<not> (m \<le> 1 \<or> n \<le> 1) \<Longrightarrow> Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
m \<le> 1 \<or> n \<le> 1

goal (2 subgoals):
 1. m \<le> 1 \<or> n \<le> 1 \<Longrightarrow> Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
 2. \<not> (m \<le> 1 \<or> n \<le> 1) \<Longrightarrow> Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
hence "m = 0 \<or> n = 0 \<or> m = 1 \<or> n = 1"
[PROOF STATE]
proof (prove)
using this:
m \<le> 1 \<or> n \<le> 1

goal (1 subgoal):
 1. m = 0 \<or> n = 0 \<or> m = 1 \<or> n = 1
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
m = 0 \<or> n = 0 \<or> m = 1 \<or> n = 1

goal (2 subgoals):
 1. m \<le> 1 \<or> n \<le> 1 \<Longrightarrow> Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
 2. \<not> (m \<le> 1 \<or> n \<le> 1) \<Longrightarrow> Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
m = 0 \<or> n = 0 \<or> m = 1 \<or> n = 1

goal (1 subgoal):
 1. Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m = 0 \<or> n = 0 \<or> m = 1 \<or> n = 1
coprime m n

goal (1 subgoal):
 1. Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)

goal (1 subgoal):
 1. \<not> (m \<le> 1 \<or> n \<le> 1) \<Longrightarrow> Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (m \<le> 1 \<or> n \<le> 1) \<Longrightarrow> Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (m \<le> 1 \<or> n \<le> 1)

goal (1 subgoal):
 1. \<not> (m \<le> 1 \<or> n \<le> 1) \<Longrightarrow> Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
proof (rule dvd_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Carmichael (m * n) dvd lcm (Carmichael m) (Carmichael n)
 2. lcm (Carmichael m) (Carmichael n) dvd Carmichael (m * n)
[PROOF STEP]
show "Carmichael (m * n) dvd lcm (Carmichael m) (Carmichael n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Carmichael (m * n) dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
unfolding Carmichael_def[of "m * n"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lcm (ord (m * n) ` totatives (m * n)) dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
proof (intro Lcm_least, safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b x. x \<in> totatives (m * n) \<Longrightarrow> ord (m * n) x dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b x. x \<in> totatives (m * n) \<Longrightarrow> ord (m * n) x dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
assume x: "x \<in> totatives (m * n)"
[PROOF STATE]
proof (state)
this:
x \<in> totatives (m * n)

goal (1 subgoal):
 1. \<And>b x. x \<in> totatives (m * n) \<Longrightarrow> ord (m * n) x dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
have "ord (m * n) x = lcm (ord m x) (ord n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord (m * n) x = lcm (ord m x) (ord n x)
[PROOF STEP]
using assms x
[PROOF STATE]
proof (prove)
using this:
coprime m n
x \<in> totatives (m * n)

goal (1 subgoal):
 1. ord (m * n) x = lcm (ord m x) (ord n x)
[PROOF STEP]
by (subst ord_modulus_mult_coprime) (auto simp: coprime_commute totatives_def)
[PROOF STATE]
proof (state)
this:
ord (m * n) x = lcm (ord m x) (ord n x)

goal (1 subgoal):
 1. \<And>b x. x \<in> totatives (m * n) \<Longrightarrow> ord (m * n) x dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ord (m * n) x = lcm (ord m x) (ord n x)

goal (1 subgoal):
 1. \<And>b x. x \<in> totatives (m * n) \<Longrightarrow> ord (m * n) x dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
have "\<dots> dvd lcm (Carmichael m) (Carmichael n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm (ord m x) (ord n x) dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
using False x
[PROOF STATE]
proof (prove)
using this:
\<not> (m \<le> 1 \<or> n \<le> 1)
x \<in> totatives (m * n)

goal (1 subgoal):
 1. lcm (ord m x) (ord n x) dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
by (intro lcm_mono ord_dvd_Carmichael) (auto simp: totatives_def coprime_commute)
[PROOF STATE]
proof (state)
this:
lcm (ord m x) (ord n x) dvd lcm (Carmichael m) (Carmichael n)

goal (1 subgoal):
 1. \<And>b x. x \<in> totatives (m * n) \<Longrightarrow> ord (m * n) x dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ord (m * n) x dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
show "ord (m * n) x dvd \<dots>"
[PROOF STATE]
proof (prove)
using this:
ord (m * n) x dvd lcm (Carmichael m) (Carmichael n)

goal (1 subgoal):
 1. ord (m * n) x dvd lcm (Carmichael m) (Carmichael n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ord (m * n) x dvd lcm (Carmichael m) (Carmichael n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Carmichael (m * n) dvd lcm (Carmichael m) (Carmichael n)

goal (1 subgoal):
 1. lcm (Carmichael m) (Carmichael n) dvd Carmichael (m * n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lcm (Carmichael m) (Carmichael n) dvd Carmichael (m * n)
[PROOF STEP]
show "lcm (Carmichael m) (Carmichael n) dvd Carmichael (m * n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm (Carmichael m) (Carmichael n) dvd Carmichael (m * n)
[PROOF STEP]
using Carmichael_dvd_mono_coprime[of m n]
            Carmichael_dvd_mono_coprime[of n m] assms False
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>coprime m n; 1 < m; 1 < n\<rbrakk> \<Longrightarrow> Carmichael m dvd Carmichael (m * n)
\<lbrakk>coprime n m; 1 < n; 1 < m\<rbrakk> \<Longrightarrow> Carmichael n dvd Carmichael (n * m)
coprime m n
\<not> (m \<le> 1 \<or> n \<le> 1)

goal (1 subgoal):
 1. lcm (Carmichael m) (Carmichael n) dvd Carmichael (m * n)
[PROOF STEP]
by (auto intro!: lcm_least simp: coprime_commute mult.commute)
[PROOF STATE]
proof (state)
this:
lcm (Carmichael m) (Carmichael n) dvd Carmichael (m * n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Carmichael (m * n) = lcm (Carmichael m) (Carmichael n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LeftDerivation_breakdown': "LeftDerivation (u @ v) D w \<Longrightarrow>
  \<exists>n w1 w2.
    n \<le> length D \<and>
    w = w1 @ w2 \<and>
    LeftDerivation u (take n D) w1 \<and>
    derivation_ge (drop n D) (length w1) \<and>
    LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LeftDerivation (u @ v) D w \<Longrightarrow> \<exists>n w1 w2. n \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LeftDerivation (u @ v) D w \<Longrightarrow> \<exists>n w1 w2. n \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2
[PROOF STEP]
assume hyp: "LeftDerivation (u @ v) D w"
[PROOF STATE]
proof (state)
this:
LeftDerivation (u @ v) D w

goal (1 subgoal):
 1. LeftDerivation (u @ v) D w \<Longrightarrow> \<exists>n w1 w2. n \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2
[PROOF STEP]
from LeftDerivation_breakdown[OF hyp]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n w1 w2. w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2
[PROOF STEP]
obtain n w1 w2 where breakdown:
   "w = w1 @ w2 \<and>
    LeftDerivation u (take n D) w1 \<and>
    derivation_ge (drop n D) (length w1) \<and>
    LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2"
[PROOF STATE]
proof (prove)
using this:
\<exists>n w1 w2. w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2

goal (1 subgoal):
 1. (\<And>w1 w2 n. w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2

goal (1 subgoal):
 1. LeftDerivation (u @ v) D w \<Longrightarrow> \<exists>n w1 w2. n \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2
[PROOF STEP]
obtain m where m: "m = min (length D) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m. m = min (length D) n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m = min (length D) n

goal (1 subgoal):
 1. LeftDerivation (u @ v) D w \<Longrightarrow> \<exists>n w1 w2. n \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2
[PROOF STEP]
have take_m: "take m D = take n D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take m D = take n D
[PROOF STEP]
using m is_prefix_take take_prefix
[PROOF STATE]
proof (prove)
using this:
m = min (length D) n
is_prefix (take ?n ?a) ?a
is_prefix ?a ?b \<Longrightarrow> take (length ?a) ?b = ?a

goal (1 subgoal):
 1. take m D = take n D
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
take m D = take n D

goal (1 subgoal):
 1. LeftDerivation (u @ v) D w \<Longrightarrow> \<exists>n w1 w2. n \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2
[PROOF STEP]
have drop_m: "drop m D = drop n D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop m D = drop n D
[PROOF STEP]
by (metis append_eq_conv_conj append_take_drop_id length_take m)
[PROOF STATE]
proof (state)
this:
drop m D = drop n D

goal (1 subgoal):
 1. LeftDerivation (u @ v) D w \<Longrightarrow> \<exists>n w1 w2. n \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2
[PROOF STEP]
have m_bound: "m \<le> length D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> length D
[PROOF STEP]
by (simp add: m)
[PROOF STATE]
proof (state)
this:
m \<le> length D

goal (1 subgoal):
 1. LeftDerivation (u @ v) D w \<Longrightarrow> \<exists>n w1 w2. n \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n w1 w2. n \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2
[PROOF STEP]
apply (rule_tac x="m" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w1 w2. m \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take m D) w1 \<and> derivation_ge (drop m D) (length w1) \<and> LeftDerivation v (derivation_shift (drop m D) (length w1) 0) w2
[PROOF STEP]
apply (rule_tac x="w1" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w2. m \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take m D) w1 \<and> derivation_ge (drop m D) (length w1) \<and> LeftDerivation v (derivation_shift (drop m D) (length w1) 0) w2
[PROOF STEP]
apply (rule_tac x="w2" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take m D) w1 \<and> derivation_ge (drop m D) (length w1) \<and> LeftDerivation v (derivation_shift (drop m D) (length w1) 0) w2
[PROOF STEP]
using breakdown m_bound take_m drop_m
[PROOF STATE]
proof (prove)
using this:
w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2
m \<le> length D
take m D = take n D
drop m D = drop n D

goal (1 subgoal):
 1. m \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take m D) w1 \<and> derivation_ge (drop m D) (length w1) \<and> LeftDerivation v (derivation_shift (drop m D) (length w1) 0) w2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>n w1 w2. n \<le> length D \<and> w = w1 @ w2 \<and> LeftDerivation u (take n D) w1 \<and> derivation_ge (drop n D) (length w1) \<and> LeftDerivation v (derivation_shift (drop n D) (length w1) 0) w2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_dual_inv1: "map_dual \<circ> map_dual_inv = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_dual \<circ> map_dual_inv = id
[PROOF STEP]
unfolding fun_eq_iff map_dual_def_var map_dual_inv_def comp_def id_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x xa. \<partial> (\<partial>\<^sup>- (x (\<partial> (\<partial>\<^sup>- xa)))) = x xa
[PROOF STEP]
by (metis dual_iff)


[STATEMENT]
lemma Iff_E:
  "insert A (insert B H) \<turnstile> C \<Longrightarrow> insert (Neg A) (insert (Neg B) H) \<turnstile> C \<Longrightarrow> insert (A IFF B) H \<turnstile> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>insert A (insert B H) \<turnstile> C; insert (Neg A) (insert (Neg B) H) \<turnstile> C\<rbrakk> \<Longrightarrow> insert (A IFF B) H \<turnstile> C
[PROOF STEP]
apply (auto simp: Iff_def insert_commute)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>insert A (insert B H) \<turnstile> C; insert (Neg A) (insert (Neg B) H) \<turnstile> C\<rbrakk> \<Longrightarrow> insert B (insert (Neg B) H) \<turnstile> C
 2. \<lbrakk>insert A (insert B H) \<turnstile> C; insert (Neg A) (insert (Neg B) H) \<turnstile> C\<rbrakk> \<Longrightarrow> insert A (insert (Neg A) H) \<turnstile> C
[PROOF STEP]
apply (metis Disj_I1 Hyp anti_deduction insertCI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>insert A (insert B H) \<turnstile> C; insert (Neg A) (insert (Neg B) H) \<turnstile> C\<rbrakk> \<Longrightarrow> insert A (insert (Neg A) H) \<turnstile> C
[PROOF STEP]
apply (metis Assume Disj_I1 anti_deduction)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma delpred_mon:
  "\<forall>(a:: ('e, 'a::linorder) Prio) b. ((\<lambda> x. x \<le> y) a
    \<longrightarrow> (\<lambda> x. x \<le> y) (a + b)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a b. a \<le> y \<longrightarrow> a + b \<le> y
[PROOF STEP]
proof (intro impI allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. a \<le> y \<Longrightarrow> a + b \<le> y
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. a \<le> y \<Longrightarrow> a + b \<le> y
[PROOF STEP]
show "a \<le> y \<Longrightarrow> a + b \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> y \<Longrightarrow> a + b \<le> y
[PROOF STEP]
apply (induct a b rule: p_less.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>e a f b. Prio e a \<le> y \<Longrightarrow> Prio e a + Prio f b \<le> y
 2. \<And>e a. Prio e a \<le> y \<Longrightarrow> Prio e a + Infty \<le> y
 3. \<And>uu_. Infty \<le> y \<Longrightarrow> Infty + uu_ \<le> y
[PROOF STEP]
apply (auto simp add: plus_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>e a f b. \<lbrakk>Prio e a \<le> y; \<not> a \<le> b\<rbrakk> \<Longrightarrow> Prio f b \<le> y
 2. \<And>uu_. Infty \<le> y \<Longrightarrow> uu_ \<le> y
[PROOF STEP]
apply (metis linorder_linear order_trans
      p_linear p_min.simps(4) p_min_mon plus_def prio_selects_one)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>uu_. Infty \<le> y \<Longrightarrow> uu_ \<le> y
[PROOF STEP]
apply (metis order_trans p_linear p_min_mon p_min_re_neut plus_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
a \<le> y \<Longrightarrow> a + b \<le> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma t1_space_subtopology: "t1_space X \<Longrightarrow> t1_space(subtopology X U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t1_space X \<Longrightarrow> t1_space (subtopology X U)
[PROOF STEP]
by (simp add: derived_set_of_subtopology t1_space_derived_set_of_finite)


[STATEMENT]
lemma scaleC_of_complex[simp]: \<open>scaleC x (of_complex y) = of_complex (x * y)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>C of_complex y = of_complex (x * y)
[PROOF STEP]
unfolding of_complex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>C y *\<^sub>C (1::'a) = (x * y) *\<^sub>C (1::'a)
[PROOF STEP]
using scaleC_scaleC
[PROOF STATE]
proof (prove)
using this:
?a *\<^sub>C ?b *\<^sub>C ?x = (?a * ?b) *\<^sub>C ?x

goal (1 subgoal):
 1. x *\<^sub>C y *\<^sub>C (1::'a) = (x * y) *\<^sub>C (1::'a)
[PROOF STEP]
by blast


[STATEMENT]
lemma [code_post]:
  "Nat 0 = 0"
  "Nat 1 = 1"
  "Nat (numeral k) = numeral k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Code_Numeral.Nat 0 = 0 &&& Code_Numeral.Nat 1 = 1 &&& Code_Numeral.Nat (numeral k) = numeral k
[PROOF STEP]
by (transfer, simp)+


[STATEMENT]
lemma ordermap: "wf r \<Longrightarrow> ordermap A r a = set (ordermap A r ` {y \<in> A. (y,a) \<in> r})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf r \<Longrightarrow> ordermap A r a = set (ordermap A r ` {y \<in> A. (y, a) \<in> r})
[PROOF STEP]
unfolding ordermap_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf r \<Longrightarrow> wfrec r (\<lambda>f x. set (f ` {y \<in> A. (y, x) \<in> r})) a = set (wfrec r (\<lambda>f x. set (f ` {y \<in> A. (y, x) \<in> r})) ` {y \<in> A. (y, a) \<in> r})
[PROOF STEP]
by (auto simp: wfrec_fixpoint adm_wf_def)