[STATEMENT]
lemma proper_interval_set_Compl_aux:
  assumes fin: "finite (UNIV :: 'a set)"
  and xs: "sorted xs" "distinct xs"
  and ys: "sorted ys" "distinct ys"
  shows "proper_interval_set_Compl_aux None 0 xs ys \<longleftrightarrow> (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)
[PROOF STEP]
note [simp] = finite_subset[OF subset_UNIV fin]
[PROOF STATE]
proof (state)
this:
finite ?A

goal (1 subgoal):
 1. proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)
[PROOF STEP]
define above where "above = case_option UNIV (Collect \<circ> less)"
[PROOF STATE]
proof (state)
this:
above = case_option UNIV (Collect \<circ> (<))

goal (1 subgoal):
 1. proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)
[PROOF STEP]
have above_simps [simp]: "above None = UNIV" "\<And>x. above (Some x) = {y. x < y}"
    and above_upclosed: "\<And>x y ao. \<lbrakk> x \<in> above ao; x < y \<rbrakk> \<Longrightarrow> y \<in> above ao"
    and proper_interval_Some2: "\<And>x ao. proper_interval ao (Some x) \<longleftrightarrow> (\<exists>z\<in>above ao. z < x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (above None = UNIV &&& (\<And>x. above (Some x) = {y. x < y})) &&& (\<And>x y ao. \<lbrakk>x \<in> above ao; x < y\<rbrakk> \<Longrightarrow> y \<in> above ao) &&& (\<And>x ao. proper_interval ao (Some x) = (\<exists>z\<in>above ao. z < x))
[PROOF STEP]
by(simp_all add: proper_interval_simps above_def split: option.splits)
[PROOF STATE]
proof (state)
this:
above None = UNIV
above (Some ?x) = {y. ?x < y}
\<lbrakk>?x \<in> above ?ao; ?x < ?y\<rbrakk> \<Longrightarrow> ?y \<in> above ?ao
proper_interval ?ao (Some ?x) = (\<exists>z\<in>above ?ao. z < ?x)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
above None = UNIV
above (Some ?x) = {y. ?x < y}
\<lbrakk>?x \<in> above ?ao; ?x < ?y\<rbrakk> \<Longrightarrow> ?y \<in> above ?ao
proper_interval ?ao (Some ?x) = (\<exists>z\<in>above ?ao. z < ?x)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)
[PROOF STEP]
fix ao n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)
[PROOF STEP]
assume "set xs \<subseteq> above ao" "set ys \<subseteq> above ao"
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> above ao
set ys \<subseteq> above ao

goal (1 subgoal):
 1. proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)
[PROOF STEP]
from xs \<open>set xs \<subseteq> above ao\<close> ys \<open>set ys \<subseteq> above ao\<close>
[PROOF STATE]
proof (chain)
picking this:
sorted xs
distinct xs
set xs \<subseteq> above ao
sorted ys
distinct ys
set ys \<subseteq> above ao
[PROOF STEP]
have "proper_interval_set_Compl_aux ao (card (UNIV - above ao)) xs ys \<longleftrightarrow>
          (\<exists>A \<subseteq> above ao. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above ao)"
[PROOF STATE]
proof (prove)
using this:
sorted xs
distinct xs
set xs \<subseteq> above ao
sorted ys
distinct ys
set ys \<subseteq> above ao

goal (1 subgoal):
 1. proper_interval_set_Compl_aux ao (card (UNIV - above ao)) xs ys = (\<exists>A\<subseteq>above ao. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above ao)
[PROOF STEP]
proof(induct ao n\<equiv>"card (UNIV - above ao)" xs ys rule: proper_interval_set_Compl_aux.induct)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>ao. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] [] = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 3. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 4. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case (1 ao)
[PROOF STATE]
proof (state)
this:
sorted []
distinct []
set [] \<subseteq> above ao
sorted []
distinct []
set [] \<subseteq> above ao

goal (4 subgoals):
 1. \<And>ao. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] [] = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 3. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 4. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "card (UNIV - above ao) + 1 < CARD('a) \<longleftrightarrow> (\<exists>A \<subseteq> above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao)"
        (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card (UNIV - above ao) + 1 < CARD('a)) = (\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
card (UNIV - above ao) + 1 < CARD('a)

goal (2 subgoals):
 1. card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
hence "card (UNIV - (UNIV - above ao)) > 1"
[PROOF STATE]
proof (prove)
using this:
card (UNIV - above ao) + 1 < CARD('a)

goal (1 subgoal):
 1. 1 < card (UNIV - (UNIV - above ao))
[PROOF STEP]
by(simp add: card_Diff_subset)
[PROOF STATE]
proof (state)
this:
1 < card (UNIV - (UNIV - above ao))

goal (2 subgoals):
 1. card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
from card_gt_1D[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>x y. x \<in> UNIV - (UNIV - above ao) \<and> y \<in> UNIV - (UNIV - above ao) \<and> x \<noteq> y
[PROOF STEP]
obtain x y where above: "x \<in> above ao" "y \<in> above ao"
          and neq: "x \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
\<exists>x y. x \<in> UNIV - (UNIV - above ao) \<and> y \<in> UNIV - (UNIV - above ao) \<and> x \<noteq> y

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

goal (2 subgoals):
 1. card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
hence "{x} \<sqsubset>' {x, y} \<inter> above ao"
[PROOF STATE]
proof (prove)
using this:
x \<in> above ao
y \<in> above ao
x \<noteq> y

goal (1 subgoal):
 1. {x} \<sqsubset>' {x, y} \<inter> above ao
[PROOF STEP]
by(simp_all add: psubsetI psubset_finite_imp_set_less_aux)
[PROOF STATE]
proof (state)
this:
{x} \<sqsubset>' {x, y} \<inter> above ao

goal (2 subgoals):
 1. card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{x} \<sqsubset>' {x, y} \<inter> above ao

goal (2 subgoals):
 1. card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
have "\<dots> \<sqsubseteq>' above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x, y} \<inter> above ao \<sqsubseteq>' above ao
[PROOF STEP]
by(auto intro: subset_finite_imp_set_less_eq_aux)
[PROOF STATE]
proof (state)
this:
{x, y} \<inter> above ao \<sqsubseteq>' above ao

goal (2 subgoals):
 1. card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{x} \<sqsubset>' above ao
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
{x} \<sqsubset>' above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao
[PROOF STEP]
using above
[PROOF STATE]
proof (prove)
using this:
{x} \<sqsubset>' above ao
x \<in> above ao
y \<in> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao
[PROOF STEP]
obtain A where nempty: "A \<inter> above ao \<noteq> {}"
          and subset: "A \<subseteq> above ao"
          and less: "A \<sqsubset>' above ao"
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>A \<inter> above ao \<noteq> {}; A \<subseteq> above ao; A \<sqsubset>' above ao\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<inter> above ao \<noteq> {}
A \<subseteq> above ao
A \<sqsubset>' above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
from nempty
[PROOF STATE]
proof (chain)
picking this:
A \<inter> above ao \<noteq> {}
[PROOF STEP]
obtain x where x: "x \<in> A" "x \<in> above ao"
[PROOF STATE]
proof (prove)
using this:
A \<inter> above ao \<noteq> {}

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

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao \<Longrightarrow> card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (UNIV - above ao) + 1 < CARD('a)
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?lhs"
[PROOF STATE]
proof (state)
this:
\<not> card (UNIV - above ao) + 1 < CARD('a)

goal (1 subgoal):
 1. \<not> card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> card (UNIV - above ao) + 1 < CARD('a)

goal (1 subgoal):
 1. \<not> card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> False
[PROOF STEP]
have "CARD('a) \<ge> card (UNIV - above ao)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (UNIV - above ao) \<le> CARD('a)
[PROOF STEP]
by(rule card_mono) simp_all
[PROOF STATE]
proof (state)
this:
card (UNIV - above ao) \<le> CARD('a)

goal (1 subgoal):
 1. \<not> card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (UNIV - above ao) \<le> CARD('a)

goal (1 subgoal):
 1. \<not> card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> False
[PROOF STEP]
from card_Un_disjoint[of "UNIV - above ao" "above ao"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite (UNIV - above ao); finite (above ao); (UNIV - above ao) \<inter> above ao = {}\<rbrakk> \<Longrightarrow> card (UNIV - above ao \<union> above ao) = card (UNIV - above ao) + card (above ao)
[PROOF STEP]
have "CARD('a) = card (UNIV - above ao) + card (above ao)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (UNIV - above ao); finite (above ao); (UNIV - above ao) \<inter> above ao = {}\<rbrakk> \<Longrightarrow> card (UNIV - above ao \<union> above ao) = card (UNIV - above ao) + card (above ao)

goal (1 subgoal):
 1. CARD('a) = card (UNIV - above ao) + card (above ao)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
CARD('a) = card (UNIV - above ao) + card (above ao)

goal (1 subgoal):
 1. \<not> card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> card (UNIV - above ao) + 1 < CARD('a)
card (UNIV - above ao) \<le> CARD('a)
CARD('a) = card (UNIV - above ao) + card (above ao)
[PROOF STEP]
have "card (above ao) = 1"
[PROOF STATE]
proof (prove)
using this:
\<not> card (UNIV - above ao) + 1 < CARD('a)
card (UNIV - above ao) \<le> CARD('a)
CARD('a) = card (UNIV - above ao) + card (above ao)

goal (1 subgoal):
 1. card (above ao) = 1
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
\<not> card (UNIV - above ao) + 1 < CARD('a)
card (UNIV - above ao) \<le> CARD('a)
CARD('a) = card (UNIV - above ao) + card (above ao)
x \<in> A
x \<in> above ao

goal (1 subgoal):
 1. card (above ao) = 1
[PROOF STEP]
by(cases "card (above ao)")(auto simp add: not_less_eq less_Suc_eq_le)
[PROOF STATE]
proof (state)
this:
card (above ao) = 1

goal (1 subgoal):
 1. \<not> card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> False
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
x \<in> above ao
card (above ao) = 1
[PROOF STEP]
have "above ao = {x}"
[PROOF STATE]
proof (prove)
using this:
x \<in> A
x \<in> above ao
card (above ao) = 1

goal (1 subgoal):
 1. above ao = {x}
[PROOF STEP]
unfolding card_eq_1_iff
[PROOF STATE]
proof (prove)
using this:
x \<in> A
x \<in> above ao
\<exists>x. above ao = {x}

goal (1 subgoal):
 1. above ao = {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
above ao = {x}

goal (1 subgoal):
 1. \<not> card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
above ao = {x}

goal (1 subgoal):
 1. \<not> card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> False
[PROOF STEP]
with x subset
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
x \<in> above ao
A \<subseteq> above ao
above ao = {x}
[PROOF STEP]
have A: "A = {x}"
[PROOF STATE]
proof (prove)
using this:
x \<in> A
x \<in> above ao
A \<subseteq> above ao
above ao = {x}

goal (1 subgoal):
 1. A = {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = {x}

goal (1 subgoal):
 1. \<not> card (UNIV - above ao) + 1 < CARD('a) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
above ao = {x}
A = {x}
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
above ao = {x}
A = {x}

goal (1 subgoal):
 1. False
[PROOF STEP]
using less
[PROOF STATE]
proof (prove)
using this:
above ao = {x}
A = {x}
A \<sqsubset>' above ao

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (UNIV - above ao) + 1 < CARD('a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(card (UNIV - above ao) + 1 < CARD('a)) = (\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao)

goal (4 subgoals):
 1. \<And>ao. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] [] = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 3. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 4. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(card (UNIV - above ao) + 1 < CARD('a)) = (\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' above ao)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] [] = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] [] = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)

goal (3 subgoals):
 1. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 3. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 3. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case (2 ao y ys)
[PROOF STATE]
proof (state)
this:
sorted []
distinct []
set [] \<subseteq> above ao
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao

goal (3 subgoals):
 1. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 3. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
note ys = \<open>sorted (y # ys)\<close> \<open>distinct (y # ys)\<close> \<open>set (y # ys) \<subseteq> above ao\<close>
[PROOF STATE]
proof (state)
this:
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao

goal (3 subgoals):
 1. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 3. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have len_ys: "length ys = card (set ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ys = card (set ys)
[PROOF STEP]
using ys
[PROOF STATE]
proof (prove)
using this:
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. length ys = card (set ys)
[PROOF STEP]
by(auto simp add: List.card_set intro: sym)
[PROOF STATE]
proof (state)
this:
length ys = card (set ys)

goal (3 subgoals):
 1. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 3. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
define m where "m = CARD('a) - card (UNIV - above ao)"
[PROOF STATE]
proof (state)
this:
m = CARD('a) - card (UNIV - above ao)

goal (3 subgoals):
 1. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 3. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "CARD('a) = card (above ao) + card (UNIV - above ao)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a) = card (above ao) + card (UNIV - above ao)
[PROOF STEP]
using card_Un_disjoint[of "above ao" "UNIV - above ao"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (above ao); finite (UNIV - above ao); above ao \<inter> (UNIV - above ao) = {}\<rbrakk> \<Longrightarrow> card (above ao \<union> (UNIV - above ao)) = card (above ao) + card (UNIV - above ao)

goal (1 subgoal):
 1. CARD('a) = card (above ao) + card (UNIV - above ao)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
CARD('a) = card (above ao) + card (UNIV - above ao)

goal (3 subgoals):
 1. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 3. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
hence m_eq: "m = card (above ao)"
[PROOF STATE]
proof (prove)
using this:
CARD('a) = card (above ao) + card (UNIV - above ao)

goal (1 subgoal):
 1. m = card (above ao)
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
using this:
CARD('a) = card (above ao) + card (UNIV - above ao)

goal (1 subgoal):
 1. CARD('a) - card (UNIV - above ao) = card (above ao)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m = card (above ao)

goal (3 subgoals):
 1. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 3. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None) \<longleftrightarrow>
        (\<exists>A \<subseteq> above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)" (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)) = (\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)

goal (2 subgoals):
 1. m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
hence m: "m \<noteq> length ys + 1"
          and pi: "m = length ys + 2 \<Longrightarrow> \<not> proper_interval (Some (last (y # ys))) None"
[PROOF STATE]
proof (prove)
using this:
m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)

goal (1 subgoal):
 1. m \<noteq> length ys + 1 &&& (m = length ys + 2 \<Longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
m \<noteq> length ys + 1
m = length ys + 2 \<Longrightarrow> \<not> proper_interval (Some (last (y # ys))) None

goal (2 subgoals):
 1. m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
have "length ys + 1 = card (set (y # ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ys + 1 = card (set (y # ys))
[PROOF STEP]
using ys len_ys
[PROOF STATE]
proof (prove)
using this:
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao
length ys = card (set ys)

goal (1 subgoal):
 1. length ys + 1 = card (set (y # ys))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length ys + 1 = card (set (y # ys))

goal (2 subgoals):
 1. m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length ys + 1 = card (set (y # ys))

goal (2 subgoals):
 1. m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
have "\<dots> \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (y # ys)) \<le> m
[PROOF STEP]
unfolding m_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (y # ys)) \<le> card (above ao)
[PROOF STEP]
by(rule card_mono)(simp, rule ys)
[PROOF STATE]
proof (state)
this:
card (set (y # ys)) \<le> m

goal (2 subgoals):
 1. m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
length ys + 1 \<le> m
[PROOF STEP]
have "length ys + 2 \<le> m"
[PROOF STATE]
proof (prove)
using this:
length ys + 1 \<le> m

goal (1 subgoal):
 1. length ys + 2 \<le> m
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
length ys + 1 \<le> m
m \<noteq> length ys + 1

goal (1 subgoal):
 1. length ys + 2 \<le> m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length ys + 2 \<le> m

goal (2 subgoals):
 1. m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
proof(cases "m = length ys + 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
m = length ys + 2

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "card (UNIV - (UNIV - above ao) - set (y # ys)) = 1"
[PROOF STATE]
proof (prove)
using this:
m = length ys + 2

goal (1 subgoal):
 1. card (UNIV - (UNIV - above ao) - set (y # ys)) = 1
[PROOF STEP]
using ys len_ys
[PROOF STATE]
proof (prove)
using this:
m = length ys + 2
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao
length ys = card (set ys)

goal (1 subgoal):
 1. card (UNIV - (UNIV - above ao) - set (y # ys)) = 1
[PROOF STEP]
by(subst card_Diff_subset)(auto simp add: m_def card_Diff_subset)
[PROOF STATE]
proof (state)
this:
card (UNIV - (UNIV - above ao) - set (y # ys)) = 1

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (UNIV - (UNIV - above ao) - set (y # ys)) = 1
[PROOF STEP]
obtain z where z: "z \<in> above ao" "z \<noteq> y" "z \<notin> set ys"
[PROOF STATE]
proof (prove)
using this:
card (UNIV - (UNIV - above ao) - set (y # ys)) = 1

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> above ao; z \<noteq> y; z \<notin> set ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding card_eq_1_iff
[PROOF STATE]
proof (prove)
using this:
\<exists>x. UNIV - (UNIV - above ao) - set (y # ys) = {x}

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> above ao; z \<noteq> y; z \<notin> set ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<in> above ao
z \<noteq> y
z \<notin> set ys

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
m = length ys + 2
[PROOF STEP]
have "\<not> proper_interval (Some (last (y # ys))) None"
[PROOF STATE]
proof (prove)
using this:
m = length ys + 2

goal (1 subgoal):
 1. \<not> proper_interval (Some (last (y # ys))) None
[PROOF STEP]
by(rule pi)
[PROOF STATE]
proof (state)
this:
\<not> proper_interval (Some (last (y # ys))) None

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "z \<le> last (y # ys)"
[PROOF STATE]
proof (prove)
using this:
\<not> proper_interval (Some (last (y # ys))) None

goal (1 subgoal):
 1. z \<le> last (y # ys)
[PROOF STEP]
by(simp add: proper_interval_simps not_less del: last.simps)
[PROOF STATE]
proof (state)
this:
z \<le> last (y # ys)

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<le> last (y # ys)

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have ly: "last (y # ys) \<in> set (y # ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (y # ys) \<in> set (y # ys)
[PROOF STEP]
by(rule last_in_set) simp
[PROOF STATE]
proof (state)
this:
last (y # ys) \<in> set (y # ys)

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
with z
[PROOF STATE]
proof (chain)
picking this:
z \<in> above ao
z \<noteq> y
z \<notin> set ys
last (y # ys) \<in> set (y # ys)
[PROOF STEP]
have "z \<noteq> last (y # ys)"
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z \<noteq> y
z \<notin> set ys
last (y # ys) \<in> set (y # ys)

goal (1 subgoal):
 1. z \<noteq> last (y # ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<noteq> last (y # ys)

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<le> last (y # ys)
z \<noteq> last (y # ys)
[PROOF STEP]
have "z < last (y # ys)"
[PROOF STATE]
proof (prove)
using this:
z \<le> last (y # ys)
z \<noteq> last (y # ys)

goal (1 subgoal):
 1. z < last (y # ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z < last (y # ys)

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "{last (y # ys)} \<sqsubset>' {z}"
[PROOF STATE]
proof (prove)
using this:
z < last (y # ys)

goal (1 subgoal):
 1. {last (y # ys)} \<sqsubset>' {z}
[PROOF STEP]
using z ly ys
[PROOF STATE]
proof (prove)
using this:
z < last (y # ys)
z \<in> above ao
z \<noteq> y
z \<notin> set ys
last (y # ys) \<in> set (y # ys)
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. {last (y # ys)} \<sqsubset>' {z}
[PROOF STEP]
by(auto 4 3 simp add: set_less_aux_def)
[PROOF STATE]
proof (state)
this:
{last (y # ys)} \<sqsubset>' {z}

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{last (y # ys)} \<sqsubset>' {z}

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "\<dots> \<sqsubseteq>' - set (y # ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {z} \<sqsubseteq>' - set (y # ys) \<inter> above ao
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z \<noteq> y
z \<notin> set ys

goal (1 subgoal):
 1. {z} \<sqsubseteq>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by(auto intro: subset_finite_imp_set_less_eq_aux)
[PROOF STATE]
proof (state)
this:
{z} \<sqsubseteq>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{z} \<sqsubseteq>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "{last (y # ys)} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {last (y # ys)} \<noteq> {}
[PROOF STEP]
using ly ys
[PROOF STATE]
proof (prove)
using this:
last (y # ys) \<in> set (y # ys)
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao

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

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{last (y # ys)} \<noteq> {}

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "{last (y # ys)} \<subseteq> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {last (y # ys)} \<subseteq> above ao
[PROOF STEP]
using ys
[PROOF STATE]
proof (prove)
using this:
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. {last (y # ys)} \<subseteq> above ao
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{last (y # ys)} \<subseteq> above ao

goal (2 subgoals):
 1. m = length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{last (y # ys)} \<sqsubset>' - set (y # ys) \<inter> above ao
{last (y # ys)} \<noteq> {}
{last (y # ys)} \<subseteq> above ao
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{last (y # ys)} \<sqsubset>' - set (y # ys) \<inter> above ao
{last (y # ys)} \<noteq> {}
{last (y # ys)} \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
m \<noteq> length ys + 2

goal (1 subgoal):
 1. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
with \<open>length ys + 2 \<le> m\<close> ys len_ys
[PROOF STATE]
proof (chain)
picking this:
length ys + 2 \<le> m
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao
length ys = card (set ys)
m \<noteq> length ys + 2
[PROOF STEP]
have "card (UNIV - (UNIV - above ao) - set (y # ys)) > 1"
[PROOF STATE]
proof (prove)
using this:
length ys + 2 \<le> m
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao
length ys = card (set ys)
m \<noteq> length ys + 2

goal (1 subgoal):
 1. 1 < card (UNIV - (UNIV - above ao) - set (y # ys))
[PROOF STEP]
by(subst card_Diff_subset)(auto simp add: card_Diff_subset m_def)
[PROOF STATE]
proof (state)
this:
1 < card (UNIV - (UNIV - above ao) - set (y # ys))

goal (1 subgoal):
 1. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
from card_gt_1D[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>x ya. x \<in> UNIV - (UNIV - above ao) - set (y # ys) \<and> ya \<in> UNIV - (UNIV - above ao) - set (y # ys) \<and> x \<noteq> ya
[PROOF STEP]
obtain x x' where x: "x \<in> above ao" "x \<noteq> y" "x \<notin> set ys"
            and x': "x' \<in> above ao" "x' \<noteq> y" "x' \<notin> set ys"
            and neq: "x \<noteq> x'"
[PROOF STATE]
proof (prove)
using this:
\<exists>x ya. x \<in> UNIV - (UNIV - above ao) - set (y # ys) \<and> ya \<in> UNIV - (UNIV - above ao) - set (y # ys) \<and> x \<noteq> ya

goal (1 subgoal):
 1. (\<And>x x'. \<lbrakk>x \<in> above ao; x \<noteq> y; x \<notin> set ys; x' \<in> above ao; x' \<noteq> y; x' \<notin> set ys; x \<noteq> x'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> above ao
x \<noteq> y
x \<notin> set ys
x' \<in> above ao
x' \<noteq> y
x' \<notin> set ys
x \<noteq> x'

goal (1 subgoal):
 1. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "{x} \<sqsubset>' {x, x'} \<inter> above ao"
[PROOF STATE]
proof (prove)
using this:
x \<in> above ao
x \<noteq> y
x \<notin> set ys
x' \<in> above ao
x' \<noteq> y
x' \<notin> set ys
x \<noteq> x'

goal (1 subgoal):
 1. {x} \<sqsubset>' {x, x'} \<inter> above ao
[PROOF STEP]
by(simp_all add: psubsetI psubset_finite_imp_set_less_aux)
[PROOF STATE]
proof (state)
this:
{x} \<sqsubset>' {x, x'} \<inter> above ao

goal (1 subgoal):
 1. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{x} \<sqsubset>' {x, x'} \<inter> above ao

goal (1 subgoal):
 1. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "\<dots> \<sqsubseteq>' - set (y # ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x, x'} \<inter> above ao \<sqsubseteq>' - set (y # ys) \<inter> above ao
[PROOF STEP]
using x x' ys
[PROOF STATE]
proof (prove)
using this:
x \<in> above ao
x \<noteq> y
x \<notin> set ys
x' \<in> above ao
x' \<noteq> y
x' \<notin> set ys
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. {x, x'} \<inter> above ao \<sqsubseteq>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by(auto intro: subset_finite_imp_set_less_eq_aux)
[PROOF STATE]
proof (state)
this:
{x, x'} \<inter> above ao \<sqsubseteq>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{x, x'} \<inter> above ao \<sqsubseteq>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "{x} \<inter> above ao \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x} \<inter> above ao \<noteq> {}
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> above ao
x \<noteq> y
x \<notin> set ys

goal (1 subgoal):
 1. {x} \<inter> above ao \<noteq> {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{x} \<inter> above ao \<noteq> {}

goal (1 subgoal):
 1. m \<noteq> length ys + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{x} \<sqsubset>' - set (y # ys) \<inter> above ao
{x} \<inter> above ao \<noteq> {}
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
{x} \<sqsubset>' - set (y # ys) \<inter> above ao
{x} \<inter> above ao \<noteq> {}

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
obtain A where nempty: "A \<noteq> {}"
          and less: "A \<sqsubset>' - set (y # ys) \<inter> above ao"
          and subset: "A \<subseteq> above ao"
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>A \<noteq> {}; A \<sqsubset>' - set (y # ys) \<inter> above ao; A \<subseteq> above ao\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<noteq> {}
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
have "card (set (y # ys)) \<le> card (above ao)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (y # ys)) \<le> card (above ao)
[PROOF STEP]
using ys(3)
[PROOF STATE]
proof (prove)
using this:
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. card (set (y # ys)) \<le> card (above ao)
[PROOF STEP]
by(simp add: card_mono)
[PROOF STATE]
proof (state)
this:
card (set (y # ys)) \<le> card (above ao)

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
hence "length ys + 1 \<le> m"
[PROOF STATE]
proof (prove)
using this:
card (set (y # ys)) \<le> card (above ao)

goal (1 subgoal):
 1. length ys + 1 \<le> m
[PROOF STEP]
unfolding m_eq
[PROOF STATE]
proof (prove)
using this:
card (set (y # ys)) \<le> card (above ao)

goal (1 subgoal):
 1. length ys + 1 \<le> card (above ao)
[PROOF STEP]
using ys
[PROOF STATE]
proof (prove)
using this:
card (set (y # ys)) \<le> card (above ao)
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. length ys + 1 \<le> card (above ao)
[PROOF STEP]
by(simp add: len_ys)
[PROOF STATE]
proof (state)
this:
length ys + 1 \<le> m

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
have "m \<noteq> length ys + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<noteq> length ys + 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m = length ys + 1 \<Longrightarrow> False
[PROOF STEP]
assume "m = length ys + 1"
[PROOF STATE]
proof (state)
this:
m = length ys + 1

goal (1 subgoal):
 1. m = length ys + 1 \<Longrightarrow> False
[PROOF STEP]
hence "card (above ao) \<le> card (set (y # ys))"
[PROOF STATE]
proof (prove)
using this:
m = length ys + 1

goal (1 subgoal):
 1. card (above ao) \<le> card (set (y # ys))
[PROOF STEP]
unfolding m_eq
[PROOF STATE]
proof (prove)
using this:
card (above ao) = length ys + 1

goal (1 subgoal):
 1. card (above ao) \<le> card (set (y # ys))
[PROOF STEP]
using ys len_ys
[PROOF STATE]
proof (prove)
using this:
card (above ao) = length ys + 1
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao
length ys = card (set ys)

goal (1 subgoal):
 1. card (above ao) \<le> card (set (y # ys))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (above ao) \<le> card (set (y # ys))

goal (1 subgoal):
 1. m = length ys + 1 \<Longrightarrow> False
[PROOF STEP]
from card_seteq[OF _ _ this] ys
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite (above ao); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> set (y # ys) = above ao
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao
[PROOF STEP]
have "set (y # ys) = above ao"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (above ao); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> set (y # ys) = above ao
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. set (y # ys) = above ao
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set (y # ys) = above ao

goal (1 subgoal):
 1. m = length ys + 1 \<Longrightarrow> False
[PROOF STEP]
with nempty less
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> {}
A \<sqsubset>' - set (y # ys) \<inter> above ao
set (y # ys) = above ao
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
A \<sqsubset>' - set (y # ys) \<inter> above ao
set (y # ys) = above ao

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
m \<noteq> length ys + 1

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
m \<noteq> length ys + 1

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
m \<noteq> length ys + 1

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
assume "m = length ys + 2"
[PROOF STATE]
proof (state)
this:
m = length ys + 2

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
hence "card (above ao - set (y # ys)) = 1"
[PROOF STATE]
proof (prove)
using this:
m = length ys + 2

goal (1 subgoal):
 1. card (above ao - set (y # ys)) = 1
[PROOF STEP]
using ys len_ys m_eq
[PROOF STATE]
proof (prove)
using this:
m = length ys + 2
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao
length ys = card (set ys)
m = card (above ao)

goal (1 subgoal):
 1. card (above ao - set (y # ys)) = 1
[PROOF STEP]
by(auto simp add: card_Diff_subset)
[PROOF STATE]
proof (state)
this:
card (above ao - set (y # ys)) = 1

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (above ao - set (y # ys)) = 1
[PROOF STEP]
obtain z where z: "above ao - set (y # ys) = {z}"
[PROOF STATE]
proof (prove)
using this:
card (above ao - set (y # ys)) = 1

goal (1 subgoal):
 1. (\<And>z. above ao - set (y # ys) = {z} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding card_eq_1_iff
[PROOF STATE]
proof (prove)
using this:
\<exists>x. above ao - set (y # ys) = {x}

goal (1 subgoal):
 1. (\<And>z. above ao - set (y # ys) = {z} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
above ao - set (y # ys) = {z}

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
hence eq_z: "- set (y # ys) \<inter> above ao = {z}"
[PROOF STATE]
proof (prove)
using this:
above ao - set (y # ys) = {z}

goal (1 subgoal):
 1. - set (y # ys) \<inter> above ao = {z}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- set (y # ys) \<inter> above ao = {z}

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
with less
[PROOF STATE]
proof (chain)
picking this:
A \<sqsubset>' - set (y # ys) \<inter> above ao
- set (y # ys) \<inter> above ao = {z}
[PROOF STEP]
have "A \<sqsubset>' {z}"
[PROOF STATE]
proof (prove)
using this:
A \<sqsubset>' - set (y # ys) \<inter> above ao
- set (y # ys) \<inter> above ao = {z}

goal (1 subgoal):
 1. A \<sqsubset>' {z}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A \<sqsubset>' {z}

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
have "\<not> proper_interval (Some (last (y # ys))) None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> proper_interval (Some (last (y # ys))) None
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. proper_interval (Some (last (y # ys))) None \<Longrightarrow> False
[PROOF STEP]
assume "proper_interval (Some (last (y # ys))) None"
[PROOF STATE]
proof (state)
this:
proper_interval (Some (last (y # ys))) None

goal (1 subgoal):
 1. proper_interval (Some (last (y # ys))) None \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
proper_interval (Some (last (y # ys))) None
[PROOF STEP]
obtain z' where z': "last (y # ys) < z'"
[PROOF STATE]
proof (prove)
using this:
proper_interval (Some (last (y # ys))) None

goal (1 subgoal):
 1. (\<And>z'. last (y # ys) < z' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(clarsimp simp add: proper_interval_simps)
[PROOF STATE]
proof (state)
this:
last (y # ys) < z'

goal (1 subgoal):
 1. proper_interval (Some (last (y # ys))) None \<Longrightarrow> False
[PROOF STEP]
have "last (y # ys) \<in> set (y # ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (y # ys) \<in> set (y # ys)
[PROOF STEP]
by(rule last_in_set) simp
[PROOF STATE]
proof (state)
this:
last (y # ys) \<in> set (y # ys)

goal (1 subgoal):
 1. proper_interval (Some (last (y # ys))) None \<Longrightarrow> False
[PROOF STEP]
with ys z'
[PROOF STATE]
proof (chain)
picking this:
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao
last (y # ys) < z'
last (y # ys) \<in> set (y # ys)
[PROOF STEP]
have "z' \<in> above ao" "z' \<notin> set (y # ys)"
[PROOF STATE]
proof (prove)
using this:
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao
last (y # ys) < z'
last (y # ys) \<in> set (y # ys)

goal (1 subgoal):
 1. z' \<in> above ao &&& z' \<notin> set (y # ys)
[PROOF STEP]
using above_upclosed local.not_less local.sorted_last ys(1) z'
[PROOF STATE]
proof (prove)
using this:
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao
last (y # ys) < z'
last (y # ys) \<in> set (y # ys)
\<lbrakk>?x \<in> above ?ao; ?x < ?y\<rbrakk> \<Longrightarrow> ?y \<in> above ?ao
(\<not> ?x < ?y) = (?y \<le> ?x)
\<lbrakk>sorted ?xs; ?x \<in> set ?xs\<rbrakk> \<Longrightarrow> ?x \<le> last ?xs
sorted (y # ys)
last (y # ys) < z'

goal (1 subgoal):
 1. z' \<in> above ao &&& z' \<notin> set (y # ys)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
z' \<in> above ao
z' \<notin> set (y # ys)

goal (1 subgoal):
 1. proper_interval (Some (last (y # ys))) None \<Longrightarrow> False
[PROOF STEP]
with eq_z
[PROOF STATE]
proof (chain)
picking this:
- set (y # ys) \<inter> above ao = {z}
z' \<in> above ao
z' \<notin> set (y # ys)
[PROOF STEP]
have "z = z'"
[PROOF STATE]
proof (prove)
using this:
- set (y # ys) \<inter> above ao = {z}
z' \<in> above ao
z' \<notin> set (y # ys)

goal (1 subgoal):
 1. z = z'
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
z = z'

goal (1 subgoal):
 1. proper_interval (Some (last (y # ys))) None \<Longrightarrow> False
[PROOF STEP]
from z'
[PROOF STATE]
proof (chain)
picking this:
last (y # ys) < z'
[PROOF STEP]
have "\<And>x. x \<in> set (y # ys) \<Longrightarrow> x < z'"
[PROOF STATE]
proof (prove)
using this:
last (y # ys) < z'

goal (1 subgoal):
 1. \<And>x. x \<in> set (y # ys) \<Longrightarrow> x < z'
[PROOF STEP]
using ys
[PROOF STATE]
proof (prove)
using this:
last (y # ys) < z'
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. \<And>x. x \<in> set (y # ys) \<Longrightarrow> x < z'
[PROOF STEP]
by(auto dest: sorted_last simp del: sorted_wrt.simps(2))
[PROOF STATE]
proof (state)
this:
?x \<in> set (y # ys) \<Longrightarrow> ?x < z'

goal (1 subgoal):
 1. proper_interval (Some (last (y # ys))) None \<Longrightarrow> False
[PROOF STEP]
with eq_z \<open>z = z'\<close>
[PROOF STATE]
proof (chain)
picking this:
- set (y # ys) \<inter> above ao = {z}
z = z'
?x \<in> set (y # ys) \<Longrightarrow> ?x < z'
[PROOF STEP]
have "\<And>x. x \<in> above ao \<Longrightarrow> x \<le> z'"
[PROOF STATE]
proof (prove)
using this:
- set (y # ys) \<inter> above ao = {z}
z = z'
?x \<in> set (y # ys) \<Longrightarrow> ?x < z'

goal (1 subgoal):
 1. \<And>x. x \<in> above ao \<Longrightarrow> x \<le> z'
[PROOF STEP]
by(fastforce)
[PROOF STATE]
proof (state)
this:
?x \<in> above ao \<Longrightarrow> ?x \<le> z'

goal (1 subgoal):
 1. proper_interval (Some (last (y # ys))) None \<Longrightarrow> False
[PROOF STEP]
with \<open>A \<sqsubset>' {z}\<close> nempty \<open>z = z'\<close> subset
[PROOF STATE]
proof (chain)
picking this:
A \<sqsubset>' {z}
A \<noteq> {}
z = z'
A \<subseteq> above ao
?x \<in> above ao \<Longrightarrow> ?x \<le> z'
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
A \<sqsubset>' {z}
A \<noteq> {}
z = z'
A \<subseteq> above ao
?x \<in> above ao \<Longrightarrow> ?x \<le> z'

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> proper_interval (Some (last (y # ys))) None

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
m = length ys + 2 \<Longrightarrow> \<not> proper_interval (Some (last (y # ys))) None

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
m \<noteq> length ys + 1
m = length ys + 2 \<Longrightarrow> \<not> proper_interval (Some (last (y # ys))) None
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
m \<noteq> length ys + 1
m = length ys + 2 \<Longrightarrow> \<not> proper_interval (Some (last (y # ys))) None

goal (1 subgoal):
 1. m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)) = (\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (3 subgoals):
 1. \<And>ao y ys. \<lbrakk>sorted []; distinct []; set [] \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 3. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(m \<noteq> length ys + 1 \<and> (m = length ys + 2 \<longrightarrow> \<not> proper_interval (Some (last (y # ys))) None)) = (\<exists>A\<subseteq>above ao. A \<noteq> {} \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
by(simp add: length_last_def m_def Let_def)
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux ao (card (UNIV - above ao)) [] (y # ys) = (\<exists>A\<subseteq>above ao. set [] \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (2 subgoals):
 1. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case (3 ao x xs)
[PROOF STATE]
proof (state)
this:
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
sorted []
distinct []
set [] \<subseteq> above ao

goal (2 subgoals):
 1. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
note xs = \<open>sorted (x # xs)\<close> \<open>distinct (x # xs)\<close> \<open>set (x # xs) \<subseteq> above ao\<close>
[PROOF STATE]
proof (state)
this:
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao

goal (2 subgoals):
 1. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have len_xs: "length xs = card (set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = card (set xs)
[PROOF STEP]
using xs
[PROOF STATE]
proof (prove)
using this:
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. length xs = card (set xs)
[PROOF STEP]
by(auto simp add: List.card_set intro: sym)
[PROOF STATE]
proof (state)
this:
length xs = card (set xs)

goal (2 subgoals):
 1. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
define m where "m = CARD('a) - card (UNIV - above ao)"
[PROOF STATE]
proof (state)
this:
m = CARD('a) - card (UNIV - above ao)

goal (2 subgoals):
 1. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "CARD('a) = card (above ao) + card (UNIV - above ao)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a) = card (above ao) + card (UNIV - above ao)
[PROOF STEP]
using card_Un_disjoint[of "above ao" "UNIV - above ao"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (above ao); finite (UNIV - above ao); above ao \<inter> (UNIV - above ao) = {}\<rbrakk> \<Longrightarrow> card (above ao \<union> (UNIV - above ao)) = card (above ao) + card (UNIV - above ao)

goal (1 subgoal):
 1. CARD('a) = card (above ao) + card (UNIV - above ao)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
CARD('a) = card (above ao) + card (UNIV - above ao)

goal (2 subgoals):
 1. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
hence m_eq: "m = card (above ao)"
[PROOF STATE]
proof (prove)
using this:
CARD('a) = card (above ao) + card (UNIV - above ao)

goal (1 subgoal):
 1. m = card (above ao)
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
using this:
CARD('a) = card (above ao) + card (UNIV - above ao)

goal (1 subgoal):
 1. CARD('a) - card (UNIV - above ao) = card (above ao)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m = card (above ao)

goal (2 subgoals):
 1. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None) \<longleftrightarrow>
        (\<exists>A \<subseteq> above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao)" (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)

goal (2 subgoals):
 1. m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
hence m: "m \<noteq> length xs + 1"
          and pi: "m = length xs + 2 \<Longrightarrow> \<not> proper_interval (Some (last (x # xs))) None"
[PROOF STATE]
proof (prove)
using this:
m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)

goal (1 subgoal):
 1. m \<noteq> length xs + 1 &&& (m = length xs + 2 \<Longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
m \<noteq> length xs + 1
m = length xs + 2 \<Longrightarrow> \<not> proper_interval (Some (last (x # xs))) None

goal (2 subgoals):
 1. m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
have "length xs + 1 = card (set (x # xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs + 1 = card (set (x # xs))
[PROOF STEP]
using xs len_xs
[PROOF STATE]
proof (prove)
using this:
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
length xs = card (set xs)

goal (1 subgoal):
 1. length xs + 1 = card (set (x # xs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length xs + 1 = card (set (x # xs))

goal (2 subgoals):
 1. m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length xs + 1 = card (set (x # xs))

goal (2 subgoals):
 1. m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
have "\<dots> \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (x # xs)) \<le> m
[PROOF STEP]
unfolding m_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (x # xs)) \<le> card (above ao)
[PROOF STEP]
by(rule card_mono)(simp, rule xs)
[PROOF STATE]
proof (state)
this:
card (set (x # xs)) \<le> m

goal (2 subgoals):
 1. m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
length xs + 1 \<le> m
[PROOF STEP]
have "length xs + 2 \<le> m"
[PROOF STATE]
proof (prove)
using this:
length xs + 1 \<le> m

goal (1 subgoal):
 1. length xs + 2 \<le> m
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
length xs + 1 \<le> m
m \<noteq> length xs + 1

goal (1 subgoal):
 1. length xs + 2 \<le> m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length xs + 2 \<le> m

goal (2 subgoals):
 1. m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
proof(cases "m = length xs + 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
m = length xs + 2

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
hence "card (UNIV - (UNIV - above ao) - set (x # xs)) = 1"
[PROOF STATE]
proof (prove)
using this:
m = length xs + 2

goal (1 subgoal):
 1. card (UNIV - (UNIV - above ao) - set (x # xs)) = 1
[PROOF STEP]
using xs len_xs
[PROOF STATE]
proof (prove)
using this:
m = length xs + 2
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
length xs = card (set xs)

goal (1 subgoal):
 1. card (UNIV - (UNIV - above ao) - set (x # xs)) = 1
[PROOF STEP]
by(subst card_Diff_subset)(auto simp add: m_def card_Diff_subset)
[PROOF STATE]
proof (state)
this:
card (UNIV - (UNIV - above ao) - set (x # xs)) = 1

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (UNIV - (UNIV - above ao) - set (x # xs)) = 1
[PROOF STEP]
obtain z where z: "z \<in> above ao" "z \<noteq> x" "z \<notin> set xs"
[PROOF STATE]
proof (prove)
using this:
card (UNIV - (UNIV - above ao) - set (x # xs)) = 1

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> above ao; z \<noteq> x; z \<notin> set xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding card_eq_1_iff
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. UNIV - (UNIV - above ao) - set (x # xs) = {xa}

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> above ao; z \<noteq> x; z \<notin> set xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<in> above ao
z \<noteq> x
z \<notin> set xs

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
define A where "A = insert z {y. y \<in> set (x # xs) \<and> y < z}"
[PROOF STATE]
proof (state)
this:
A = insert z {y \<in> set (x # xs). y < z}

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
m = length xs + 2
[PROOF STEP]
have "\<not> proper_interval (Some (last (x # xs))) None"
[PROOF STATE]
proof (prove)
using this:
m = length xs + 2

goal (1 subgoal):
 1. \<not> proper_interval (Some (last (x # xs))) None
[PROOF STEP]
by(rule pi)
[PROOF STATE]
proof (state)
this:
\<not> proper_interval (Some (last (x # xs))) None

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
hence "z \<le> last (x # xs)"
[PROOF STATE]
proof (prove)
using this:
\<not> proper_interval (Some (last (x # xs))) None

goal (1 subgoal):
 1. z \<le> last (x # xs)
[PROOF STEP]
by(simp add: proper_interval_simps not_less del: last.simps)
[PROOF STATE]
proof (state)
this:
z \<le> last (x # xs)

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<le> last (x # xs)

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
have lx: "last (x # xs) \<in> set (x # xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (x # xs) \<in> set (x # xs)
[PROOF STEP]
by(rule last_in_set) simp
[PROOF STATE]
proof (state)
this:
last (x # xs) \<in> set (x # xs)

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
with z
[PROOF STATE]
proof (chain)
picking this:
z \<in> above ao
z \<noteq> x
z \<notin> set xs
last (x # xs) \<in> set (x # xs)
[PROOF STEP]
have "z \<noteq> last (x # xs)"
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z \<noteq> x
z \<notin> set xs
last (x # xs) \<in> set (x # xs)

goal (1 subgoal):
 1. z \<noteq> last (x # xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<noteq> last (x # xs)

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<le> last (x # xs)
z \<noteq> last (x # xs)
[PROOF STEP]
have "z < last (x # xs)"
[PROOF STATE]
proof (prove)
using this:
z \<le> last (x # xs)
z \<noteq> last (x # xs)

goal (1 subgoal):
 1. z < last (x # xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z < last (x # xs)

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
hence "set (x # xs) \<sqsubset>' A"
[PROOF STATE]
proof (prove)
using this:
z < last (x # xs)

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' A
[PROOF STEP]
using z xs
[PROOF STATE]
proof (prove)
using this:
z < last (x # xs)
z \<in> above ao
z \<noteq> x
z \<notin> set xs
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' A
[PROOF STEP]
by(auto simp add: A_def set_less_aux_def intro: rev_bexI[where x=z])
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
have "last (x # xs) \<notin> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (x # xs) \<notin> A
[PROOF STEP]
using xs \<open>z < last (x # xs)\<close>
[PROOF STATE]
proof (prove)
using this:
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
z < last (x # xs)

goal (1 subgoal):
 1. last (x # xs) \<notin> A
[PROOF STEP]
by(auto simp add: A_def simp del: last.simps)
[PROOF STATE]
proof (state)
this:
last (x # xs) \<notin> A

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
hence "A \<subset> insert (last (x # xs)) A"
[PROOF STATE]
proof (prove)
using this:
last (x # xs) \<notin> A

goal (1 subgoal):
 1. A \<subset> insert (last (x # xs)) A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<subset> insert (last (x # xs)) A

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
hence less': "A \<sqsubset>' insert (last (x # xs)) A"
[PROOF STATE]
proof (prove)
using this:
A \<subset> insert (last (x # xs)) A

goal (1 subgoal):
 1. A \<sqsubset>' insert (last (x # xs)) A
[PROOF STEP]
by(rule psubset_finite_imp_set_less_aux) simp
[PROOF STATE]
proof (state)
this:
A \<sqsubset>' insert (last (x # xs)) A

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
have "\<dots> \<subseteq> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (last (x # xs)) A \<subseteq> above ao
[PROOF STEP]
using xs lx z
[PROOF STATE]
proof (prove)
using this:
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
last (x # xs) \<in> set (x # xs)
z \<in> above ao
z \<noteq> x
z \<notin> set xs

goal (1 subgoal):
 1. insert (last (x # xs)) A \<subseteq> above ao
[PROOF STEP]
by(auto simp del: last.simps simp add: A_def)
[PROOF STATE]
proof (state)
this:
insert (last (x # xs)) A \<subseteq> above ao

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
hence "insert (last (x # xs)) A \<sqsubseteq>' above ao"
[PROOF STATE]
proof (prove)
using this:
insert (last (x # xs)) A \<subseteq> above ao

goal (1 subgoal):
 1. insert (last (x # xs)) A \<sqsubseteq>' above ao
[PROOF STEP]
by(auto intro: subset_finite_imp_set_less_eq_aux)
[PROOF STATE]
proof (state)
this:
insert (last (x # xs)) A \<sqsubseteq>' above ao

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
with less'
[PROOF STATE]
proof (chain)
picking this:
A \<sqsubset>' insert (last (x # xs)) A
insert (last (x # xs)) A \<sqsubseteq>' above ao
[PROOF STEP]
have "A \<sqsubset>' above ao"
[PROOF STATE]
proof (prove)
using this:
A \<sqsubset>' insert (last (x # xs)) A
insert (last (x # xs)) A \<sqsubseteq>' above ao

goal (1 subgoal):
 1. A \<sqsubset>' above ao
[PROOF STEP]
by(rule set_less_trans_set_less_eq)
[PROOF STATE]
proof (state)
this:
A \<sqsubset>' above ao

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<sqsubset>' above ao

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
have "A \<subseteq> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> above ao
[PROOF STEP]
using xs z
[PROOF STATE]
proof (prove)
using this:
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
z \<in> above ao
z \<noteq> x
z \<notin> set xs

goal (1 subgoal):
 1. A \<subseteq> above ao
[PROOF STEP]
by(auto simp add: A_def)
[PROOF STATE]
proof (state)
this:
A \<subseteq> above ao

goal (2 subgoals):
 1. m = length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
 2. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' above ao
A \<subseteq> above ao
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' above ao
A \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao

goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
m \<noteq> length xs + 2

goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
with \<open>length xs + 2 \<le> m\<close> xs len_xs
[PROOF STATE]
proof (chain)
picking this:
length xs + 2 \<le> m
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
length xs = card (set xs)
m \<noteq> length xs + 2
[PROOF STEP]
have "card (UNIV - (UNIV - above ao) - set (x # xs)) > 1"
[PROOF STATE]
proof (prove)
using this:
length xs + 2 \<le> m
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
length xs = card (set xs)
m \<noteq> length xs + 2

goal (1 subgoal):
 1. 1 < card (UNIV - (UNIV - above ao) - set (x # xs))
[PROOF STEP]
by(subst card_Diff_subset)(auto simp add: card_Diff_subset m_def)
[PROOF STATE]
proof (state)
this:
1 < card (UNIV - (UNIV - above ao) - set (x # xs))

goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
from card_gt_1D[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>xa y. xa \<in> UNIV - (UNIV - above ao) - set (x # xs) \<and> y \<in> UNIV - (UNIV - above ao) - set (x # xs) \<and> xa \<noteq> y
[PROOF STEP]
obtain y y' where y: "y \<in> above ao" "y \<noteq> x" "y \<notin> set xs"
            and y': "y' \<in> above ao" "y' \<noteq> x" "y' \<notin> set xs"
            and neq: "y \<noteq> y'"
[PROOF STATE]
proof (prove)
using this:
\<exists>xa y. xa \<in> UNIV - (UNIV - above ao) - set (x # xs) \<and> y \<in> UNIV - (UNIV - above ao) - set (x # xs) \<and> xa \<noteq> y

goal (1 subgoal):
 1. (\<And>y y'. \<lbrakk>y \<in> above ao; y \<noteq> x; y \<notin> set xs; y' \<in> above ao; y' \<noteq> x; y' \<notin> set xs; y \<noteq> y'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> above ao
y \<noteq> x
y \<notin> set xs
y' \<in> above ao
y' \<noteq> x
y' \<notin> set xs
y \<noteq> y'

goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
define A where "A = insert y (set (x # xs) \<inter> above ao)"
[PROOF STATE]
proof (state)
this:
A = insert y (set (x # xs) \<inter> above ao)

goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
hence "set (x # xs) \<subset> A"
[PROOF STATE]
proof (prove)
using this:
A = insert y (set (x # xs) \<inter> above ao)

goal (1 subgoal):
 1. set (x # xs) \<subset> A
[PROOF STEP]
using y xs
[PROOF STATE]
proof (prove)
using this:
A = insert y (set (x # xs) \<inter> above ao)
y \<in> above ao
y \<noteq> x
y \<notin> set xs
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. set (x # xs) \<subset> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (x # xs) \<subset> A

goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
hence "set (x # xs) \<sqsubset>' \<dots>"
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<subset> A

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' A
[PROOF STEP]
by(fastforce intro: psubset_finite_imp_set_less_aux)
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A

goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A

goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
have *: "\<dots> \<subset> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subset> above ao
[PROOF STEP]
using y y' neq
[PROOF STATE]
proof (prove)
using this:
y \<in> above ao
y \<noteq> x
y \<notin> set xs
y' \<in> above ao
y' \<noteq> x
y' \<notin> set xs
y \<noteq> y'

goal (1 subgoal):
 1. A \<subset> above ao
[PROOF STEP]
by(auto simp add: A_def)
[PROOF STATE]
proof (state)
this:
A \<subset> above ao

goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<subset> above ao

goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
A \<subset> above ao
[PROOF STEP]
have "A \<sqsubset>' above ao"
[PROOF STATE]
proof (prove)
using this:
A \<subset> above ao

goal (1 subgoal):
 1. A \<sqsubset>' above ao
[PROOF STEP]
by(auto intro: psubset_finite_imp_set_less_aux)
[PROOF STATE]
proof (state)
this:
A \<sqsubset>' above ao

goal (1 subgoal):
 1. m \<noteq> length xs + 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' A
A \<subset> above ao
A \<sqsubset>' above ao
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<subset> above ao
A \<sqsubset>' above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao
[PROOF STEP]
obtain A where lessA: "set (x # xs) \<sqsubset>' A"
          and Aless: "A \<sqsubset>' above ao" and subset: "A \<subseteq> above ao"
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>set (x # xs) \<sqsubset>' A; A \<sqsubset>' above ao; A \<subseteq> above ao\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' above ao
A \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
have "card (set (x # xs)) \<le> card (above ao)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (x # xs)) \<le> card (above ao)
[PROOF STEP]
using xs(3)
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. card (set (x # xs)) \<le> card (above ao)
[PROOF STEP]
by(simp add: card_mono)
[PROOF STATE]
proof (state)
this:
card (set (x # xs)) \<le> card (above ao)

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
hence "length xs + 1 \<le> m"
[PROOF STATE]
proof (prove)
using this:
card (set (x # xs)) \<le> card (above ao)

goal (1 subgoal):
 1. length xs + 1 \<le> m
[PROOF STEP]
unfolding m_eq
[PROOF STATE]
proof (prove)
using this:
card (set (x # xs)) \<le> card (above ao)

goal (1 subgoal):
 1. length xs + 1 \<le> card (above ao)
[PROOF STEP]
using xs
[PROOF STATE]
proof (prove)
using this:
card (set (x # xs)) \<le> card (above ao)
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. length xs + 1 \<le> card (above ao)
[PROOF STEP]
by(simp add: len_xs)
[PROOF STATE]
proof (state)
this:
length xs + 1 \<le> m

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
have "m \<noteq> length xs + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<noteq> length xs + 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m = length xs + 1 \<Longrightarrow> False
[PROOF STEP]
assume "m = length xs + 1"
[PROOF STATE]
proof (state)
this:
m = length xs + 1

goal (1 subgoal):
 1. m = length xs + 1 \<Longrightarrow> False
[PROOF STEP]
hence "card (above ao) \<le> card (set (x # xs))"
[PROOF STATE]
proof (prove)
using this:
m = length xs + 1

goal (1 subgoal):
 1. card (above ao) \<le> card (set (x # xs))
[PROOF STEP]
unfolding m_eq
[PROOF STATE]
proof (prove)
using this:
card (above ao) = length xs + 1

goal (1 subgoal):
 1. card (above ao) \<le> card (set (x # xs))
[PROOF STEP]
using xs len_xs
[PROOF STATE]
proof (prove)
using this:
card (above ao) = length xs + 1
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
length xs = card (set xs)

goal (1 subgoal):
 1. card (above ao) \<le> card (set (x # xs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (above ao) \<le> card (set (x # xs))

goal (1 subgoal):
 1. m = length xs + 1 \<Longrightarrow> False
[PROOF STEP]
from card_seteq[OF _ _ this] xs
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite (above ao); set (x # xs) \<subseteq> above ao\<rbrakk> \<Longrightarrow> set (x # xs) = above ao
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
[PROOF STEP]
have "set (x # xs) = above ao"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (above ao); set (x # xs) \<subseteq> above ao\<rbrakk> \<Longrightarrow> set (x # xs) = above ao
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. set (x # xs) = above ao
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set (x # xs) = above ao

goal (1 subgoal):
 1. m = length xs + 1 \<Longrightarrow> False
[PROOF STEP]
with lessA Aless
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' above ao
set (x # xs) = above ao
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' above ao
set (x # xs) = above ao

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
m \<noteq> length xs + 1

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
m \<noteq> length xs + 1

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
m \<noteq> length xs + 1

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
assume "m = length xs + 2"
[PROOF STATE]
proof (state)
this:
m = length xs + 2

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
hence "card (above ao - set (x # xs)) = 1"
[PROOF STATE]
proof (prove)
using this:
m = length xs + 2

goal (1 subgoal):
 1. card (above ao - set (x # xs)) = 1
[PROOF STEP]
using xs len_xs m_eq
[PROOF STATE]
proof (prove)
using this:
m = length xs + 2
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
length xs = card (set xs)
m = card (above ao)

goal (1 subgoal):
 1. card (above ao - set (x # xs)) = 1
[PROOF STEP]
by(auto simp add: card_Diff_subset)
[PROOF STATE]
proof (state)
this:
card (above ao - set (x # xs)) = 1

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (above ao - set (x # xs)) = 1
[PROOF STEP]
obtain z where z: "above ao - set (x # xs) = {z}"
[PROOF STATE]
proof (prove)
using this:
card (above ao - set (x # xs)) = 1

goal (1 subgoal):
 1. (\<And>z. above ao - set (x # xs) = {z} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding card_eq_1_iff
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. above ao - set (x # xs) = {xa}

goal (1 subgoal):
 1. (\<And>z. above ao - set (x # xs) = {z} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
above ao - set (x # xs) = {z}

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
have "\<not> proper_interval (Some (last (x # xs))) None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> proper_interval (Some (last (x # xs))) None
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
assume "proper_interval (Some (last (x # xs))) None"
[PROOF STATE]
proof (state)
this:
proper_interval (Some (last (x # xs))) None

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
proper_interval (Some (last (x # xs))) None
[PROOF STEP]
obtain z' where z': "last (x # xs) < z'"
[PROOF STATE]
proof (prove)
using this:
proper_interval (Some (last (x # xs))) None

goal (1 subgoal):
 1. (\<And>z'. last (x # xs) < z' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(clarsimp simp add: proper_interval_simps)
[PROOF STATE]
proof (state)
this:
last (x # xs) < z'

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
have "last (x # xs) \<in> set (x # xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (x # xs) \<in> set (x # xs)
[PROOF STEP]
by(rule last_in_set) simp
[PROOF STATE]
proof (state)
this:
last (x # xs) \<in> set (x # xs)

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
with xs z'
[PROOF STATE]
proof (chain)
picking this:
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
last (x # xs) < z'
last (x # xs) \<in> set (x # xs)
[PROOF STEP]
have "z' \<in> above ao" "z' \<notin> set (x # xs)"
[PROOF STATE]
proof (prove)
using this:
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
last (x # xs) < z'
last (x # xs) \<in> set (x # xs)

goal (1 subgoal):
 1. z' \<in> above ao &&& z' \<notin> set (x # xs)
[PROOF STEP]
by(auto simp del: last.simps sorted_wrt.simps(2) intro: above_upclosed dest: sorted_last)
[PROOF STATE]
proof (state)
this:
z' \<in> above ao
z' \<notin> set (x # xs)

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
with z
[PROOF STATE]
proof (chain)
picking this:
above ao - set (x # xs) = {z}
z' \<in> above ao
z' \<notin> set (x # xs)
[PROOF STEP]
have "z = z'"
[PROOF STATE]
proof (prove)
using this:
above ao - set (x # xs) = {z}
z' \<in> above ao
z' \<notin> set (x # xs)

goal (1 subgoal):
 1. z = z'
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
z = z'

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
from z'
[PROOF STATE]
proof (chain)
picking this:
last (x # xs) < z'
[PROOF STEP]
have y_less: "\<And>y. y \<in> set (x # xs) \<Longrightarrow> y < z'"
[PROOF STATE]
proof (prove)
using this:
last (x # xs) < z'

goal (1 subgoal):
 1. \<And>y. y \<in> set (x # xs) \<Longrightarrow> y < z'
[PROOF STEP]
using xs
[PROOF STATE]
proof (prove)
using this:
last (x # xs) < z'
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. \<And>y. y \<in> set (x # xs) \<Longrightarrow> y < z'
[PROOF STEP]
by(auto simp del: sorted_wrt.simps(2) dest: sorted_last)
[PROOF STATE]
proof (state)
this:
?y \<in> set (x # xs) \<Longrightarrow> ?y < z'

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
with z \<open>z = z'\<close>
[PROOF STATE]
proof (chain)
picking this:
above ao - set (x # xs) = {z}
z = z'
?y \<in> set (x # xs) \<Longrightarrow> ?y < z'
[PROOF STEP]
have "\<And>y. y \<in> above ao \<Longrightarrow> y \<le> z'"
[PROOF STATE]
proof (prove)
using this:
above ao - set (x # xs) = {z}
z = z'
?y \<in> set (x # xs) \<Longrightarrow> ?y < z'

goal (1 subgoal):
 1. \<And>y. y \<in> above ao \<Longrightarrow> y \<le> z'
[PROOF STEP]
by(fastforce)
[PROOF STATE]
proof (state)
this:
?y \<in> above ao \<Longrightarrow> ?y \<le> z'

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
from lessA subset
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' A
A \<subseteq> above ao
[PROOF STEP]
obtain y where y: "y \<in> A" "y \<in> above ao" "y \<notin> set (x # xs)"
              and min: "\<And>y'. \<lbrakk> y' \<in> set (x # xs); y' \<in> above ao; y' \<notin> A \<rbrakk> \<Longrightarrow> y \<le> y'"
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<subseteq> above ao

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> A; y \<in> above ao; y \<notin> set (x # xs); \<And>y'. \<lbrakk>y' \<in> set (x # xs); y' \<in> above ao; y' \<notin> A\<rbrakk> \<Longrightarrow> y \<le> y'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto simp add: set_less_aux_def)
[PROOF STATE]
proof (state)
this:
y \<in> A
y \<in> above ao
y \<notin> set (x # xs)
\<lbrakk>?y' \<in> set (x # xs); ?y' \<in> above ao; ?y' \<notin> A\<rbrakk> \<Longrightarrow> y \<le> ?y'

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
with z \<open>z = z'\<close>
[PROOF STATE]
proof (chain)
picking this:
above ao - set (x # xs) = {z}
z = z'
y \<in> A
y \<in> above ao
y \<notin> set (x # xs)
\<lbrakk>?y' \<in> set (x # xs); ?y' \<in> above ao; ?y' \<notin> A\<rbrakk> \<Longrightarrow> y \<le> ?y'
[PROOF STEP]
have "y = z'"
[PROOF STATE]
proof (prove)
using this:
above ao - set (x # xs) = {z}
z = z'
y \<in> A
y \<in> above ao
y \<notin> set (x # xs)
\<lbrakk>?y' \<in> set (x # xs); ?y' \<in> above ao; ?y' \<notin> A\<rbrakk> \<Longrightarrow> y \<le> ?y'

goal (1 subgoal):
 1. y = z'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = z'

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
have "set (x # xs) \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (x # xs) \<subseteq> A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> set (x # xs) \<Longrightarrow> xa \<in> A
[PROOF STEP]
fix y'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> set (x # xs) \<Longrightarrow> xa \<in> A
[PROOF STEP]
assume y': "y' \<in> set (x # xs)"
[PROOF STATE]
proof (state)
this:
y' \<in> set (x # xs)

goal (1 subgoal):
 1. \<And>xa. xa \<in> set (x # xs) \<Longrightarrow> xa \<in> A
[PROOF STEP]
show "y' \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y' \<in> A
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y' \<notin> A \<Longrightarrow> False
[PROOF STEP]
assume "y' \<notin> A"
[PROOF STATE]
proof (state)
this:
y' \<notin> A

goal (1 subgoal):
 1. y' \<notin> A \<Longrightarrow> False
[PROOF STEP]
from y' xs
[PROOF STATE]
proof (chain)
picking this:
y' \<in> set (x # xs)
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
[PROOF STEP]
have "y' \<in> above ao"
[PROOF STATE]
proof (prove)
using this:
y' \<in> set (x # xs)
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. y' \<in> above ao
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y' \<in> above ao

goal (1 subgoal):
 1. y' \<notin> A \<Longrightarrow> False
[PROOF STEP]
with y'
[PROOF STATE]
proof (chain)
picking this:
y' \<in> set (x # xs)
y' \<in> above ao
[PROOF STEP]
have "y \<le> y'"
[PROOF STATE]
proof (prove)
using this:
y' \<in> set (x # xs)
y' \<in> above ao

goal (1 subgoal):
 1. y \<le> y'
[PROOF STEP]
using \<open>y' \<notin> A\<close>
[PROOF STATE]
proof (prove)
using this:
y' \<in> set (x # xs)
y' \<in> above ao
y' \<notin> A

goal (1 subgoal):
 1. y \<le> y'
[PROOF STEP]
by(rule min)
[PROOF STATE]
proof (state)
this:
y \<le> y'

goal (1 subgoal):
 1. y' \<notin> A \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y \<le> y'

goal (1 subgoal):
 1. y' \<notin> A \<Longrightarrow> False
[PROOF STEP]
from y'
[PROOF STATE]
proof (chain)
picking this:
y' \<in> set (x # xs)
[PROOF STEP]
have "y' < z'"
[PROOF STATE]
proof (prove)
using this:
y' \<in> set (x # xs)

goal (1 subgoal):
 1. y' < z'
[PROOF STEP]
by(rule y_less)
[PROOF STATE]
proof (state)
this:
y' < z'

goal (1 subgoal):
 1. y' \<notin> A \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y \<le> y'
y' < z'
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
y \<le> y'
y' < z'

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>y = z'\<close>
[PROOF STATE]
proof (prove)
using this:
y \<le> y'
y' < z'
y = z'

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y' \<in> A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set (x # xs) \<subseteq> A

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (x # xs) \<subseteq> A

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
from z xs
[PROOF STATE]
proof (chain)
picking this:
above ao - set (x # xs) = {z}
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
[PROOF STEP]
have "above ao = insert z (set (x # xs))"
[PROOF STATE]
proof (prove)
using this:
above ao - set (x # xs) = {z}
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. above ao = insert z (set (x # xs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
above ao = insert z (set (x # xs))

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<subseteq> A
above ao = insert z (set (x # xs))
[PROOF STEP]
have "A = above ao"
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<subseteq> A
above ao = insert z (set (x # xs))

goal (1 subgoal):
 1. A = above ao
[PROOF STEP]
using y \<open>y = z'\<close> \<open>z = z'\<close> subset
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<subseteq> A
above ao = insert z (set (x # xs))
y \<in> A
y \<in> above ao
y \<notin> set (x # xs)
y = z'
z = z'
A \<subseteq> above ao

goal (1 subgoal):
 1. A = above ao
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = above ao

goal (1 subgoal):
 1. proper_interval (Some (last (x # xs))) None \<Longrightarrow> False
[PROOF STEP]
with Aless
[PROOF STATE]
proof (chain)
picking this:
A \<sqsubset>' above ao
A = above ao
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
A \<sqsubset>' above ao
A = above ao

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> proper_interval (Some (last (x # xs))) None

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
m = length xs + 2 \<Longrightarrow> \<not> proper_interval (Some (last (x # xs))) None

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao \<Longrightarrow> m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
m \<noteq> length xs + 1
m = length xs + 2 \<Longrightarrow> \<not> proper_interval (Some (last (x # xs))) None
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
m \<noteq> length xs + 1
m = length xs + 2 \<Longrightarrow> \<not> proper_interval (Some (last (x # xs))) None

goal (1 subgoal):
 1. m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao)

goal (2 subgoals):
 1. \<And>ao x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted []; distinct []; set [] \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
 2. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(m \<noteq> length xs + 1 \<and> (m = length xs + 2 \<longrightarrow> \<not> proper_interval (Some (last (x # xs))) None)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' above ao)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)
[PROOF STEP]
by(simp add: length_last_def m_def Let_def del: last.simps)
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) [] = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set [] \<inter> above ao)

goal (1 subgoal):
 1. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case (4 ao x xs y ys)
[PROOF STATE]
proof (state)
this:
\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x))
\<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y))
sorted (x # xs)
distinct (x # xs)
set (x # xs) \<subseteq> above ao
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
note xxs = \<open>sorted (x # xs)\<close> \<open>distinct (x # xs)\<close>
        and yys = \<open>sorted (y # ys)\<close> \<open>distinct (y # ys)\<close>
        and xxs_above = \<open>set (x # xs) \<subseteq> above ao\<close>
        and yys_above = \<open>set (y # ys) \<subseteq> above ao\<close>
[PROOF STATE]
proof (state)
this:
sorted (x # xs)
distinct (x # xs)
sorted (y # ys)
distinct (y # ys)
set (x # xs) \<subseteq> above ao
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
from xxs
[PROOF STATE]
proof (chain)
picking this:
sorted (x # xs)
distinct (x # xs)
[PROOF STEP]
have xs: "sorted xs" "distinct xs" and x_Min: "\<forall>x'\<in>set xs. x < x'"
[PROOF STATE]
proof (prove)
using this:
sorted (x # xs)
distinct (x # xs)

goal (1 subgoal):
 1. (sorted xs &&& distinct xs) &&& \<forall>x'\<in>set xs. x < x'
[PROOF STEP]
by(auto simp add: less_le)
[PROOF STATE]
proof (state)
this:
sorted xs
distinct xs
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
from yys
[PROOF STATE]
proof (chain)
picking this:
sorted (y # ys)
distinct (y # ys)
[PROOF STEP]
have ys: "sorted ys" "distinct ys" and y_Min: "\<forall>y'\<in>set ys. y < y'"
[PROOF STATE]
proof (prove)
using this:
sorted (y # ys)
distinct (y # ys)

goal (1 subgoal):
 1. (sorted ys &&& distinct ys) &&& \<forall>y'\<in>set ys. y < y'
[PROOF STEP]
by(auto simp add: less_le)
[PROOF STATE]
proof (state)
this:
sorted ys
distinct ys
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have len_xs: "length xs = card (set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = card (set xs)
[PROOF STEP]
using xs
[PROOF STATE]
proof (prove)
using this:
sorted xs
distinct xs

goal (1 subgoal):
 1. length xs = card (set xs)
[PROOF STEP]
by(auto simp add: List.card_set intro: sym)
[PROOF STATE]
proof (state)
this:
length xs = card (set xs)

goal (1 subgoal):
 1. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have len_ys: "length ys = card (set ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ys = card (set ys)
[PROOF STEP]
using ys
[PROOF STATE]
proof (prove)
using this:
sorted ys
distinct ys

goal (1 subgoal):
 1. length ys = card (set ys)
[PROOF STEP]
by(auto simp add: List.card_set intro: sym)
[PROOF STATE]
proof (state)
this:
length ys = card (set ys)

goal (1 subgoal):
 1. \<And>ao x xs y ys. \<lbrakk>\<lbrakk>x < y; card (UNIV - above ao) + 1 = card (UNIV - above (Some x)); sorted xs; distinct xs; set xs \<subseteq> above (Some x); sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some x) (card (UNIV - above (Some x))) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)); \<lbrakk>\<not> x < y; y < x; card (UNIV - above ao) + 1 = card (UNIV - above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above (Some y); sorted ys; distinct ys; set ys \<subseteq> above (Some y)\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux (Some y) (card (UNIV - above (Some y))) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)); sorted (x # xs); distinct (x # xs); set (x # xs) \<subseteq> above ao; sorted (y # ys); distinct (y # ys); set (y # ys) \<subseteq> above ao\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
proof(cases "x < y")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x < y \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> x < y \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < y

goal (2 subgoals):
 1. x < y \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> x < y \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "proper_interval ao (Some x) \<or>
          proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys) \<longleftrightarrow>
          (\<exists>A \<subseteq> above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)"
          (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
proof(cases "proper_interval ao (Some x)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
proper_interval ao (Some x)

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
proper_interval ao (Some x)
[PROOF STEP]
obtain z where z: "z \<in> above ao" "z < x"
[PROOF STATE]
proof (prove)
using this:
proper_interval ao (Some x)

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> above ao; z < x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(clarsimp simp add: proper_interval_Some2)
[PROOF STATE]
proof (state)
this:
z \<in> above ao
z < x

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<in> above ao
z < x

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
with xxs
[PROOF STATE]
proof (chain)
picking this:
sorted (x # xs)
distinct (x # xs)
z \<in> above ao
z < x
[PROOF STEP]
have "\<forall>x'\<in>set xs. z < x'"
[PROOF STATE]
proof (prove)
using this:
sorted (x # xs)
distinct (x # xs)
z \<in> above ao
z < x

goal (1 subgoal):
 1. \<forall>x'\<in>set xs. z < x'
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
\<forall>x'\<in>set xs. z < x'

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<in> above ao
z < x
\<forall>x'\<in>set xs. z < x'
[PROOF STEP]
have "set (x # xs) \<sqsubset>' {z}"
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x
\<forall>x'\<in>set xs. z < x'

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' {z}
[PROOF STEP]
by(auto simp add: set_less_aux_def intro!: bexI[where x=z])
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' {z}

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' {z}

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' {z}

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
from z yys \<open>x < y\<close>
[PROOF STATE]
proof (chain)
picking this:
z \<in> above ao
z < x
sorted (y # ys)
distinct (y # ys)
x < y
[PROOF STEP]
have "z < y" "\<forall>y'\<in>set ys. z < y'"
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x
sorted (y # ys)
distinct (y # ys)
x < y

goal (1 subgoal):
 1. z < y &&& \<forall>y'\<in>set ys. z < y'
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
z < y
\<forall>y'\<in>set ys. z < y'

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
hence subset: "{z} \<subseteq> - set (y # ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
using this:
z < y
\<forall>y'\<in>set ys. z < y'

goal (1 subgoal):
 1. {z} \<subseteq> - set (y # ys) \<inter> above ao
[PROOF STEP]
using ys \<open>x < y\<close> z
[PROOF STATE]
proof (prove)
using this:
z < y
\<forall>y'\<in>set ys. z < y'
sorted ys
distinct ys
x < y
z \<in> above ao
z < x

goal (1 subgoal):
 1. {z} \<subseteq> - set (y # ys) \<inter> above ao
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{z} \<subseteq> - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{z} \<subseteq> - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "x \<in> \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> - set (y # ys) \<inter> above ao
[PROOF STEP]
using yys xxs \<open>x < y\<close> xxs_above
[PROOF STATE]
proof (prove)
using this:
sorted (y # ys)
distinct (y # ys)
sorted (x # xs)
distinct (x # xs)
x < y
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. x \<in> - set (y # ys) \<inter> above ao
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
x \<in> - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{z} \<subseteq> - set (y # ys) \<inter> above ao
x \<in> - set (y # ys) \<inter> above ao
[PROOF STEP]
have "{z} \<subset> \<dots>"
[PROOF STATE]
proof (prove)
using this:
{z} \<subseteq> - set (y # ys) \<inter> above ao
x \<in> - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. {z} \<subset> - set (y # ys) \<inter> above ao
[PROOF STEP]
using \<open>z < x\<close>
[PROOF STATE]
proof (prove)
using this:
{z} \<subseteq> - set (y # ys) \<inter> above ao
x \<in> - set (y # ys) \<inter> above ao
z < x

goal (1 subgoal):
 1. {z} \<subset> - set (y # ys) \<inter> above ao
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{z} \<subset> - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
hence "{z} \<sqsubset>' \<dots>"
[PROOF STATE]
proof (prove)
using this:
{z} \<subset> - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. {z} \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by(fastforce intro: psubset_finite_imp_set_less_aux)
[PROOF STATE]
proof (state)
this:
{z} \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
{z} \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{z} \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "{z} \<subseteq> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {z} \<subseteq> above ao
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x

goal (1 subgoal):
 1. {z} \<subseteq> above ao
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{z} \<subseteq> above ao

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' {z}
{z} \<sqsubset>' - set (y # ys) \<inter> above ao
{z} \<subseteq> above ao
[PROOF STEP]
have ?rhs
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' {z}
{z} \<sqsubset>' - set (y # ys) \<inter> above ao
{z} \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
proper_interval ao (Some x)

goal (1 subgoal):
 1. (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> proper_interval ao (Some x)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
hence above_eq: "above ao = insert x (above (Some x))"
[PROOF STATE]
proof (prove)
using this:
\<not> proper_interval ao (Some x)

goal (1 subgoal):
 1. above ao = insert x (above (Some x))
[PROOF STEP]
using xxs_above
[PROOF STATE]
proof (prove)
using this:
\<not> proper_interval ao (Some x)
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. above ao = insert x (above (Some x))
[PROOF STEP]
by(auto simp add: proper_interval_Some2 intro: above_upclosed)
[PROOF STATE]
proof (state)
this:
above ao = insert x (above (Some x))

goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
above ao = insert x (above (Some x))

goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "card (above (Some x)) < CARD('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (above (Some x)) < CARD('a)
[PROOF STEP]
by(rule psubset_card_mono)(auto)
[PROOF STATE]
proof (state)
this:
card (above (Some x)) < CARD('a)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
above ao = insert x (above (Some x))
card (above (Some x)) < CARD('a)
[PROOF STEP]
have card_eq: "card (UNIV - above ao) + 1 = card (UNIV - above (Some x))"
[PROOF STATE]
proof (prove)
using this:
above ao = insert x (above (Some x))
card (above (Some x)) < CARD('a)

goal (1 subgoal):
 1. card (UNIV - above ao) + 1 = card (UNIV - above (Some x))
[PROOF STEP]
by(simp add: card_Diff_subset)
[PROOF STATE]
proof (state)
this:
card (UNIV - above ao) + 1 = card (UNIV - above (Some x))

goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
from xxs_above x_Min
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<subseteq> above ao
\<forall>x'\<in>set xs. x < x'
[PROOF STEP]
have xs_above: "set xs \<subseteq> above (Some x)"
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<subseteq> above ao
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. set xs \<subseteq> above (Some x)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> above (Some x)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
from \<open>x < y\<close> y_Min
[PROOF STATE]
proof (chain)
picking this:
x < y
\<forall>y'\<in>set ys. y < y'
[PROOF STEP]
have "set (y # ys) \<subseteq> above (Some x)"
[PROOF STATE]
proof (prove)
using this:
x < y
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. set (y # ys) \<subseteq> above (Some x)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
set (y # ys) \<subseteq> above (Some x)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
with \<open>x < y\<close> card_eq xs xs_above yys
[PROOF STATE]
proof (chain)
picking this:
x < y
card (UNIV - above ao) + 1 = card (UNIV - above (Some x))
sorted xs
distinct xs
set xs \<subseteq> above (Some x)
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above (Some x)
[PROOF STEP]
have "proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys) \<longleftrightarrow>
               (\<exists>A \<subseteq> above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x))"
[PROOF STATE]
proof (prove)
using this:
x < y
card (UNIV - above ao) + 1 = card (UNIV - above (Some x))
sorted xs
distinct xs
set xs \<subseteq> above (Some x)
sorted (y # ys)
distinct (y # ys)
set (y # ys) \<subseteq> above (Some x)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x))
[PROOF STEP]
by(subst card_eq)(rule 4)
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x))

goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys) = (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x))

goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ?rhs" (is "?lhs' \<longleftrightarrow> _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
assume ?lhs'
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
obtain A where less_A: "set xs \<sqsubset>' A"
              and A_less: "A \<sqsubset>' - set (y # ys) \<inter> above (Some x)"
              and subset: "A \<subseteq> above (Some x)"
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>set xs \<sqsubset>' A; A \<sqsubset>' - set (y # ys) \<inter> above (Some x); A \<subseteq> above (Some x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set xs \<sqsubset>' A
A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
A \<subseteq> above (Some x)

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
let ?A = "insert x A"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have Min_A': "Min ?A = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (insert x A) = x
[PROOF STEP]
using xxs_above False subset
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<subseteq> above ao
\<not> proper_interval ao (Some x)
A \<subseteq> above (Some x)

goal (1 subgoal):
 1. Min (insert x A) = x
[PROOF STEP]
by(auto intro!: Min_eqI simp add: proper_interval_Some2)
[PROOF STATE]
proof (state)
this:
Min (insert x A) = x

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Min (insert x A) = x

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have "Min (set (x # xs)) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (set (x # xs)) = x
[PROOF STEP]
using x_Min
[PROOF STATE]
proof (prove)
using this:
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. Min (set (x # xs)) = x
[PROOF STEP]
by(auto intro!: Min_eqI)
[PROOF STATE]
proof (state)
this:
Min (set (x # xs)) = x

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Min (set (x # xs)) = x

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have Amx: "A - {x} = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A - {x} = A
[PROOF STEP]
using False subset
[PROOF STATE]
proof (prove)
using this:
\<not> proper_interval ao (Some x)
A \<subseteq> above (Some x)

goal (1 subgoal):
 1. A - {x} = A
[PROOF STEP]
by(auto simp add: proper_interval_Some2 intro: above_upclosed)
[PROOF STATE]
proof (state)
this:
A - {x} = A

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A - {x} = A

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have "set xs - {x} = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs - {x} = set xs
[PROOF STEP]
using x_Min
[PROOF STATE]
proof (prove)
using this:
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. set xs - {x} = set xs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set xs - {x} = set xs

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Min (insert x A) = x
Min (set (x # xs)) = x
A - {x} = A
set xs - {x} = set xs
[PROOF STEP]
have less_A': "set (x # xs) \<sqsubset>' ?A"
[PROOF STATE]
proof (prove)
using this:
Min (insert x A) = x
Min (set (x # xs)) = x
A - {x} = A
set xs - {x} = set xs

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' insert x A
[PROOF STEP]
using less_A xxs_above x_Min
[PROOF STATE]
proof (prove)
using this:
Min (insert x A) = x
Min (set (x # xs)) = x
A - {x} = A
set xs - {x} = set xs
set xs \<sqsubset>' A
set (x # xs) \<subseteq> above ao
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' insert x A
[PROOF STEP]
by(subst set_less_aux_rec) simp_all
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' insert x A

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have "x \<in> - insert y (set ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> - insert y (set ys) \<inter> above ao
[PROOF STEP]
using \<open>x < y\<close> xxs_above y_Min
[PROOF STATE]
proof (prove)
using this:
x < y
set (x # xs) \<subseteq> above ao
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. x \<in> - insert y (set ys) \<inter> above ao
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> - insert y (set ys) \<inter> above ao

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
hence "- insert y (set ys) \<inter> above ao \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
x \<in> - insert y (set ys) \<inter> above ao

goal (1 subgoal):
 1. - insert y (set ys) \<inter> above ao \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- insert y (set ys) \<inter> above ao \<noteq> {}

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- insert y (set ys) \<inter> above ao \<noteq> {}

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have "Min (- insert y (set ys) \<inter> above ao) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (- insert y (set ys) \<inter> above ao) = x
[PROOF STEP]
using yys y_Min xxs_above \<open>x < y\<close> False
[PROOF STATE]
proof (prove)
using this:
sorted (y # ys)
distinct (y # ys)
\<forall>y'\<in>set ys. y < y'
set (x # xs) \<subseteq> above ao
x < y
\<not> proper_interval ao (Some x)

goal (1 subgoal):
 1. Min (- insert y (set ys) \<inter> above ao) = x
[PROOF STEP]
by(auto intro!: Min_eqI simp add: proper_interval_Some2)
[PROOF STATE]
proof (state)
this:
Min (- insert y (set ys) \<inter> above ao) = x

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Min (- insert y (set ys) \<inter> above ao) = x

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have "- set (y # ys) \<inter> above ao - {x} = - set (y # ys) \<inter> above (Some x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - set (y # ys) \<inter> above ao - {x} = - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
using yys_above False xxs_above
[PROOF STATE]
proof (prove)
using this:
set (y # ys) \<subseteq> above ao
\<not> proper_interval ao (Some x)
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. - set (y # ys) \<inter> above ao - {x} = - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
by(auto simp add: proper_interval_Some2 intro: above_upclosed)
[PROOF STATE]
proof (state)
this:
- set (y # ys) \<inter> above ao - {x} = - set (y # ys) \<inter> above (Some x)

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- insert y (set ys) \<inter> above ao \<noteq> {}
Min (- insert y (set ys) \<inter> above ao) = x
- set (y # ys) \<inter> above ao - {x} = - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have A'_less: "?A \<sqsubset>' - set (y # ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
using this:
- insert y (set ys) \<inter> above ao \<noteq> {}
Min (- insert y (set ys) \<inter> above ao) = x
- set (y # ys) \<inter> above ao - {x} = - set (y # ys) \<inter> above (Some x)

goal (1 subgoal):
 1. insert x A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
using Min_A' A_less Amx xxs_above
[PROOF STATE]
proof (prove)
using this:
- insert y (set ys) \<inter> above ao \<noteq> {}
Min (- insert y (set ys) \<inter> above ao) = x
- set (y # ys) \<inter> above ao - {x} = - set (y # ys) \<inter> above (Some x)
Min (insert x A) = x
A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
A - {x} = A
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. insert x A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by(subst set_less_aux_rec) simp_all
[PROOF STATE]
proof (state)
this:
insert x A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
insert x A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have "?A \<subseteq> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert x A \<subseteq> above ao
[PROOF STEP]
using subset xxs_above
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> above (Some x)
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. insert x A \<subseteq> above ao
[PROOF STEP]
by(auto intro: above_upclosed)
[PROOF STATE]
proof (state)
this:
insert x A \<subseteq> above ao

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
insert x A \<sqsubset>' - set (y # ys) \<inter> above ao
insert x A \<subseteq> above ao
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
insert x A \<sqsubset>' - set (y # ys) \<inter> above ao
insert x A \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
using less_A'
[PROOF STATE]
proof (prove)
using this:
insert x A \<sqsubset>' - set (y # ys) \<inter> above ao
insert x A \<subseteq> above ao
set (x # xs) \<sqsubset>' insert x A

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
obtain A where less_A: "set (x # xs) \<sqsubset>' A"
              and A_less: "A \<sqsubset>' - set (y # ys) \<inter> above ao"
              and subset: "A \<subseteq> above ao"
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>set (x # xs) \<sqsubset>' A; A \<sqsubset>' - set (y # ys) \<inter> above ao; A \<subseteq> above ao\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
let ?A = "A - {x}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
from less_A subset xxs_above
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' A
A \<subseteq> above ao
set (x # xs) \<subseteq> above ao
[PROOF STEP]
have "set (x # xs) \<inter> above ao \<sqsubset>' A \<inter> above ao"
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<subseteq> above ao
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. set (x # xs) \<inter> above ao \<sqsubset>' A \<inter> above ao
[PROOF STEP]
by(simp add: Int_absorb2)
[PROOF STATE]
proof (state)
this:
set (x # xs) \<inter> above ao \<sqsubset>' A \<inter> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
with False xxs_above subset
[PROOF STATE]
proof (chain)
picking this:
\<not> proper_interval ao (Some x)
set (x # xs) \<subseteq> above ao
A \<subseteq> above ao
set (x # xs) \<inter> above ao \<sqsubset>' A \<inter> above ao
[PROOF STEP]
have "x \<in> A"
[PROOF STATE]
proof (prove)
using this:
\<not> proper_interval ao (Some x)
set (x # xs) \<subseteq> above ao
A \<subseteq> above ao
set (x # xs) \<inter> above ao \<sqsubset>' A \<inter> above ao

goal (1 subgoal):
 1. x \<in> A
[PROOF STEP]
by(auto simp add: set_less_aux_def proper_interval_Some2)
[PROOF STATE]
proof (state)
this:
x \<in> A

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
hence "\<dots> \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
x \<in> A

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

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<noteq> {}

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
from \<open>x \<in> A\<close> False subset
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
\<not> proper_interval ao (Some x)
A \<subseteq> above ao
[PROOF STEP]
have Min_A: "Min A = x"
[PROOF STATE]
proof (prove)
using this:
x \<in> A
\<not> proper_interval ao (Some x)
A \<subseteq> above ao

goal (1 subgoal):
 1. Min A = x
[PROOF STEP]
by(auto intro!: Min_eqI simp add: proper_interval_Some2 not_less)
[PROOF STATE]
proof (state)
this:
Min A = x

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Min A = x

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have "Min (set (x # xs)) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (set (x # xs)) = x
[PROOF STEP]
using x_Min
[PROOF STATE]
proof (prove)
using this:
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. Min (set (x # xs)) = x
[PROOF STEP]
by(auto intro!: Min_eqI)
[PROOF STATE]
proof (state)
this:
Min (set (x # xs)) = x

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Min (set (x # xs)) = x

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have eq_A: "?A \<subseteq> above (Some x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A - {x} \<subseteq> above (Some x)
[PROOF STEP]
using xxs_above False subset
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<subseteq> above ao
\<not> proper_interval ao (Some x)
A \<subseteq> above ao

goal (1 subgoal):
 1. A - {x} \<subseteq> above (Some x)
[PROOF STEP]
by(fastforce simp add: proper_interval_Some2 not_less intro: above_upclosed)
[PROOF STATE]
proof (state)
this:
A - {x} \<subseteq> above (Some x)

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A - {x} \<subseteq> above (Some x)

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have "set xs - {x} = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs - {x} = set xs
[PROOF STEP]
using x_Min
[PROOF STATE]
proof (prove)
using this:
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. set xs - {x} = set xs
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
set xs - {x} = set xs

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> {}
Min A = x
Min (set (x # xs)) = x
A - {x} \<subseteq> above (Some x)
set xs - {x} = set xs
[PROOF STEP]
have less_A': "set xs \<sqsubset>' ?A"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
Min A = x
Min (set (x # xs)) = x
A - {x} \<subseteq> above (Some x)
set xs - {x} = set xs

goal (1 subgoal):
 1. set xs \<sqsubset>' A - {x}
[PROOF STEP]
using xxs_above less_A
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
Min A = x
Min (set (x # xs)) = x
A - {x} \<subseteq> above (Some x)
set xs - {x} = set xs
set (x # xs) \<subseteq> above ao
set (x # xs) \<sqsubset>' A

goal (1 subgoal):
 1. set xs \<sqsubset>' A - {x}
[PROOF STEP]
by(subst (asm) set_less_aux_rec)(simp_all cong: conj_cong)
[PROOF STATE]
proof (state)
this:
set xs \<sqsubset>' A - {x}

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have "x \<in> - insert y (set ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> - insert y (set ys) \<inter> above ao
[PROOF STEP]
using \<open>x < y\<close> xxs_above y_Min
[PROOF STATE]
proof (prove)
using this:
x < y
set (x # xs) \<subseteq> above ao
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. x \<in> - insert y (set ys) \<inter> above ao
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> - insert y (set ys) \<inter> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
hence "- insert y (set ys) \<inter> above ao \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
x \<in> - insert y (set ys) \<inter> above ao

goal (1 subgoal):
 1. - insert y (set ys) \<inter> above ao \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- insert y (set ys) \<inter> above ao \<noteq> {}

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- insert y (set ys) \<inter> above ao \<noteq> {}

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have "Min (- set (y # ys) \<inter> above ao) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (- set (y # ys) \<inter> above ao) = x
[PROOF STEP]
using yys y_Min xxs_above \<open>x < y\<close> False
[PROOF STATE]
proof (prove)
using this:
sorted (y # ys)
distinct (y # ys)
\<forall>y'\<in>set ys. y < y'
set (x # xs) \<subseteq> above ao
x < y
\<not> proper_interval ao (Some x)

goal (1 subgoal):
 1. Min (- set (y # ys) \<inter> above ao) = x
[PROOF STEP]
by(auto intro!: Min_eqI simp add: proper_interval_Some2)
[PROOF STATE]
proof (state)
this:
Min (- set (y # ys) \<inter> above ao) = x

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Min (- set (y # ys) \<inter> above ao) = x

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
have "- set (y # ys) \<inter> above (Some x) = - set (y # ys) \<inter> above ao - {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - set (y # ys) \<inter> above (Some x) = - set (y # ys) \<inter> above ao - {x}
[PROOF STEP]
by(auto simp add: above_eq)
[PROOF STATE]
proof (state)
this:
- set (y # ys) \<inter> above (Some x) = - set (y # ys) \<inter> above ao - {x}

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- insert y (set ys) \<inter> above ao \<noteq> {}
Min (- set (y # ys) \<inter> above ao) = x
- set (y # ys) \<inter> above (Some x) = - set (y # ys) \<inter> above ao - {x}
[PROOF STEP]
have "?A \<sqsubset>' - set (y # ys) \<inter> above (Some x)"
[PROOF STATE]
proof (prove)
using this:
- insert y (set ys) \<inter> above ao \<noteq> {}
Min (- set (y # ys) \<inter> above ao) = x
- set (y # ys) \<inter> above (Some x) = - set (y # ys) \<inter> above ao - {x}

goal (1 subgoal):
 1. A - {x} \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
using A_less \<open>A \<noteq> {}\<close> eq_A Min_A
[PROOF STATE]
proof (prove)
using this:
- insert y (set ys) \<inter> above ao \<noteq> {}
Min (- set (y # ys) \<inter> above ao) = x
- set (y # ys) \<inter> above (Some x) = - set (y # ys) \<inter> above ao - {x}
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<noteq> {}
A - {x} \<subseteq> above (Some x)
Min A = x

goal (1 subgoal):
 1. A - {x} \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
by(subst (asm) set_less_aux_rec) simp_all
[PROOF STATE]
proof (state)
this:
A - {x} \<sqsubset>' - set (y # ys) \<inter> above (Some x)

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
with less_A' eq_A
[PROOF STATE]
proof (chain)
picking this:
set xs \<sqsubset>' A - {x}
A - {x} \<subseteq> above (Some x)
A - {x} \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
show ?lhs'
[PROOF STATE]
proof (prove)
using this:
set xs \<sqsubset>' A - {x}
A - {x} \<subseteq> above (Some x)
A - {x} \<sqsubset>' - set (y # ys) \<inter> above (Some x)

goal (1 subgoal):
 1. \<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>A\<subseteq>above (Some x). set xs \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above (Some x)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
\<not> proper_interval ao (Some x)

goal (1 subgoal):
 1. (proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (2 subgoals):
 1. x < y \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> x < y \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
(proper_interval ao (Some x) \<or> proper_interval_set_Compl_aux (Some x) (card (UNIV - above ao) + 1) xs (y # ys)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
x < y

goal (1 subgoal):
 1. proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. \<not> x < y \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x < y \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x < y

goal (1 subgoal):
 1. \<not> x < y \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
proof(cases "y < x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y < x \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> y < x \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
y < x

goal (2 subgoals):
 1. y < x \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> y < x \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "proper_interval ao (Some y) \<or>
                proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys \<longleftrightarrow>
               (\<exists>A \<subseteq> above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)"
            (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
proof(cases "proper_interval ao (Some y)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
proper_interval ao (Some y)

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
proper_interval ao (Some y)
[PROOF STEP]
obtain z where z: "z \<in> above ao" "z < y"
[PROOF STATE]
proof (prove)
using this:
proper_interval ao (Some y)

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> above ao; z < y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(clarsimp simp add: proper_interval_Some2)
[PROOF STATE]
proof (state)
this:
z \<in> above ao
z < y

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
from xxs \<open>y < x\<close>
[PROOF STATE]
proof (chain)
picking this:
sorted (x # xs)
distinct (x # xs)
y < x
[PROOF STEP]
have "\<forall>x'\<in>set (x # xs). y < x'"
[PROOF STATE]
proof (prove)
using this:
sorted (x # xs)
distinct (x # xs)
y < x

goal (1 subgoal):
 1. \<forall>x'\<in>set (x # xs). y < x'
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
\<forall>x'\<in>set (x # xs). y < x'

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
hence less_A: "set (x # xs) \<sqsubset>' {y}"
[PROOF STATE]
proof (prove)
using this:
\<forall>x'\<in>set (x # xs). y < x'

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' {y}
[PROOF STEP]
by(auto simp add: set_less_aux_def intro!: bexI[where x=y])
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' {y}

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "{y} \<sqsubset>' {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y} \<sqsubset>' {z}
[PROOF STEP]
using z y_Min
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < y
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. {y} \<sqsubset>' {z}
[PROOF STEP]
by(auto simp add: set_less_aux_def intro: bexI[where x=z])
[PROOF STATE]
proof (state)
this:
{y} \<sqsubset>' {z}

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{y} \<sqsubset>' {z}

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "\<dots> \<subseteq> - set (y # ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {z} \<subseteq> - set (y # ys) \<inter> above ao
[PROOF STEP]
using z y_Min
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < y
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. {z} \<subseteq> - set (y # ys) \<inter> above ao
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{z} \<subseteq> - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
hence "{z} \<sqsubseteq>' \<dots>"
[PROOF STATE]
proof (prove)
using this:
{z} \<subseteq> - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. {z} \<sqsubseteq>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by(auto intro: subset_finite_imp_set_less_eq_aux)
[PROOF STATE]
proof (state)
this:
{z} \<sqsubseteq>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{y} \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "{y} \<sqsubset>' \<dots>"
[PROOF STATE]
proof (prove)
using this:
{y} \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. {y} \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
{y} \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{y} \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "{y} \<subseteq> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y} \<subseteq> above ao
[PROOF STEP]
using yys_above
[PROOF STATE]
proof (prove)
using this:
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. {y} \<subseteq> above ao
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{y} \<subseteq> above ao

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{y} \<sqsubset>' - set (y # ys) \<inter> above ao
{y} \<subseteq> above ao
[PROOF STEP]
have ?rhs
[PROOF STATE]
proof (prove)
using this:
{y} \<sqsubset>' - set (y # ys) \<inter> above ao
{y} \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
using less_A
[PROOF STATE]
proof (prove)
using this:
{y} \<sqsubset>' - set (y # ys) \<inter> above ao
{y} \<subseteq> above ao
set (x # xs) \<sqsubset>' {y}

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
proper_interval ao (Some y)

goal (1 subgoal):
 1. (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> proper_interval ao (Some y)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
hence above_eq: "above ao = insert y (above (Some y))"
[PROOF STATE]
proof (prove)
using this:
\<not> proper_interval ao (Some y)

goal (1 subgoal):
 1. above ao = insert y (above (Some y))
[PROOF STEP]
using yys_above
[PROOF STATE]
proof (prove)
using this:
\<not> proper_interval ao (Some y)
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. above ao = insert y (above (Some y))
[PROOF STEP]
by(auto simp add: proper_interval_Some2 intro: above_upclosed)
[PROOF STATE]
proof (state)
this:
above ao = insert y (above (Some y))

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
above ao = insert y (above (Some y))

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "card (above (Some y)) < CARD('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (above (Some y)) < CARD('a)
[PROOF STEP]
by(rule psubset_card_mono)(auto)
[PROOF STATE]
proof (state)
this:
card (above (Some y)) < CARD('a)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
above ao = insert y (above (Some y))
card (above (Some y)) < CARD('a)
[PROOF STEP]
have card_eq: "card (UNIV - above ao) + 1 = card (UNIV - above (Some y))"
[PROOF STATE]
proof (prove)
using this:
above ao = insert y (above (Some y))
card (above (Some y)) < CARD('a)

goal (1 subgoal):
 1. card (UNIV - above ao) + 1 = card (UNIV - above (Some y))
[PROOF STEP]
by(simp add: card_Diff_subset)
[PROOF STATE]
proof (state)
this:
card (UNIV - above ao) + 1 = card (UNIV - above (Some y))

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
from yys_above y_Min
[PROOF STATE]
proof (chain)
picking this:
set (y # ys) \<subseteq> above ao
\<forall>y'\<in>set ys. y < y'
[PROOF STEP]
have ys_above: "set ys \<subseteq> above (Some y)"
[PROOF STATE]
proof (prove)
using this:
set (y # ys) \<subseteq> above ao
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. set ys \<subseteq> above (Some y)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
set ys \<subseteq> above (Some y)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have eq_ys: "- set ys \<inter> above (Some y) = - set (y # ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - set ys \<inter> above (Some y) = - set (y # ys) \<inter> above ao
[PROOF STEP]
by(auto simp add: above_eq)
[PROOF STATE]
proof (state)
this:
- set ys \<inter> above (Some y) = - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
from \<open>y < x\<close> x_Min
[PROOF STATE]
proof (chain)
picking this:
y < x
\<forall>x'\<in>set xs. x < x'
[PROOF STEP]
have "set (x # xs) \<subseteq> above (Some y)"
[PROOF STATE]
proof (prove)
using this:
y < x
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. set (x # xs) \<subseteq> above (Some y)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
set (x # xs) \<subseteq> above (Some y)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
with \<open>\<not> x < y\<close> \<open>y < x\<close> card_eq xxs ys ys_above
[PROOF STATE]
proof (chain)
picking this:
\<not> x < y
y < x
card (UNIV - above ao) + 1 = card (UNIV - above (Some y))
sorted (x # xs)
distinct (x # xs)
sorted ys
distinct ys
set ys \<subseteq> above (Some y)
set (x # xs) \<subseteq> above (Some y)
[PROOF STEP]
have "proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys \<longleftrightarrow>
              (\<exists>A \<subseteq> above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y))"
[PROOF STATE]
proof (prove)
using this:
\<not> x < y
y < x
card (UNIV - above ao) + 1 = card (UNIV - above (Some y))
sorted (x # xs)
distinct (x # xs)
sorted ys
distinct ys
set ys \<subseteq> above (Some y)
set (x # xs) \<subseteq> above (Some y)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y))
[PROOF STEP]
by(subst card_eq)(rule 4)
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y))

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys = (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y))

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ?rhs" (is "?lhs' \<longleftrightarrow> _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
assume ?lhs'
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
obtain A where "set (x # xs) \<sqsubset>' A" and subset: "A \<subseteq> above (Some y)"
                and "A \<sqsubset>' - set ys \<inter> above (Some y)"
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>set (x # xs) \<sqsubset>' A; A \<subseteq> above (Some y); A \<sqsubset>' - set ys \<inter> above (Some y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A
A \<subseteq> above (Some y)
A \<sqsubset>' - set ys \<inter> above (Some y)

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A
A \<subseteq> above (Some y)
A \<sqsubset>' - set ys \<inter> above (Some y)

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
from subset
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> above (Some y)
[PROOF STEP]
have "A - {y} = A"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> above (Some y)

goal (1 subgoal):
 1. A - {y} = A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A - {y} = A

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' A
A \<subseteq> above (Some y)
A \<sqsubset>' - set ys \<inter> above (Some y)
A - {y} = A
[PROOF STEP]
have "set (x # xs) \<sqsubset>' A - {y}"
                and "A - {y} \<sqsubset>' - set (y # ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<subseteq> above (Some y)
A \<sqsubset>' - set ys \<inter> above (Some y)
A - {y} = A

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' A - {y} &&& A - {y} \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
using eq_ys
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<subseteq> above (Some y)
A \<sqsubset>' - set ys \<inter> above (Some y)
A - {y} = A
- set ys \<inter> above (Some y) = - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' A - {y} &&& A - {y} \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A - {y}
A - {y} \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A - {y}
A - {y} \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
from subset
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> above (Some y)
[PROOF STEP]
have "A - {y} \<subseteq> above ao"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> above (Some y)

goal (1 subgoal):
 1. A - {y} \<subseteq> above ao
[PROOF STEP]
using yys_above
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> above (Some y)
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. A - {y} \<subseteq> above ao
[PROOF STEP]
by(auto intro: above_upclosed)
[PROOF STATE]
proof (state)
this:
A - {y} \<subseteq> above ao

goal (2 subgoals):
 1. \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y) \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' A - {y}
A - {y} \<sqsubset>' - set (y # ys) \<inter> above ao
A - {y} \<subseteq> above ao
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A - {y}
A - {y} \<sqsubset>' - set (y # ys) \<inter> above ao
A - {y} \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
obtain A where "set (x # xs) \<sqsubset>' A"
                and A_less: "A \<sqsubset>' - set (y # ys) \<inter> above ao"
                and subset: "A \<subseteq> above ao"
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>set (x # xs) \<sqsubset>' A; A \<sqsubset>' - set (y # ys) \<inter> above ao; A \<subseteq> above ao\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
from A_less False yys_above
[PROOF STATE]
proof (chain)
picking this:
A \<sqsubset>' - set (y # ys) \<inter> above ao
\<not> proper_interval ao (Some y)
set (y # ys) \<subseteq> above ao
[PROOF STEP]
have "y \<notin> A"
[PROOF STATE]
proof (prove)
using this:
A \<sqsubset>' - set (y # ys) \<inter> above ao
\<not> proper_interval ao (Some y)
set (y # ys) \<subseteq> above ao

goal (1 subgoal):
 1. y \<notin> A
[PROOF STEP]
by(auto simp add: set_less_aux_def proper_interval_Some2 not_less)
[PROOF STATE]
proof (state)
this:
y \<notin> A

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<subseteq> above ao
y \<notin> A
[PROOF STEP]
have "set (x # xs) \<sqsubset>' A"
                and "A \<sqsubset>' - set ys \<inter> above (Some y)"
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<subseteq> above ao
y \<notin> A

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' A &&& A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
using eq_ys
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<subseteq> above ao
y \<notin> A
- set ys \<inter> above (Some y) = - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' A &&& A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set ys \<inter> above (Some y)

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set ys \<inter> above (Some y)

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
from \<open>y \<notin> A\<close> subset above_eq
[PROOF STATE]
proof (chain)
picking this:
y \<notin> A
A \<subseteq> above ao
above ao = insert y (above (Some y))
[PROOF STEP]
have "A \<subseteq> above (Some y)"
[PROOF STATE]
proof (prove)
using this:
y \<notin> A
A \<subseteq> above ao
above ao = insert y (above (Some y))

goal (1 subgoal):
 1. A \<subseteq> above (Some y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<subseteq> above (Some y)

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set ys \<inter> above (Some y)
A \<subseteq> above (Some y)
[PROOF STEP]
show ?lhs'
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set ys \<inter> above (Some y)
A \<subseteq> above (Some y)

goal (1 subgoal):
 1. \<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>A\<subseteq>above (Some y). set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above (Some y)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. \<not> proper_interval ao (Some y) \<Longrightarrow> (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
\<not> proper_interval ao (Some y)

goal (1 subgoal):
 1. (proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (2 subgoals):
 1. y < x \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> y < x \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
with False True
[PROOF STATE]
proof (chain)
picking this:
\<not> x < y
y < x
(proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> x < y
y < x
(proper_interval ao (Some y) \<or> proper_interval_set_Compl_aux (Some y) (card (UNIV - above ao) + 1) (x # xs) ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. \<not> y < x \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> y < x \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> y < x

goal (1 subgoal):
 1. \<not> y < x \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
with \<open>\<not> x < y\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> x < y
\<not> y < x
[PROOF STEP]
have "x = y"
[PROOF STATE]
proof (prove)
using this:
\<not> x < y
\<not> y < x

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

goal (1 subgoal):
 1. \<not> y < x \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "proper_interval ao (Some x) \<and>
                (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or>
                 CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2) \<longleftrightarrow>
               (\<exists>A \<subseteq> above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)"
            (is "?below \<and> ?card \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
proof(cases "?below")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> proper_interval ao (Some x)

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
hence "- set (y # ys) \<inter> above ao \<sqsubset>' set (x # xs)"
[PROOF STATE]
proof (prove)
using this:
\<not> proper_interval ao (Some x)

goal (1 subgoal):
 1. - set (y # ys) \<inter> above ao \<sqsubset>' set (x # xs)
[PROOF STEP]
using \<open>x = y\<close> yys_above xxs_above y_Min
[PROOF STATE]
proof (prove)
using this:
\<not> proper_interval ao (Some x)
x = y
set (y # ys) \<subseteq> above ao
set (x # xs) \<subseteq> above ao
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. - set (y # ys) \<inter> above ao \<sqsubset>' set (x # xs)
[PROOF STEP]
by(auto simp add: not_less set_less_aux_def proper_interval_Some2 intro!: bexI[where x=y])
[PROOF STATE]
proof (state)
this:
- set (y # ys) \<inter> above ao \<sqsubset>' set (x # xs)

goal (2 subgoals):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
 2. \<not> proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
\<not> proper_interval ao (Some x)
- set (y # ys) \<inter> above ao \<sqsubset>' set (x # xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> proper_interval ao (Some x)
- set (y # ys) \<inter> above ao \<sqsubset>' set (x # xs)

goal (1 subgoal):
 1. (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
by(auto dest: set_less_aux_trans)
[PROOF STATE]
proof (state)
this:
(proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
proper_interval ao (Some x)

goal (1 subgoal):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
proper_interval ao (Some x)
[PROOF STEP]
obtain z where z: "z \<in> above ao" "z < x"
[PROOF STATE]
proof (prove)
using this:
proper_interval ao (Some x)

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> above ao; z < x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(clarsimp simp add: proper_interval_Some2)
[PROOF STATE]
proof (state)
this:
z \<in> above ao
z < x

goal (1 subgoal):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
have "?card \<longleftrightarrow> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
obtain A where less_A: "set (x # xs)  \<sqsubset>' A"
                and A_less: "A \<sqsubset>' - set (y # ys) \<inter> above ao"
                and subset: "A \<subseteq> above ao"
[PROOF STATE]
proof (prove)
using this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>set (x # xs) \<sqsubset>' A; A \<sqsubset>' - set (y # ys) \<inter> above ao; A \<subseteq> above ao\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<subseteq> above ao

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<subseteq> above ao

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
assume c_ys: "CARD('a) - (card (UNIV - above ao) + length ys) = 2"
                  and c_xs: "CARD('a) - (card (UNIV - above ao) + length xs) = 2"
[PROOF STATE]
proof (state)
this:
CARD('a) - (card (UNIV - above ao) + length ys) = 2
CARD('a) - (card (UNIV - above ao) + length xs) = 2

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
from c_ys yys_above len_ys y_Min
[PROOF STATE]
proof (chain)
picking this:
CARD('a) - (card (UNIV - above ao) + length ys) = 2
set (y # ys) \<subseteq> above ao
length ys = card (set ys)
\<forall>y'\<in>set ys. y < y'
[PROOF STEP]
have "card (UNIV - (UNIV - above ao) - set (y # ys)) = 1"
[PROOF STATE]
proof (prove)
using this:
CARD('a) - (card (UNIV - above ao) + length ys) = 2
set (y # ys) \<subseteq> above ao
length ys = card (set ys)
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. card (UNIV - (UNIV - above ao) - set (y # ys)) = 1
[PROOF STEP]
by(subst card_Diff_subset)(auto simp add: card_Diff_subset)
[PROOF STATE]
proof (state)
this:
card (UNIV - (UNIV - above ao) - set (y # ys)) = 1

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (UNIV - (UNIV - above ao) - set (y # ys)) = 1
[PROOF STEP]
obtain z' where eq_y: "- set (y # ys) \<inter> above ao = {z'}"
[PROOF STATE]
proof (prove)
using this:
card (UNIV - (UNIV - above ao) - set (y # ys)) = 1

goal (1 subgoal):
 1. (\<And>z'. - set (y # ys) \<inter> above ao = {z'} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding card_eq_1_iff
[PROOF STATE]
proof (prove)
using this:
\<exists>x. UNIV - (UNIV - above ao) - set (y # ys) = {x}

goal (1 subgoal):
 1. (\<And>z'. - set (y # ys) \<inter> above ao = {z'} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- set (y # ys) \<inter> above ao = {z'}

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- set (y # ys) \<inter> above ao = {z'}

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
from z
[PROOF STATE]
proof (chain)
picking this:
z \<in> above ao
z < x
[PROOF STEP]
have "z \<notin> set (y # ys)"
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x

goal (1 subgoal):
 1. z \<notin> set (y # ys)
[PROOF STEP]
using \<open>x = y\<close> y_Min
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x
x = y
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. z \<notin> set (y # ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<notin> set (y # ys)

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- set (y # ys) \<inter> above ao = {z'}
z \<notin> set (y # ys)
[PROOF STEP]
have "z' = z"
[PROOF STATE]
proof (prove)
using this:
- set (y # ys) \<inter> above ao = {z'}
z \<notin> set (y # ys)

goal (1 subgoal):
 1. z' = z
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
- set (y # ys) \<inter> above ao = {z'}
z \<notin> set (y # ys)
z \<in> above ao
z < x

goal (1 subgoal):
 1. z' = z
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
z' = z

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
from c_xs xxs_above len_xs x_Min
[PROOF STATE]
proof (chain)
picking this:
CARD('a) - (card (UNIV - above ao) + length xs) = 2
set (x # xs) \<subseteq> above ao
length xs = card (set xs)
\<forall>x'\<in>set xs. x < x'
[PROOF STEP]
have "card (UNIV - (UNIV - above ao) - set (x # xs)) = 1"
[PROOF STATE]
proof (prove)
using this:
CARD('a) - (card (UNIV - above ao) + length xs) = 2
set (x # xs) \<subseteq> above ao
length xs = card (set xs)
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. card (UNIV - (UNIV - above ao) - set (x # xs)) = 1
[PROOF STEP]
by(subst card_Diff_subset)(auto simp add: card_Diff_subset)
[PROOF STATE]
proof (state)
this:
card (UNIV - (UNIV - above ao) - set (x # xs)) = 1

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (UNIV - (UNIV - above ao) - set (x # xs)) = 1
[PROOF STEP]
obtain z'' where eq_x: "- set (x # xs) \<inter> above ao = {z''}"
[PROOF STATE]
proof (prove)
using this:
card (UNIV - (UNIV - above ao) - set (x # xs)) = 1

goal (1 subgoal):
 1. (\<And>z''. - set (x # xs) \<inter> above ao = {z''} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding card_eq_1_iff
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. UNIV - (UNIV - above ao) - set (x # xs) = {xa}

goal (1 subgoal):
 1. (\<And>z''. - set (x # xs) \<inter> above ao = {z''} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- set (x # xs) \<inter> above ao = {z''}

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- set (x # xs) \<inter> above ao = {z''}

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
from z
[PROOF STATE]
proof (chain)
picking this:
z \<in> above ao
z < x
[PROOF STEP]
have "z \<notin> set (x # xs)"
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x

goal (1 subgoal):
 1. z \<notin> set (x # xs)
[PROOF STEP]
using x_Min
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. z \<notin> set (x # xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<notin> set (x # xs)

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- set (x # xs) \<inter> above ao = {z''}
z \<notin> set (x # xs)
[PROOF STEP]
have "z'' = z"
[PROOF STATE]
proof (prove)
using this:
- set (x # xs) \<inter> above ao = {z''}
z \<notin> set (x # xs)

goal (1 subgoal):
 1. z'' = z
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
- set (x # xs) \<inter> above ao = {z''}
z \<notin> set (x # xs)
z \<in> above ao
z < x

goal (1 subgoal):
 1. z'' = z
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
z'' = z

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
from less_A subset
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' A
A \<subseteq> above ao
[PROOF STEP]
obtain q where "q \<in> A" "q \<in> above ao" "q \<notin> set (x # xs)"
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<subseteq> above ao

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>q \<in> A; q \<in> above ao; q \<notin> set (x # xs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto simp add: set_less_aux_def)
[PROOF STATE]
proof (state)
this:
q \<in> A
q \<in> above ao
q \<notin> set (x # xs)

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
hence "q \<in> {z''}"
[PROOF STATE]
proof (prove)
using this:
q \<in> A
q \<in> above ao
q \<notin> set (x # xs)

goal (1 subgoal):
 1. q \<in> {z''}
[PROOF STEP]
unfolding eq_x[symmetric]
[PROOF STATE]
proof (prove)
using this:
q \<in> A
q \<in> above ao
q \<notin> set (x # xs)

goal (1 subgoal):
 1. q \<in> - set (x # xs) \<inter> above ao
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q \<in> {z''}

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
hence "q = z''"
[PROOF STATE]
proof (prove)
using this:
q \<in> {z''}

goal (1 subgoal):
 1. q = z''
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q = z''

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
with \<open>q \<in> A\<close> \<open>z' = z\<close> \<open>z'' = z\<close> z
[PROOF STATE]
proof (chain)
picking this:
q \<in> A
z' = z
z'' = z
z \<in> above ao
z < x
q = z''
[PROOF STEP]
have "- set (y # ys) \<inter> above ao \<subseteq> A"
[PROOF STATE]
proof (prove)
using this:
q \<in> A
z' = z
z'' = z
z \<in> above ao
z < x
q = z''

goal (1 subgoal):
 1. - set (y # ys) \<inter> above ao \<subseteq> A
[PROOF STEP]
unfolding eq_y
[PROOF STATE]
proof (prove)
using this:
q \<in> A
z' = z
z'' = z
z \<in> above ao
z < x
q = z''

goal (1 subgoal):
 1. {z'} \<subseteq> A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- set (y # ys) \<inter> above ao \<subseteq> A

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
hence "- set (y # ys) \<inter> above ao \<sqsubseteq>' A"
[PROOF STATE]
proof (prove)
using this:
- set (y # ys) \<inter> above ao \<subseteq> A

goal (1 subgoal):
 1. - set (y # ys) \<inter> above ao \<sqsubseteq>' A
[PROOF STEP]
by(auto intro: subset_finite_imp_set_less_eq_aux)
[PROOF STATE]
proof (state)
this:
- set (y # ys) \<inter> above ao \<sqsubseteq>' A

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
with A_less
[PROOF STATE]
proof (chain)
picking this:
A \<sqsubset>' - set (y # ys) \<inter> above ao
- set (y # ys) \<inter> above ao \<sqsubseteq>' A
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
A \<sqsubset>' - set (y # ys) \<inter> above ao
- set (y # ys) \<inter> above ao \<sqsubseteq>' A

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

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>CARD('a) - (card (UNIV - above ao) + length ys) = 2; CARD('a) - (card (UNIV - above ao) + length xs) = 2\<rbrakk> \<Longrightarrow> False

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao \<Longrightarrow> CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
thus ?card
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>CARD('a) - (card (UNIV - above ao) + length ys) = 2; CARD('a) - (card (UNIV - above ao) + length xs) = 2\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
assume ?card (is "?card_ys \<or> ?card_xs")
[PROOF STATE]
proof (state)
this:
CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
thus ?rhs
[PROOF STATE]
proof (prove)
using this:
CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
assume ?card_ys
[PROOF STATE]
proof (state)
this:
CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
let ?YS = "UNIV - (UNIV - above ao) - set (y # ys)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
from \<open>?card_ys\<close> yys_above len_ys y_Min
[PROOF STATE]
proof (chain)
picking this:
CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2
set (y # ys) \<subseteq> above ao
length ys = card (set ys)
\<forall>y'\<in>set ys. y < y'
[PROOF STEP]
have "card ?YS \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2
set (y # ys) \<subseteq> above ao
length ys = card (set ys)
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. card (UNIV - (UNIV - above ao) - set (y # ys)) \<noteq> 1
[PROOF STEP]
by(subst card_Diff_subset)(auto simp add: card_Diff_subset)
[PROOF STATE]
proof (state)
this:
card (UNIV - (UNIV - above ao) - set (y # ys)) \<noteq> 1

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (UNIV - (UNIV - above ao) - set (y # ys)) \<noteq> 1

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "?YS \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV - (UNIV - above ao) - set (y # ys) \<noteq> {}
[PROOF STEP]
using True y_Min yys_above \<open>x = y\<close>
[PROOF STATE]
proof (prove)
using this:
proper_interval ao (Some x)
\<forall>y'\<in>set ys. y < y'
set (y # ys) \<subseteq> above ao
x = y

goal (1 subgoal):
 1. UNIV - (UNIV - above ao) - set (y # ys) \<noteq> {}
[PROOF STEP]
by(fastforce simp add: proper_interval_Some2)
[PROOF STATE]
proof (state)
this:
UNIV - (UNIV - above ao) - set (y # ys) \<noteq> {}

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "card ?YS \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
UNIV - (UNIV - above ao) - set (y # ys) \<noteq> {}

goal (1 subgoal):
 1. card (UNIV - (UNIV - above ao) - set (y # ys)) \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (UNIV - (UNIV - above ao) - set (y # ys)) \<noteq> 0

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (UNIV - (UNIV - above ao) - set (y # ys)) \<noteq> 1
card (UNIV - (UNIV - above ao) - set (y # ys)) \<noteq> 0
[PROOF STEP]
have "card ?YS > 1"
[PROOF STATE]
proof (prove)
using this:
card (UNIV - (UNIV - above ao) - set (y # ys)) \<noteq> 1
card (UNIV - (UNIV - above ao) - set (y # ys)) \<noteq> 0

goal (1 subgoal):
 1. 1 < card (UNIV - (UNIV - above ao) - set (y # ys))
[PROOF STEP]
by(cases "card ?YS") simp_all
[PROOF STATE]
proof (state)
this:
1 < card (UNIV - (UNIV - above ao) - set (y # ys))

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
from card_gt_1D[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>x ya. x \<in> UNIV - (UNIV - above ao) - set (y # ys) \<and> ya \<in> UNIV - (UNIV - above ao) - set (y # ys) \<and> x \<noteq> ya
[PROOF STEP]
obtain x' y'
                  where x': "x' \<in> above ao" "x' \<notin> set (y # ys)"
                  and y': "y' \<in> above ao" "y' \<notin> set (y # ys)"
                  and neq: "x' \<noteq> y'"
[PROOF STATE]
proof (prove)
using this:
\<exists>x ya. x \<in> UNIV - (UNIV - above ao) - set (y # ys) \<and> ya \<in> UNIV - (UNIV - above ao) - set (y # ys) \<and> x \<noteq> ya

goal (1 subgoal):
 1. (\<And>x' y'. \<lbrakk>x' \<in> above ao; x' \<notin> set (y # ys); y' \<in> above ao; y' \<notin> set (y # ys); x' \<noteq> y'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x' \<in> above ao
x' \<notin> set (y # ys)
y' \<in> above ao
y' \<notin> set (y # ys)
x' \<noteq> y'

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
let ?A = "{z}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "set (x # xs) \<sqsubset>' ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' {z}
[PROOF STEP]
using z x_Min
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' {z}
[PROOF STEP]
by(auto simp add: set_less_aux_def intro!: rev_bexI)
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' {z}

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' {z}

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' {z}

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "?A \<subseteq> - set (y # ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {z} \<subseteq> - set (y # ys) \<inter> above ao
[PROOF STEP]
using z \<open>x = y\<close> y_Min
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x
x = y
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. {z} \<subseteq> - set (y # ys) \<inter> above ao
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
{z} \<subseteq> - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{z} \<subseteq> - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "x' \<notin> ?A \<or> y' \<notin> ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' \<notin> {z} \<or> y' \<notin> {z}
[PROOF STEP]
using neq
[PROOF STATE]
proof (prove)
using this:
x' \<noteq> y'

goal (1 subgoal):
 1. x' \<notin> {z} \<or> y' \<notin> {z}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x' \<notin> {z} \<or> y' \<notin> {z}

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
with x' y'
[PROOF STATE]
proof (chain)
picking this:
x' \<in> above ao
x' \<notin> set (y # ys)
y' \<in> above ao
y' \<notin> set (y # ys)
x' \<notin> {z} \<or> y' \<notin> {z}
[PROOF STEP]
have "?A \<noteq> - set (y # ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
using this:
x' \<in> above ao
x' \<notin> set (y # ys)
y' \<in> above ao
y' \<notin> set (y # ys)
x' \<notin> {z} \<or> y' \<notin> {z}

goal (1 subgoal):
 1. {z} \<noteq> - set (y # ys) \<inter> above ao
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{z} \<noteq> - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{z} \<subseteq> - set (y # ys) \<inter> above ao
{z} \<noteq> - set (y # ys) \<inter> above ao
[PROOF STEP]
have "?A \<subset> - set (y # ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
using this:
{z} \<subseteq> - set (y # ys) \<inter> above ao
{z} \<noteq> - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. {z} \<subset> - set (y # ys) \<inter> above ao
[PROOF STEP]
by(rule psubsetI)
[PROOF STATE]
proof (state)
this:
{z} \<subset> - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "?A \<sqsubset>' \<dots>"
[PROOF STATE]
proof (prove)
using this:
{z} \<subset> - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. {z} \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by(fastforce intro: psubset_finite_imp_set_less_aux)
[PROOF STATE]
proof (state)
this:
{z} \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
{z} \<sqsubset>' - set (y # ys) \<inter> above ao

goal (2 subgoals):
 1. CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
 2. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' {z}
{z} \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' {z}
{z} \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' {z}
{z} \<sqsubset>' - set (y # ys) \<inter> above ao
z \<in> above ao
z < x

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
assume ?card_xs
[PROOF STATE]
proof (state)
this:
CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
let ?XS = "UNIV - (UNIV - above ao) - set (x # xs)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
from \<open>?card_xs\<close> xxs_above len_xs x_Min
[PROOF STATE]
proof (chain)
picking this:
CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
set (x # xs) \<subseteq> above ao
length xs = card (set xs)
\<forall>x'\<in>set xs. x < x'
[PROOF STEP]
have "card ?XS \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2
set (x # xs) \<subseteq> above ao
length xs = card (set xs)
\<forall>x'\<in>set xs. x < x'

goal (1 subgoal):
 1. card (UNIV - (UNIV - above ao) - set (x # xs)) \<noteq> 1
[PROOF STEP]
by(subst card_Diff_subset)(auto simp add: card_Diff_subset)
[PROOF STATE]
proof (state)
this:
card (UNIV - (UNIV - above ao) - set (x # xs)) \<noteq> 1

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (UNIV - (UNIV - above ao) - set (x # xs)) \<noteq> 1

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "?XS \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV - (UNIV - above ao) - set (x # xs) \<noteq> {}
[PROOF STEP]
using True x_Min xxs_above
[PROOF STATE]
proof (prove)
using this:
proper_interval ao (Some x)
\<forall>x'\<in>set xs. x < x'
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. UNIV - (UNIV - above ao) - set (x # xs) \<noteq> {}
[PROOF STEP]
by(fastforce simp add: proper_interval_Some2)
[PROOF STATE]
proof (state)
this:
UNIV - (UNIV - above ao) - set (x # xs) \<noteq> {}

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "card ?XS \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
UNIV - (UNIV - above ao) - set (x # xs) \<noteq> {}

goal (1 subgoal):
 1. card (UNIV - (UNIV - above ao) - set (x # xs)) \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (UNIV - (UNIV - above ao) - set (x # xs)) \<noteq> 0

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (UNIV - (UNIV - above ao) - set (x # xs)) \<noteq> 1
card (UNIV - (UNIV - above ao) - set (x # xs)) \<noteq> 0
[PROOF STEP]
have "card ?XS > 1"
[PROOF STATE]
proof (prove)
using this:
card (UNIV - (UNIV - above ao) - set (x # xs)) \<noteq> 1
card (UNIV - (UNIV - above ao) - set (x # xs)) \<noteq> 0

goal (1 subgoal):
 1. 1 < card (UNIV - (UNIV - above ao) - set (x # xs))
[PROOF STEP]
by(cases "card ?XS") simp_all
[PROOF STATE]
proof (state)
this:
1 < card (UNIV - (UNIV - above ao) - set (x # xs))

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
from card_gt_1D[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>xa y. xa \<in> UNIV - (UNIV - above ao) - set (x # xs) \<and> y \<in> UNIV - (UNIV - above ao) - set (x # xs) \<and> xa \<noteq> y
[PROOF STEP]
obtain x' y'
                  where x': "x' \<in> above ao" "x' \<notin> set (x # xs)"
                  and y': "y' \<in> above ao" "y' \<notin> set (x # xs)"
                  and neq: "x' \<noteq> y'"
[PROOF STATE]
proof (prove)
using this:
\<exists>xa y. xa \<in> UNIV - (UNIV - above ao) - set (x # xs) \<and> y \<in> UNIV - (UNIV - above ao) - set (x # xs) \<and> xa \<noteq> y

goal (1 subgoal):
 1. (\<And>x' y'. \<lbrakk>x' \<in> above ao; x' \<notin> set (x # xs); y' \<in> above ao; y' \<notin> set (x # xs); x' \<noteq> y'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x' \<in> above ao
x' \<notin> set (x # xs)
y' \<in> above ao
y' \<notin> set (x # xs)
x' \<noteq> y'

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
define A
                  where "A = (if x' = Min (above ao) then insert y' (set (x # xs)) else insert x' (set (x # xs)))"
[PROOF STATE]
proof (state)
this:
A = (if x' = Min (above ao) then insert y' (set (x # xs)) else insert x' (set (x # xs)))

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "set (x # xs) \<subseteq> A"
[PROOF STATE]
proof (prove)
using this:
A = (if x' = Min (above ao) then insert y' (set (x # xs)) else insert x' (set (x # xs)))

goal (1 subgoal):
 1. set (x # xs) \<subseteq> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (x # xs) \<subseteq> A

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (x # xs) \<subseteq> A

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "set (x # xs) \<noteq> \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (x # xs) \<noteq> A
[PROOF STEP]
using neq x' y'
[PROOF STATE]
proof (prove)
using this:
x' \<noteq> y'
x' \<in> above ao
x' \<notin> set (x # xs)
y' \<in> above ao
y' \<notin> set (x # xs)

goal (1 subgoal):
 1. set (x # xs) \<noteq> A
[PROOF STEP]
by(auto simp add: A_def)
[PROOF STATE]
proof (state)
this:
set (x # xs) \<noteq> A

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<subseteq> A
set (x # xs) \<noteq> A
[PROOF STEP]
have "set (x # xs) \<subset> A"
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<subseteq> A
set (x # xs) \<noteq> A

goal (1 subgoal):
 1. set (x # xs) \<subset> A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
set (x # xs) \<subset> A

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "set (x # xs) \<sqsubset>' \<dots>"
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<subset> A

goal (1 subgoal):
 1. set (x # xs) \<sqsubset>' A
[PROOF STEP]
by(fastforce intro: psubset_finite_imp_set_less_aux)
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
set (x # xs) \<sqsubset>' A

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have nempty: "above ao \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. above ao \<noteq> {}
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x

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

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "A \<sqsubset>' {Min (above ao)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<sqsubset>' {Min (above ao)}
[PROOF STEP]
using z x' y' neq \<open>x = y\<close> x_Min xxs_above
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x
x' \<in> above ao
x' \<notin> set (x # xs)
y' \<in> above ao
y' \<notin> set (x # xs)
x' \<noteq> y'
x = y
\<forall>x'\<in>set xs. x < x'
set (x # xs) \<subseteq> above ao

goal (1 subgoal):
 1. A \<sqsubset>' {Min (above ao)}
[PROOF STEP]
by(auto 6 4 simp add: set_less_aux_def A_def nempty intro!: rev_bexI Min_eqI)
[PROOF STATE]
proof (state)
this:
A \<sqsubset>' {Min (above ao)}

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A \<sqsubset>' {Min (above ao)}

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "Min (above ao) \<le> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (above ao) \<le> z
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
z \<in> above ao
z < x

goal (1 subgoal):
 1. Min (above ao) \<le> z
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
Min (above ao) \<le> z

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "Min (above ao) < x"
[PROOF STATE]
proof (prove)
using this:
Min (above ao) \<le> z

goal (1 subgoal):
 1. Min (above ao) < x
[PROOF STEP]
using \<open>z < x\<close>
[PROOF STATE]
proof (prove)
using this:
Min (above ao) \<le> z
z < x

goal (1 subgoal):
 1. Min (above ao) < x
[PROOF STEP]
by(rule le_less_trans)
[PROOF STATE]
proof (state)
this:
Min (above ao) < x

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
with \<open>x = y\<close> y_Min
[PROOF STATE]
proof (chain)
picking this:
x = y
\<forall>y'\<in>set ys. y < y'
Min (above ao) < x
[PROOF STEP]
have "Min (above ao) \<notin> set (y # ys)"
[PROOF STATE]
proof (prove)
using this:
x = y
\<forall>y'\<in>set ys. y < y'
Min (above ao) < x

goal (1 subgoal):
 1. Min (above ao) \<notin> set (y # ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Min (above ao) \<notin> set (y # ys)

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "{Min (above ao)} \<subseteq> - set (y # ys) \<inter> above ao"
[PROOF STATE]
proof (prove)
using this:
Min (above ao) \<notin> set (y # ys)

goal (1 subgoal):
 1. {Min (above ao)} \<subseteq> - set (y # ys) \<inter> above ao
[PROOF STEP]
by(auto simp add: nempty)
[PROOF STATE]
proof (state)
this:
{Min (above ao)} \<subseteq> - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
hence "{Min (above ao)} \<sqsubseteq>' \<dots>"
[PROOF STATE]
proof (prove)
using this:
{Min (above ao)} \<subseteq> - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. {Min (above ao)} \<sqsubseteq>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by(auto intro: subset_finite_imp_set_less_eq_aux)
[PROOF STATE]
proof (state)
this:
{Min (above ao)} \<sqsubseteq>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "A \<sqsubset>' \<dots>"
[PROOF STATE]
proof (prove)
using this:
A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<sqsubset>' - set (y # ys) \<inter> above ao

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
have "A \<subseteq> above ao"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> above ao
[PROOF STEP]
using xxs_above yys_above x' y'
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<subseteq> above ao
set (y # ys) \<subseteq> above ao
x' \<in> above ao
x' \<notin> set (x # xs)
y' \<in> above ao
y' \<notin> set (x # xs)

goal (1 subgoal):
 1. A \<subseteq> above ao
[PROOF STEP]
by(auto simp add: A_def)
[PROOF STATE]
proof (state)
this:
A \<subseteq> above ao

goal (1 subgoal):
 1. CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2 \<Longrightarrow> \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<subseteq> above ao
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
set (x # xs) \<sqsubset>' A
A \<sqsubset>' - set (y # ys) \<inter> above ao
A \<subseteq> above ao

goal (1 subgoal):
 1. \<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. proper_interval ao (Some x) \<Longrightarrow> (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
(CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
proper_interval ao (Some x)

goal (1 subgoal):
 1. (proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. \<not> y < x \<Longrightarrow> proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
using \<open>x = y\<close>
[PROOF STATE]
proof (prove)
using this:
(proper_interval ao (Some x) \<and> (CARD('a) - (card (UNIV - above ao) + length ys) \<noteq> 2 \<or> CARD('a) - (card (UNIV - above ao) + length xs) \<noteq> 2)) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
x = y

goal (1 subgoal):
 1. proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux ao (card (UNIV - above ao)) (x # xs) (y # ys) = (\<exists>A\<subseteq>above ao. set (x # xs) \<sqsubset>' A \<and> A \<sqsubset>' - set (y # ys) \<inter> above ao)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux ao (card (UNIV - above ao)) xs ys = (\<exists>A\<subseteq>above ao. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above ao)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>set xs \<subseteq> above ?ao2; set ys \<subseteq> above ?ao2\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux ?ao2 (card (UNIV - above ?ao2)) xs ys = (\<exists>A\<subseteq>above ?ao2. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above ?ao2)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)
[PROOF STEP]
from this[of None]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>set xs \<subseteq> above None; set ys \<subseteq> above None\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux None (card (UNIV - above None)) xs ys = (\<exists>A\<subseteq>above None. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above None)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set xs \<subseteq> above None; set ys \<subseteq> above None\<rbrakk> \<Longrightarrow> proper_interval_set_Compl_aux None (card (UNIV - above None)) xs ys = (\<exists>A\<subseteq>above None. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys \<inter> above None)

goal (1 subgoal):
 1. proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
proper_interval_set_Compl_aux None 0 xs ys = (\<exists>A. set xs \<sqsubset>' A \<and> A \<sqsubset>' - set ys)

goal:
No subgoals!
[PROOF STEP]
qed