[STATEMENT]
lemma line_extension_of_combine_set_length_version:
  assumes "u \<in> carrier R"
  shows "line_extension K u { combine Ks Us | Ks. length Ks = length Us \<and> set Ks \<subseteq> K } =
                      { combine Ks (u # Us) | Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K }"
  (is "?line_extension = ?combinations")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K} = {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K} \<subseteq> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}
 2. {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K} \<subseteq> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
show "?line_extension \<subseteq> ?combinations"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K} \<subseteq> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K} \<Longrightarrow> x \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K} \<Longrightarrow> x \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}
[PROOF STEP]
assume "v \<in> ?line_extension"
[PROOF STATE]
proof (state)
this:
v \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}

goal (1 subgoal):
 1. \<And>x. x \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K} \<Longrightarrow> x \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
obtain k Ks
      where "v = combine (k # Ks) (u # Us)" "length (k # Ks) = length (u # Us)" "set (k # Ks) \<subseteq> K"
[PROOF STATE]
proof (prove)
using this:
v \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}

goal (1 subgoal):
 1. (\<And>k Ks. \<lbrakk>v = combine (k # Ks) (u # Us); length (k # Ks) = length (u # Us); set (k # Ks) \<subseteq> K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using line_extension_mem_iff
[PROOF STATE]
proof (prove)
using this:
v \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
(?u \<in> line_extension ?K ?a ?E) = (\<exists>k\<in>?K. \<exists>v\<in>?E. ?u = k \<otimes> ?a \<oplus> v)

goal (1 subgoal):
 1. (\<And>k Ks. \<lbrakk>v = combine (k # Ks) (u # Us); length (k # Ks) = length (u # Us); set (k # Ks) \<subseteq> K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v = combine (k # Ks) (u # Us)
length (k # Ks) = length (u # Us)
set (k # Ks) \<subseteq> K

goal (1 subgoal):
 1. \<And>x. x \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K} \<Longrightarrow> x \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}
[PROOF STEP]
thus "v \<in> ?combinations"
[PROOF STATE]
proof (prove)
using this:
v = combine (k # Ks) (u # Us)
length (k # Ks) = length (u # Us)
set (k # Ks) \<subseteq> K

goal (1 subgoal):
 1. v \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
v \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K} \<subseteq> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}

goal (1 subgoal):
 1. {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K} \<subseteq> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K} \<subseteq> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
show "?combinations \<subseteq> ?line_extension"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K} \<subseteq> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K} \<Longrightarrow> x \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K} \<Longrightarrow> x \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
assume "c \<in> ?combinations"
[PROOF STATE]
proof (state)
this:
c \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}

goal (1 subgoal):
 1. \<And>x. x \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K} \<Longrightarrow> x \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}
[PROOF STEP]
obtain Ks where c: "c = combine Ks (u # Us)" "length Ks = length (u # Us)" "set Ks \<subseteq> K"
[PROOF STATE]
proof (prove)
using this:
c \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K}

goal (1 subgoal):
 1. (\<And>Ks. \<lbrakk>c = combine Ks (u # Us); length Ks = length (u # Us); set Ks \<subseteq> K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
c = combine Ks (u # Us)
length Ks = length (u # Us)
set Ks \<subseteq> K

goal (1 subgoal):
 1. \<And>x. x \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K} \<Longrightarrow> x \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = combine Ks (u # Us)
length Ks = length (u # Us)
set Ks \<subseteq> K
[PROOF STEP]
obtain k Ks' where k: "Ks = k # Ks'"
[PROOF STATE]
proof (prove)
using this:
c = combine Ks (u # Us)
length Ks = length (u # Us)
set Ks \<subseteq> K

goal (1 subgoal):
 1. (\<And>k Ks'. Ks = k # Ks' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis length_Suc_conv)
[PROOF STATE]
proof (state)
this:
Ks = k # Ks'

goal (1 subgoal):
 1. \<And>x. x \<in> {combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K} \<Longrightarrow> x \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
thus "c \<in> ?line_extension"
[PROOF STATE]
proof (prove)
using this:
Ks = k # Ks'

goal (1 subgoal):
 1. c \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
using c line_extension_mem_iff
[PROOF STATE]
proof (prove)
using this:
Ks = k # Ks'
c = combine Ks (u # Us)
length Ks = length (u # Us)
set Ks \<subseteq> K
(?u \<in> line_extension ?K ?a ?E) = (\<exists>k\<in>?K. \<exists>v\<in>?E. ?u = k \<otimes> ?a \<oplus> v)

goal (1 subgoal):
 1. c \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
unfolding k
[PROOF STATE]
proof (prove)
using this:
k # Ks' = k # Ks'
c = combine (k # Ks') (u # Us)
length (k # Ks') = length (u # Us)
set (k # Ks') \<subseteq> K
(?u \<in> line_extension ?K ?a ?E) = (\<exists>k\<in>?K. \<exists>v\<in>?E. ?u = k \<otimes> ?a \<oplus> v)

goal (1 subgoal):
 1. c \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<in> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{combine Ks (u # Us) |Ks. length Ks = length (u # Us) \<and> set Ks \<subseteq> K} \<subseteq> line_extension K u {combine Ks Us |Ks. length Ks = length Us \<and> set Ks \<subseteq> K}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_intersection_is_semialgebraic'':
  assumes "finite Xs"
  assumes "are_semialgebraic n Xs \<and> Xs \<noteq>{}"
  shows  " is_semialgebraic n (\<Inter> Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic n (\<Inter> Xs)
[PROOF STEP]
by (meson are_semialgebraicE assms(1) assms(2)
      finite_intersection_is_semialgebraic' is_semialgebraicE subsetI)


[STATEMENT]
lemma shiftpath_shiftpath:
  assumes "pathfinish g = pathstart g"
    and "a \<in> {0..1}"
    and "x \<in> {0..1}"
  shows "shiftpath (1 - a) (shiftpath a g) x = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shiftpath (1 - a) (shiftpath a g) x = g x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pathfinish g = pathstart g
a \<in> {0..1}
x \<in> {0..1}

goal (1 subgoal):
 1. shiftpath (1 - a) (shiftpath a g) x = g x
[PROOF STEP]
unfolding pathfinish_def pathstart_def shiftpath_def
[PROOF STATE]
proof (prove)
using this:
g 1 = g 0
a \<in> {0..1}
x \<in> {0..1}

goal (1 subgoal):
 1. (if 1 - a + x \<le> 1 then if a + (1 - a + x) \<le> 1 then g (a + (1 - a + x)) else g (a + (1 - a + x) - 1) else if a + (1 - a + x - 1) \<le> 1 then g (a + (1 - a + x - 1)) else g (a + (1 - a + x - 1) - 1)) = g x
[PROOF STEP]
by auto


[STATEMENT]
lemma A_ub2: assumes "bst t" "a : set_tree t"
shows "A a t \<le> log \<alpha> ((size1 t)/2) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A a t \<le> log \<alpha> (real (size1 t) / 2) + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A a t \<le> log \<alpha> (real (size1 t) / 2) + 1
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
a \<in> set_tree t
[PROOF STEP]
obtain la ra where N: "Node la a ra : subtrees t"
[PROOF STATE]
proof (prove)
using this:
a \<in> set_tree t

goal (1 subgoal):
 1. (\<And>la ra. \<langle>la, a, ra\<rangle> \<in> subtrees t \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis set_treeE)
[PROOF STATE]
proof (state)
this:
\<langle>la, a, ra\<rangle> \<in> subtrees t

goal (1 subgoal):
 1. A a t \<le> log \<alpha> (real (size1 t) / 2) + 1
[PROOF STEP]
have "A a t \<le> log \<alpha> ((size1 t)/(size1 la + size1 ra)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A a t \<le> log \<alpha> (real (size1 t) / real (size1 la + size1 ra)) + 1
[PROOF STEP]
by(rule A_ub[OF assms(1) N])
[PROOF STATE]
proof (state)
this:
A a t \<le> log \<alpha> (real (size1 t) / real (size1 la + size1 ra)) + 1

goal (1 subgoal):
 1. A a t \<le> log \<alpha> (real (size1 t) / 2) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A a t \<le> log \<alpha> (real (size1 t) / real (size1 la + size1 ra)) + 1

goal (1 subgoal):
 1. A a t \<le> log \<alpha> (real (size1 t) / 2) + 1
[PROOF STEP]
have "\<dots> \<le> log \<alpha> ((size1 t)/2) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log \<alpha> (real (size1 t) / real (size1 la + size1 ra)) + 1 \<le> log \<alpha> (real (size1 t) / 2) + 1
[PROOF STEP]
by(simp add: field_simps)
[PROOF STATE]
proof (state)
this:
log \<alpha> (real (size1 t) / real (size1 la + size1 ra)) + 1 \<le> log \<alpha> (real (size1 t) / 2) + 1

goal (1 subgoal):
 1. A a t \<le> log \<alpha> (real (size1 t) / 2) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A a t \<le> log \<alpha> (real (size1 t) / 2) + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A a t \<le> log \<alpha> (real (size1 t) / 2) + 1

goal (1 subgoal):
 1. A a t \<le> log \<alpha> (real (size1 t) / 2) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A a t \<le> log \<alpha> (real (size1 t) / 2) + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_of_map2: "\<forall>x \<in> set xs. (fst (f x)) = (fst x) \<Longrightarrow>
  map_of (map f xs) a = map_option (\<lambda> b. (snd (f (a, b)))) (map_of xs a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set xs. fst (f x) = fst x \<Longrightarrow> map_of (map f xs) a = map_option (\<lambda>b. snd (f (a, b))) (map_of xs a)
[PROOF STEP]
by (induct xs, auto)


[STATEMENT]
lemma (in ring) dense_repr_set_fst:
  assumes "set p \<subseteq> K" shows "fst ` (set (dense_repr p)) \<subseteq> K - { \<zero> }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` set (dense_repr p) \<subseteq> K - {\<zero>}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> K

goal (1 subgoal):
 1. fst ` set (dense_repr p) \<subseteq> K - {\<zero>}
[PROOF STEP]
by (induct p) (auto)


[STATEMENT]
lemma infinite_ordLeq_cexp:
  assumes "Cinfinite r"
  shows "r \<le>o r ^c r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<le>o r ^c r
[PROOF STEP]
by (rule ordLess_imp_ordLeq[OF Cinfinite_ordLess_cexp[OF assms]])


[STATEMENT]
lemma multi_set_size_count:
  fixes m :: "'c monomial"
  shows "size m \<ge> count m i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count m i \<le> size m
[PROOF STEP]
by (metis count_le_replicate_mset_subset_eq order_refl size_mset_mono size_replicate_mset)


[STATEMENT]
lemma sat_MatchP_point: "sat \<sigma> V v i (MatchP I r) \<Longrightarrow>
    (\<And>j. j \<le> i \<Longrightarrow> mem (\<tau> \<sigma> i - \<tau> \<sigma> j) I \<Longrightarrow> sat \<sigma> V v i (MatchP (point (\<tau> \<sigma> i - \<tau> \<sigma> j)) r) \<Longrightarrow> P) \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sat \<sigma> V v i (MatchP I r); \<And>j. \<lbrakk>j \<le> i; mem (\<tau> \<sigma> i - \<tau> \<sigma> j) I; sat \<sigma> V v i (MatchP (point (\<tau> \<sigma> i - \<tau> \<sigma> j)) r)\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by (auto intro: diff_le_self)


[STATEMENT]
lemma postfix_conv_eq_length_drop:
  "ST' \<bind> ST \<longleftrightarrow> length ST \<le> length ST' \<and> drop (length ST' - length ST) ST' = ST"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ST' \<bind> ST) = (length ST \<le> length ST' \<and> drop (length ST' - length ST) ST' = ST)
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ST' \<bind> ST \<Longrightarrow> length ST \<le> length ST'
 2. ST' \<bind> ST \<Longrightarrow> drop (length ST' - length ST) ST' = ST
 3. \<lbrakk>length ST \<le> length ST'; drop (length ST' - length ST) ST' = ST\<rbrakk> \<Longrightarrow> ST' \<bind> ST
[PROOF STEP]
apply (metis append_eq_conv_conj append_take_drop_id diff_is_0_eq drop_0 linorder_not_less nat_le_linear suffix_take)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ST' \<bind> ST \<Longrightarrow> drop (length ST' - length ST) ST' = ST
 2. \<lbrakk>length ST \<le> length ST'; drop (length ST' - length ST) ST' = ST\<rbrakk> \<Longrightarrow> ST' \<bind> ST
[PROOF STEP]
apply (metis append_take_drop_id length_drop suffix_take same_append_eq size_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length ST \<le> length ST'; drop (length ST' - length ST) ST' = ST\<rbrakk> \<Longrightarrow> ST' \<bind> ST
[PROOF STEP]
by (metis suffix_drop)


[STATEMENT]
lemma set_list_of_vec: "set (list_of_vec v) = set\<^sub>v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (list_of_vec v) = set\<^sub>v v
[PROOF STEP]
unfolding vec_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (list_of_vec v) = ($) v ` {..<dim_vec v}
[PROOF STEP]
by transfer auto


[STATEMENT]
lemma lookup_useNodes_of':
    assumes [simp]: "\<And>n. finite (uses g n)"
    shows "Mapping.lookup (useNodes_of g) v =
    (if (\<exists>n \<in> set (\<alpha>n g). v \<in> uses g n) then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
fix m n xs v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
have "Mapping.lookup (fold (\<lambda>v. Mapping.map_default (v::'var) {} (insert (n::'node))) xs m) v=
        (case Mapping.lookup m v of None \<Rightarrow> (if v \<in> set xs then Some {n} else None)
          | Some N \<Rightarrow> (if v \<in> set xs then Some (insert n N) else Some N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (fold (\<lambda>v. Mapping.map_default v {} (insert n)) xs m) v = (case Mapping.lookup m v of None \<Rightarrow> if v \<in> set xs then Some {n} else None | Some N \<Rightarrow> if v \<in> set xs then Some (insert n N) else Some N)
[PROOF STEP]
by (induction xs arbitrary: m) (auto simp: Mapping_lookup_map_default split: option.splits)
[PROOF STATE]
proof (state)
this:
Mapping.lookup (fold (\<lambda>v. Mapping.map_default v {} (insert n)) xs m) v = (case Mapping.lookup m v of None \<Rightarrow> if v \<in> set xs then Some {n} else None | Some N \<Rightarrow> if v \<in> set xs then Some (insert n N) else Some N)

goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
Mapping.lookup (fold (\<lambda>v. Mapping.map_default v {} (insert ?n3)) ?xs3 ?m3) ?va3 = (case Mapping.lookup ?m3 ?va3 of None \<Rightarrow> if ?va3 \<in> set ?xs3 then Some {?n3} else None | Some N \<Rightarrow> if ?va3 \<in> set ?xs3 then Some (insert ?n3 N) else Some N)

goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
note addN_conv = this [of n "sorted_list_of_set (uses g n)" for g n, folded addN_def, simplified]
[PROOF STATE]
proof (state)
this:
Mapping.lookup (addN ?ga6 ?n6 ?m3) ?va3 = (case Mapping.lookup ?m3 ?va3 of None \<Rightarrow> if ?va3 \<in> set (sorted_list_of_set (uses ?ga6 ?n6)) then Some {?n6} else None | Some N \<Rightarrow> if ?va3 \<in> set (sorted_list_of_set (uses ?ga6 ?n6)) then Some (insert ?n6 N) else Some N)

goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
Mapping.lookup (addN ?ga6 ?n6 ?m3) ?va3 = (case Mapping.lookup ?m3 ?va3 of None \<Rightarrow> if ?va3 \<in> set (sorted_list_of_set (uses ?ga6 ?n6)) then Some {?n6} else None | Some N \<Rightarrow> if ?va3 \<in> set (sorted_list_of_set (uses ?ga6 ?n6)) then Some (insert ?n6 N) else Some N)

goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
fix xs m v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
have "Mapping.lookup (fold (addN g) xs m) v = (case Mapping.lookup m v of None \<Rightarrow> if (\<exists>n\<in>set xs. v \<in> uses g n) then Some {n\<in>set xs. v \<in> uses g n} else None
        | Some N \<Rightarrow> Some ({n\<in>set xs. v \<in> uses g n} \<union> N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (fold (addN g) xs m) v = (case Mapping.lookup m v of None \<Rightarrow> if \<exists>n\<in>set xs. v \<in> uses g n then Some {n \<in> set xs. v \<in> uses g n} else None | Some N \<Rightarrow> Some ({n \<in> set xs. v \<in> uses g n} \<union> N))
[PROOF STEP]
by (induction xs arbitrary: m) (auto split: option.splits simp: addN_conv)
[PROOF STATE]
proof (state)
this:
Mapping.lookup (fold (addN g) xs m) v = (case Mapping.lookup m v of None \<Rightarrow> if \<exists>n\<in>set xs. v \<in> uses g n then Some {n \<in> set xs. v \<in> uses g n} else None | Some N \<Rightarrow> Some ({n \<in> set xs. v \<in> uses g n} \<union> N))

goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
Mapping.lookup (fold (addN g) ?xs3 ?m3) ?va3 = (case Mapping.lookup ?m3 ?va3 of None \<Rightarrow> if \<exists>n\<in>set ?xs3. ?va3 \<in> uses g n then Some {n \<in> set ?xs3. ?va3 \<in> uses g n} else None | Some N \<Rightarrow> Some ({n \<in> set ?xs3. ?va3 \<in> uses g n} \<union> N))

goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
note this [of "\<alpha>n g" Mapping.empty, simp]
[PROOF STATE]
proof (state)
this:
Mapping.lookup (fold (addN g) (\<alpha>n g) Mapping.empty) ?va3 = (case Mapping.lookup Mapping.empty ?va3 of None \<Rightarrow> if \<exists>n\<in>set (\<alpha>n g). ?va3 \<in> uses g n then Some {n \<in> set (\<alpha>n g). ?va3 \<in> uses g n} else None | Some N \<Rightarrow> Some ({n \<in> set (\<alpha>n g). ?va3 \<in> uses g n} \<union> N))

goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
unfolding useNodes_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (fold (addN g) (\<alpha>n g) Mapping.empty) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
by (auto split: option.splits simp: lookup_empty)
[PROOF STATE]
proof (state)
this:
Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [code]:
  "x smod y =
   (let x' = sint x; y' = sint y;
        negative = (x' < 0);
        result = abs x' mod abs y'
    in word_of_int (if negative then -result else result))"
  for x y :: \<open>'a::len word\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x smod y = (let x' = sint x; y' = sint y; negative = x' < 0; result = \<bar>x'\<bar> mod \<bar>y'\<bar> in word_of_int (if negative then - result else result))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x smod y = (let x' = sint x; y' = sint y; negative = x' < 0; result = \<bar>x'\<bar> mod \<bar>y'\<bar> in word_of_int (if negative then - result else result))
[PROOF STEP]
have *: \<open>k mod l = k - k div l * l\<close> for k l :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k mod l = k - k div l * l
[PROOF STEP]
by (simp add: minus_div_mult_eq_mod)
[PROOF STATE]
proof (state)
this:
?k mod ?l = ?k - ?k div ?l * ?l

goal (1 subgoal):
 1. x smod y = (let x' = sint x; y' = sint y; negative = x' < 0; result = \<bar>x'\<bar> mod \<bar>y'\<bar> in word_of_int (if negative then - result else result))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x smod y = (let x' = sint x; y' = sint y; negative = x' < 0; result = \<bar>x'\<bar> mod \<bar>y'\<bar> in word_of_int (if negative then - result else result))
[PROOF STEP]
by (simp add: smod_word_def signed_modulo_int_def signed_divide_int_def * sgn_if Let_def)
[PROOF STATE]
proof (state)
this:
x smod y = (let x' = sint x; y' = sint y; negative = x' < 0; result = \<bar>x'\<bar> mod \<bar>y'\<bar> in word_of_int (if negative then - result else result))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rep_list_uminus: "rep_list (- r) = - rep_list r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rep_list (- r) = - rep_list r
[PROOF STEP]
by (simp add: rep_list_def vectorize_uminus pm_of_idx_pm_uminus)


[STATEMENT]
lemma MOST_eq [simp]:
  "(MOST x::'a. x = a) \<longleftrightarrow> finite (UNIV::'a set)"
  "(MOST x::'a. a = x) \<longleftrightarrow> finite (UNIV::'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>\<infinity>x. x = a) = finite UNIV &&& (\<forall>\<^sub>\<infinity>x. a = x) = finite UNIV
[PROOF STEP]
unfolding eventually_cofinite
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. x \<noteq> a} = finite UNIV &&& finite {x. a \<noteq> x} = finite UNIV
[PROOF STEP]
by simp_all


[STATEMENT]
lemma mset_union_subset_s: "{#a#}+B \<subseteq># C \<Longrightarrow> a \<in># C \<and> B \<subseteq># C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#a#} + B \<subseteq># C \<Longrightarrow> a \<in># C \<and> B \<subseteq># C
[PROOF STEP]
by (drule mset_union_subset) simp


[STATEMENT]
lemma add_zeror [simp]: "x + 0 = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + (0::'a) = x
[PROOF STEP]
by (subst add_commute) simp


[STATEMENT]
lemma ev_blocks_partD:
  "ev_blocks_part m A \<Longrightarrow> i < j \<Longrightarrow> j < k \<Longrightarrow> k < m \<Longrightarrow> A $$ (k,k) = A $$ (i,i) \<Longrightarrow> A $$ (j,j) = A $$ (i,i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.ev_blocks_part m A; i < j; j < k; k < m; A $$ (k, k) = A $$ (i, i)\<rbrakk> \<Longrightarrow> A $$ (j, j) = A $$ (i, i)
[PROOF STEP]
unfolding ev_blocks_part_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i j k. i < j \<longrightarrow> j < k \<longrightarrow> k < m \<longrightarrow> A $$ (k, k) = A $$ (i, i) \<longrightarrow> A $$ (j, j) = A $$ (i, i); i < j; j < k; k < m; A $$ (k, k) = A $$ (i, i)\<rbrakk> \<Longrightarrow> A $$ (j, j) = A $$ (i, i)
[PROOF STEP]
by auto


[STATEMENT]
lemma isomorphicI':
    assumes "\<guillemotleft>f : a \<cong> b\<guillemotright>"
    shows "isomorphic a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isomorphic a b
[PROOF STEP]
using assms iso_in_hom_def isomorphic_def
[PROOF STATE]
proof (prove)
using this:
\<guillemotleft>f : a \<cong> b\<guillemotright>
\<guillemotleft>?f : ?a \<cong> ?b\<guillemotright> \<equiv> \<guillemotleft>?f : ?a \<rightarrow> ?b\<guillemotright> \<and> local.iso ?f
isomorphic ?a ?a' = (\<exists>f. \<guillemotleft>f : ?a \<rightarrow> ?a'\<guillemotright> \<and> local.iso f)

goal (1 subgoal):
 1. isomorphic a b
[PROOF STEP]
by auto


[STATEMENT]
lemma set_delete_conv: "set (AList.delete a al) = set al - ({a} \<times> UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (AList.delete a al) = set al - {a} \<times> UNIV
[PROOF STEP]
proof(induct al)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set (AList.delete a []) = set [] - {a} \<times> UNIV
 2. \<And>aa al. set (AList.delete a al) = set al - {a} \<times> UNIV \<Longrightarrow> set (AList.delete a (aa # al)) = set (aa # al) - {a} \<times> UNIV
[PROOF STEP]
case (Cons kv al)
[PROOF STATE]
proof (state)
this:
set (AList.delete a al) = set al - {a} \<times> UNIV

goal (2 subgoals):
 1. set (AList.delete a []) = set [] - {a} \<times> UNIV
 2. \<And>aa al. set (AList.delete a al) = set al - {a} \<times> UNIV \<Longrightarrow> set (AList.delete a (aa # al)) = set (aa # al) - {a} \<times> UNIV
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
set (AList.delete a al) = set al - {a} \<times> UNIV

goal (1 subgoal):
 1. set (AList.delete a (kv # al)) = set (kv # al) - {a} \<times> UNIV
[PROOF STEP]
by(cases kv) auto
[PROOF STATE]
proof (state)
this:
set (AList.delete a (kv # al)) = set (kv # al) - {a} \<times> UNIV

goal (1 subgoal):
 1. set (AList.delete a []) = set [] - {a} \<times> UNIV
[PROOF STEP]
qed simp


[STATEMENT]
lemma trm_soundness:
  assumes finite:"finite rhs"
  shows "lang_rhs ({Trn X r| r. Trn X r \<in> rhs}) = X \<cdot> (lang (\<Uplus>{r. Trn X r \<in> rhs}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lang_rhs {Trn X r |r. Trn X r \<in> rhs} = X \<cdot> lang (\<Uplus>{r. Trn X r \<in> rhs})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lang_rhs {Trn X r |r. Trn X r \<in> rhs} = X \<cdot> lang (\<Uplus>{r. Trn X r \<in> rhs})
[PROOF STEP]
have "finite {r. Trn X r \<in> rhs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {r. Trn X r \<in> rhs}
[PROOF STEP]
by (rule finite_Trn[OF finite])
[PROOF STATE]
proof (state)
this:
finite {r. Trn X r \<in> rhs}

goal (1 subgoal):
 1. lang_rhs {Trn X r |r. Trn X r \<in> rhs} = X \<cdot> lang (\<Uplus>{r. Trn X r \<in> rhs})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {r. Trn X r \<in> rhs}
[PROOF STEP]
show "lang_rhs ({Trn X r| r. Trn X r \<in> rhs}) = X \<cdot> (lang (\<Uplus>{r. Trn X r \<in> rhs}))"
[PROOF STATE]
proof (prove)
using this:
finite {r. Trn X r \<in> rhs}

goal (1 subgoal):
 1. lang_rhs {Trn X r |r. Trn X r \<in> rhs} = X \<cdot> lang (\<Uplus>{r. Trn X r \<in> rhs})
[PROOF STEP]
by (simp only: lang_rhs_set lang_trm.simps) (auto simp add: conc_def)
[PROOF STATE]
proof (state)
this:
lang_rhs {Trn X r |r. Trn X r \<in> rhs} = X \<cdot> lang (\<Uplus>{r. Trn X r \<in> rhs})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma not_in_interior_convex_hull:
  fixes S :: "'a::euclidean_space set"
  assumes "finite S" "card S \<le> Suc (DIM ('a))" "x \<in> S"
  shows   "x \<notin> interior(convex hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> interior (convex hull S)
[PROOF STEP]
using in_frontier_convex_hull [OF assms]
[PROOF STATE]
proof (prove)
using this:
x \<in> frontier (convex hull S)

goal (1 subgoal):
 1. x \<notin> interior (convex hull S)
[PROOF STEP]
by (metis Diff_iff frontier_def)


[STATEMENT]
lemma count_space_uminus:
  "count_space UNIV = distr (count_space UNIV) (count_space UNIV) (uminus :: ('a :: ring \<Rightarrow> _))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_space UNIV = distr (count_space UNIV) (count_space UNIV) uminus
[PROOF STEP]
proof (rule distr_bij_count_space[symmetric])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bij uminus
[PROOF STEP]
show "bij (uminus :: 'a \<Rightarrow> 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij uminus
[PROOF STEP]
by (auto intro!: o_bij[where g=uminus])
[PROOF STATE]
proof (state)
this:
bij uminus

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_shift_times_fps_X'':
  fixes f :: "'a::{comm_monoid_add,mult_zero,monoid_mult} fps"
  shows "1 \<le> n \<Longrightarrow> fps_shift n (f * fps_X) = fps_shift (n - 1) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> n \<Longrightarrow> fps_shift n (f * fps_X) = fps_shift (n - 1) f
[PROOF STEP]
by (intro fps_ext) (simp add: nth_less_subdegree_zero)


[STATEMENT]
lemma lm007:
  assumes "(X \<inter> Domain P) \<subseteq> Domain Q"
  shows "P +* Q = (P outside X) +* Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P +< Q = (P outside X) +< Q
[PROOF STEP]
unfolding paste_def Outside_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P - Domain Q \<times> Range P \<union> Q = P - X \<times> Range P - Domain Q \<times> Range (P - X \<times> Range P) \<union> Q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
X \<inter> Domain P \<subseteq> Domain Q

goal (1 subgoal):
 1. P - Domain Q \<times> Range P \<union> Q = P - X \<times> Range P - Domain Q \<times> Range (P - X \<times> Range P) \<union> Q
[PROOF STEP]
by blast


[STATEMENT]
lemma subst0_I:
  assumes "qfree p"
  shows "Ifm bbs (b # bs) (subst0 a p) = Ifm bbs (Inum (b # bs) a # bs) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ifm bbs (b # bs) (subst0 a p) = Ifm bbs (Inum (b # bs) a # bs) p
[PROOF STEP]
using assms numsubst0_I[where b="b" and bs="bs" and a="a"]
[PROOF STATE]
proof (prove)
using this:
qfree p
Inum (b # bs) (numsubst0 a ?t) = Inum (Inum (b # bs) a # bs) ?t

goal (1 subgoal):
 1. Ifm bbs (b # bs) (subst0 a p) = Ifm bbs (Inum (b # bs) a # bs) p
[PROOF STEP]
by (induct p) (simp_all add: gr0_conv_Suc)


[STATEMENT]
lemma ordinal_plus_oLimit [simp]: "x + oLimit f = oLimit (\<lambda>n. x + f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + oLimit f = oLimit (\<lambda>n. x + f n)
[PROOF STEP]
by (simp add: normal.oLimit normal_plus)


[STATEMENT]
lemma open_subset_interior: "open S \<Longrightarrow> S \<subseteq> interior T \<longleftrightarrow> S \<subseteq> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S \<Longrightarrow> (S \<subseteq> interior T) = (S \<subseteq> T)
[PROOF STEP]
by (metis interior_maximal interior_subset subset_trans)


[STATEMENT]
lemma nonnegative_complex_is_real: \<open>(x::complex) \<ge> 0 \<Longrightarrow> x \<in> \<real>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> x \<in> \<real>
[PROOF STEP]
by (simp add: complex_is_Real_iff less_eq_complex_def)


[STATEMENT]
lemma equivalence_relation_on_states_ran :
  assumes "equivalence_relation_on_states M f"
  and     "q \<in> states M"
shows "f q \<subseteq> states M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f q \<subseteq> FSM.states M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
equivalence_relation_on_states M f
q \<in> FSM.states M

goal (1 subgoal):
 1. f q \<subseteq> FSM.states M
[PROOF STEP]
unfolding equivalence_relation_on_states_def
[PROOF STATE]
proof (prove)
using this:
equiv (FSM.states M) {(q1, q2) |q1 q2. q1 \<in> FSM.states M \<and> q2 \<in> f q1} \<and> (\<forall>q\<in>FSM.states M. f q \<subseteq> FSM.states M)
q \<in> FSM.states M

goal (1 subgoal):
 1. f q \<subseteq> FSM.states M
[PROOF STEP]
by blast


[STATEMENT]
lemma fold_invariant:
  "\<lbrakk> \<And>x. x \<in> set xs \<Longrightarrow> Q x;  P s;  \<And>x s. Q x \<Longrightarrow> P s \<Longrightarrow> P (f x s) \<rbrakk>
  \<Longrightarrow> P (fold f xs s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> set xs \<Longrightarrow> Q x; P s; \<And>x s. \<lbrakk>Q x; P s\<rbrakk> \<Longrightarrow> P (f x s)\<rbrakk> \<Longrightarrow> P (fold f xs s)
[PROOF STEP]
by (induct xs arbitrary: s) simp_all


[STATEMENT]
lemma q_ball_in_Qp:
  "q_ball n k m c  \<subseteq> carrier Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q_ball n k m c \<subseteq> carrier Q\<^sub>p
[PROOF STEP]
unfolding q_ball_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier Q\<^sub>p. ac n (x \<ominus> c) = k \<and> ord (x \<ominus> c) = m} \<subseteq> carrier Q\<^sub>p
[PROOF STEP]
by blast


[STATEMENT]
lemma CardI: "\<lbrakk>Ord i; \<And>j. \<lbrakk>j < i; Ord j\<rbrakk> \<Longrightarrow> \<not> elts j \<approx> elts i\<rbrakk> \<Longrightarrow> Card i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord i; \<And>j. \<lbrakk>j < i; Ord j\<rbrakk> \<Longrightarrow> \<not> elts j \<approx> elts i\<rbrakk> \<Longrightarrow> Card i
[PROOF STEP]
unfolding Card_def vcard_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord i; \<And>j. \<lbrakk>j < i; Ord j\<rbrakk> \<Longrightarrow> \<not> elts j \<approx> elts i\<rbrakk> \<Longrightarrow> i = (LEAST ia. Ord ia \<and> elts ia \<approx> elts i)
[PROOF STEP]
by (metis Ord_Least Ord_linear_lt cardinal_eqpoll eqpoll_refl not_less_Ord_Least vcard_def)


[STATEMENT]
lemma in_unfold_rtrancl2:
 "(p,q) : R\<^sup>* = (q = p | (\<exists>r. (p,r) : R \<and> (r,q) : R\<^sup>*))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((p, q) \<in> R\<^sup>*) = (q = p \<or> (\<exists>r. (p, r) \<in> R \<and> (r, q) \<in> R\<^sup>*))
[PROOF STEP]
apply (rule unfold_rtrancl2[THEN equalityE])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>?R1\<^sup>* \<subseteq> Id \<union> ?R1 O ?R1\<^sup>*; Id \<union> ?R1 O ?R1\<^sup>* \<subseteq> ?R1\<^sup>*\<rbrakk> \<Longrightarrow> ((p, q) \<in> R\<^sup>*) = (q = p \<or> (\<exists>r. (p, r) \<in> R \<and> (r, q) \<in> R\<^sup>*))
[PROOF STEP]
apply (blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma neg_plus_game: "neg_game (plus_game G H) = plus_game (neg_game G) (neg_game H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. neg_game (plus_game G H) = plus_game (neg_game G) (neg_game H)
[PROOF STEP]
proof (induct G H rule: plus_game.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>G H. \<lbrakk>\<And>x. zin x (left_options G) \<Longrightarrow> neg_game (plus_game x H) = plus_game (neg_game x) (neg_game H); \<And>x. zin x (left_options H) \<Longrightarrow> neg_game (plus_game G x) = plus_game (neg_game G) (neg_game x); \<And>x. zin x (right_options G) \<Longrightarrow> neg_game (plus_game x H) = plus_game (neg_game x) (neg_game H); \<And>x. zin x (right_options H) \<Longrightarrow> neg_game (plus_game G x) = plus_game (neg_game G) (neg_game x)\<rbrakk> \<Longrightarrow> neg_game (plus_game G H) = plus_game (neg_game G) (neg_game H)
[PROOF STEP]
case (1 G H)
[PROOF STATE]
proof (state)
this:
zin ?x (left_options G) \<Longrightarrow> neg_game (plus_game ?x H) = plus_game (neg_game ?x) (neg_game H)
zin ?x (left_options H) \<Longrightarrow> neg_game (plus_game G ?x) = plus_game (neg_game G) (neg_game ?x)
zin ?x (right_options G) \<Longrightarrow> neg_game (plus_game ?x H) = plus_game (neg_game ?x) (neg_game H)
zin ?x (right_options H) \<Longrightarrow> neg_game (plus_game G ?x) = plus_game (neg_game G) (neg_game ?x)

goal (1 subgoal):
 1. \<And>G H. \<lbrakk>\<And>x. zin x (left_options G) \<Longrightarrow> neg_game (plus_game x H) = plus_game (neg_game x) (neg_game H); \<And>x. zin x (left_options H) \<Longrightarrow> neg_game (plus_game G x) = plus_game (neg_game G) (neg_game x); \<And>x. zin x (right_options G) \<Longrightarrow> neg_game (plus_game x H) = plus_game (neg_game x) (neg_game H); \<And>x. zin x (right_options H) \<Longrightarrow> neg_game (plus_game G x) = plus_game (neg_game G) (neg_game x)\<rbrakk> \<Longrightarrow> neg_game (plus_game G H) = plus_game (neg_game G) (neg_game H)
[PROOF STEP]
note opt_ops =
    left_options_plus right_options_plus
    left_options_neg right_options_neg
[PROOF STATE]
proof (state)
this:
left_options (plus_game ?u ?v) = zunion (zimage (\<lambda>g. plus_game g ?v) (left_options ?u)) (zimage (plus_game ?u) (left_options ?v))
right_options (plus_game ?u ?v) = zunion (zimage (\<lambda>g. plus_game g ?v) (right_options ?u)) (zimage (plus_game ?u) (right_options ?v))
left_options (neg_game ?u) = zimage neg_game (right_options ?u)
right_options (neg_game ?u) = zimage neg_game (left_options ?u)

goal (1 subgoal):
 1. \<And>G H. \<lbrakk>\<And>x. zin x (left_options G) \<Longrightarrow> neg_game (plus_game x H) = plus_game (neg_game x) (neg_game H); \<And>x. zin x (left_options H) \<Longrightarrow> neg_game (plus_game G x) = plus_game (neg_game G) (neg_game x); \<And>x. zin x (right_options G) \<Longrightarrow> neg_game (plus_game x H) = plus_game (neg_game x) (neg_game H); \<And>x. zin x (right_options H) \<Longrightarrow> neg_game (plus_game G x) = plus_game (neg_game G) (neg_game x)\<rbrakk> \<Longrightarrow> neg_game (plus_game G H) = plus_game (neg_game G) (neg_game H)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. neg_game (plus_game G H) = plus_game (neg_game G) (neg_game H)
[PROOF STEP]
by (auto simp add: opt_ops
      neg_game.simps[of "plus_game G H"]
      plus_game.simps[of "neg_game G" "neg_game H"]
      Game_ext zet_ext_eq zunion zimage_iff 1)
[PROOF STATE]
proof (state)
this:
neg_game (plus_game G H) = plus_game (neg_game G) (neg_game H)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_vector_2:
  "zero_vector x \<longleftrightarrow> (\<forall>y . x * y \<le> x * bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zero_vector x = (\<forall>y. x * y \<le> x * bot)
[PROOF STEP]
by (metis eq_refl order_trans top_right_mult_increasing zero_vector_def zero_vector_left_zero)


[STATEMENT]
theorem Ls_can_tile: "i \<le> a \<Longrightarrow> a < 2^n + i \<Longrightarrow> j \<le> b \<Longrightarrow> b < 2^n + j
  \<Longrightarrow> square2 n i j - {(a,b)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
proof(induct n arbitrary: a b i j)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ 0 + i; j \<le> b; b < 2 ^ 0 + j\<rbrakk> \<Longrightarrow> square2 0 i j - {(a, b)} \<in> tiling Ls
 2. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
i \<le> a
a < 2 ^ 0 + i
j \<le> b
b < 2 ^ 0 + j

goal (2 subgoals):
 1. \<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ 0 + i; j \<le> b; b < 2 ^ 0 + j\<rbrakk> \<Longrightarrow> square2 0 i j - {(a, b)} \<in> tiling Ls
 2. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
i \<le> a
a < 2 ^ 0 + i
j \<le> b
b < 2 ^ 0 + j

goal (1 subgoal):
 1. square2 0 i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
by (simp add:square2_def)
[PROOF STATE]
proof (state)
this:
square2 0 i j - {(a, b)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i \<le> ?a; ?a < 2 ^ n + ?i; ?j \<le> ?b; ?b < 2 ^ n + ?j\<rbrakk> \<Longrightarrow> square2 n ?i ?j - {(?a, ?b)} \<in> tiling Ls
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
note IH = Suc(1) and a = Suc(2-3) and b = Suc(4-5)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i \<le> ?a; ?a < 2 ^ n + ?i; ?j \<le> ?b; ?b < 2 ^ n + ?j\<rbrakk> \<Longrightarrow> square2 n ?i ?j - {(?a, ?b)} \<in> tiling Ls
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
hence "a<2^n+i \<and> b<2^n+j \<or>
         2^n+i\<le>a \<and> a<2^(n+1)+i \<and> b<2^n+j \<or>
         a<2^n+i \<and> 2^n+j\<le>b \<and> b<2^(n+1)+j \<or>
         2^n+i\<le>a \<and> a<2^(n+1)+i \<and> 2^n+j\<le>b \<and> b<2^(n+1)+j" (is "?A|?B|?C|?D")
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<le> ?a; ?a < 2 ^ n + ?i; ?j \<le> ?b; ?b < 2 ^ n + ?j\<rbrakk> \<Longrightarrow> square2 n ?i ?j - {(?a, ?b)} \<in> tiling Ls
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j

goal (1 subgoal):
 1. a < 2 ^ n + i \<and> b < 2 ^ n + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<or> a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j
[PROOF STEP]
by simp arith
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> b < 2 ^ n + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<or> a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> b < 2 ^ n + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<or> a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> b < 2 ^ n + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<or> a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
assume "?A"
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> b < 2 ^ n + j

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
hence "square2 n i j - {(a,b)} : tiling Ls"
[PROOF STATE]
proof (prove)
using this:
a < 2 ^ n + i \<and> b < 2 ^ n + j

goal (1 subgoal):
 1. square2 n i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
using IH a b
[PROOF STATE]
proof (prove)
using this:
a < 2 ^ n + i \<and> b < 2 ^ n + j
\<lbrakk>?i \<le> ?a; ?a < 2 ^ n + ?i; ?j \<le> ?b; ?b < 2 ^ n + ?j\<rbrakk> \<Longrightarrow> square2 n ?i ?j - {(?a, ?b)} \<in> tiling Ls
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j

goal (1 subgoal):
 1. square2 n i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
square2 n i j - {(a, b)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n i j - {(a, b)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n (2^n+i) j - {(2^n+i,2^n+j - 1)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n i (2^n+j) - {(2^n+i - 1, 2^n+j)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n (2^n+i) (2^n+j) - {(2^n+i, 2^n+j)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
square2 n i j - {(a, b)} \<in> tiling Ls
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls
[PROOF STEP]
have "square2 (n+1) i j - {(a,b)} - L0 (2^n+i - 1) (2^n+j - 1) \<in> tiling Ls"
[PROOF STATE]
proof (prove)
using this:
square2 n i j - {(a, b)} \<in> tiling Ls
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. square2 (n + 1) i j - {(a, b)} - L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
[PROOF STEP]
using  a b \<open>?A\<close>
[PROOF STATE]
proof (prove)
using this:
square2 n i j - {(a, b)} \<in> tiling Ls
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j
a < 2 ^ n + i \<and> b < 2 ^ n + j

goal (1 subgoal):
 1. square2 (n + 1) i j - {(a, b)} - L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
[PROOF STEP]
by (clarsimp simp: square2_Suc L0_def Un_Diff Diff_insert_if)
         (fastforce intro!: tiling_UnI DisjI1 DisjI2 square2_disj[THEN iffD2]
                   simp:Int_Un_distrib2)
[PROOF STATE]
proof (state)
this:
square2 (n + 1) i j - {(a, b)} - L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> b < 2 ^ n + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> b < 2 ^ n + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> b < 2 ^ n + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
assume "?B"
[PROOF STATE]
proof (state)
this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
hence "square2 n (2^n+i) j - {(a,b)} : tiling Ls"
[PROOF STATE]
proof (prove)
using this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j

goal (1 subgoal):
 1. square2 n (2 ^ n + i) j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
using IH a b
[PROOF STATE]
proof (prove)
using this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j
\<lbrakk>?i \<le> ?a; ?a < 2 ^ n + ?i; ?j \<le> ?b; ?b < 2 ^ n + ?j\<rbrakk> \<Longrightarrow> square2 n ?i ?j - {(?a, ?b)} \<in> tiling Ls
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j

goal (1 subgoal):
 1. square2 n (2 ^ n + i) j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) j - {(a, b)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) j - {(a, b)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n i j - {(2^n+i - 1,2^n+j - 1)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n i (2^n+j) - {(2^n+i - 1, 2^n+j)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n (2^n+i) (2^n+j) - {(2^n+i, 2^n+j)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
square2 n (2 ^ n + i) j - {(a, b)} \<in> tiling Ls
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls
[PROOF STEP]
have "square2 (n+1) i j - {(a,b)} - L1 (2^n+i - 1) (2^n+j - 1) \<in> tiling Ls"
[PROOF STATE]
proof (prove)
using this:
square2 n (2 ^ n + i) j - {(a, b)} \<in> tiling Ls
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. square2 (n + 1) i j - {(a, b)} - L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
[PROOF STEP]
using  a b \<open>?B\<close>
[PROOF STATE]
proof (prove)
using this:
square2 n (2 ^ n + i) j - {(a, b)} \<in> tiling Ls
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j

goal (1 subgoal):
 1. square2 (n + 1) i j - {(a, b)} - L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
[PROOF STEP]
by (simp add: square2_Suc L1_def Un_Diff Diff_insert_if le_diff_conv2)
         (fastforce intro!: tiling_UnI DisjI1 DisjI2 square2_disj[THEN iffD2]
                   simp:Int_Un_distrib2)
[PROOF STATE]
proof (state)
this:
square2 (n + 1) i j - {(a, b)} - L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
assume "?C"
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
hence "square2 n i (2^n+j) - {(a,b)} : tiling Ls"
[PROOF STATE]
proof (prove)
using this:
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j

goal (1 subgoal):
 1. square2 n i (2 ^ n + j) - {(a, b)} \<in> tiling Ls
[PROOF STEP]
using IH a b
[PROOF STATE]
proof (prove)
using this:
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j
\<lbrakk>?i \<le> ?a; ?a < 2 ^ n + ?i; ?j \<le> ?b; ?b < 2 ^ n + ?j\<rbrakk> \<Longrightarrow> square2 n ?i ?j - {(?a, ?b)} \<in> tiling Ls
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j

goal (1 subgoal):
 1. square2 n i (2 ^ n + j) - {(a, b)} \<in> tiling Ls
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
square2 n i (2 ^ n + j) - {(a, b)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n i (2 ^ n + j) - {(a, b)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n i j - {(2^n+i - 1,2^n+j - 1)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n (2^n+i) j - {(2^n+i, 2^n+j - 1)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n (2^n+i) (2^n+j) - {(2^n+i, 2^n+j)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
square2 n i (2 ^ n + j) - {(a, b)} \<in> tiling Ls
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls
[PROOF STEP]
have "square2 (n+1) i j - {(a,b)} - L3 (2^n+i - 1) (2^n+j - 1) \<in> tiling Ls"
[PROOF STATE]
proof (prove)
using this:
square2 n i (2 ^ n + j) - {(a, b)} \<in> tiling Ls
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. square2 (n + 1) i j - {(a, b)} - L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
[PROOF STEP]
using  a b \<open>?C\<close>
[PROOF STATE]
proof (prove)
using this:
square2 n i (2 ^ n + j) - {(a, b)} \<in> tiling Ls
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n (2 ^ n + i) (2 ^ n + j) - {(2 ^ n + i, 2 ^ n + j)} \<in> tiling Ls
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j

goal (1 subgoal):
 1. square2 (n + 1) i j - {(a, b)} - L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
[PROOF STEP]
by (simp add: square2_Suc L3_def Un_Diff Diff_insert_if le_diff_conv2)
         (fastforce intro!: tiling_UnI DisjI1 DisjI2 square2_disj[THEN iffD2]
                   simp:Int_Un_distrib2)
[PROOF STATE]
proof (state)
this:
square2 (n + 1) i j - {(a, b)} - L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
assume "?D"
[PROOF STATE]
proof (state)
this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
hence "square2 n (2^n+i) (2^n+j) -{(a,b)} : tiling Ls"
[PROOF STATE]
proof (prove)
using this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j

goal (1 subgoal):
 1. square2 n (2 ^ n + i) (2 ^ n + j) - {(a, b)} \<in> tiling Ls
[PROOF STEP]
using IH a b
[PROOF STATE]
proof (prove)
using this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j
\<lbrakk>?i \<le> ?a; ?a < 2 ^ n + ?i; ?j \<le> ?b; ?b < 2 ^ n + ?j\<rbrakk> \<Longrightarrow> square2 n ?i ?j - {(?a, ?b)} \<in> tiling Ls
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j

goal (1 subgoal):
 1. square2 n (2 ^ n + i) (2 ^ n + j) - {(a, b)} \<in> tiling Ls
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) (2 ^ n + j) - {(a, b)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) (2 ^ n + j) - {(a, b)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n i j - {(2^n+i - 1,2^n+j - 1)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n (2^n+i) j - {(2^n+i, 2^n+j - 1)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "square2 n i (2^n+j) - {(2^n+i - 1, 2^n+j)} : tiling Ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls
[PROOF STEP]
by(rule IH)(insert pos_pow2[of n], auto)
[PROOF STATE]
proof (state)
this:
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
square2 n (2 ^ n + i) (2 ^ n + j) - {(a, b)} \<in> tiling Ls
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls
[PROOF STEP]
have "square2 (n+1) i j - {(a,b)} - L2 (2^n+i - 1) (2^n+j - 1) \<in> tiling Ls"
[PROOF STATE]
proof (prove)
using this:
square2 n (2 ^ n + i) (2 ^ n + j) - {(a, b)} \<in> tiling Ls
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls

goal (1 subgoal):
 1. square2 (n + 1) i j - {(a, b)} - L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
[PROOF STEP]
using  a b \<open>?D\<close>
[PROOF STATE]
proof (prove)
using this:
square2 n (2 ^ n + i) (2 ^ n + j) - {(a, b)} \<in> tiling Ls
square2 n i j - {(2 ^ n + i - 1, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n (2 ^ n + i) j - {(2 ^ n + i, 2 ^ n + j - 1)} \<in> tiling Ls
square2 n i (2 ^ n + j) - {(2 ^ n + i - 1, 2 ^ n + j)} \<in> tiling Ls
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j

goal (1 subgoal):
 1. square2 (n + 1) i j - {(a, b)} - L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
[PROOF STEP]
by (simp add: square2_Suc L2_def Un_Diff Diff_insert_if le_diff_conv2)
         (fastforce intro!: tiling_UnI DisjI1 DisjI2 square2_disj[THEN iffD2]
                   simp:Int_Un_distrib2)
[PROOF STATE]
proof (state)
this:
square2 (n + 1) i j - {(a, b)} - L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "?A \<Longrightarrow> L0 (2^n + i - 1) (2^n + j - 1) \<subseteq> square2 (n+1) i j - {(a, b)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < 2 ^ n + i \<and> b < 2 ^ n + j \<Longrightarrow> L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j

goal (1 subgoal):
 1. a < 2 ^ n + i \<and> b < 2 ^ n + j \<Longrightarrow> L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
[PROOF STEP]
by(simp add:L0_def) arith
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> b < 2 ^ n + j \<Longrightarrow> L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> b < 2 ^ n + j \<Longrightarrow> L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "?B \<Longrightarrow> L1 (2^n + i - 1) (2^n + j - 1) \<subseteq> square2 (n+1) i j - {(a, b)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<Longrightarrow> L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j

goal (1 subgoal):
 1. 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<Longrightarrow> L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
[PROOF STEP]
by(simp add:L1_def) arith
[PROOF STATE]
proof (state)
this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<Longrightarrow> L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<Longrightarrow> L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "?C \<Longrightarrow> L3 (2^n + i - 1) (2^n + j - 1) \<subseteq> square2 (n+1) i j - {(a, b)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j

goal (1 subgoal):
 1. a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
[PROOF STEP]
by(simp add:L3_def) arith
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
have "?D \<Longrightarrow> L2 (2^n + i - 1) (2^n + j - 1) \<subseteq> square2 (n+1) i j - {(a, b)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
i \<le> a
a < 2 ^ Suc n + i
j \<le> b
b < 2 ^ Suc n + j

goal (1 subgoal):
 1. 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
[PROOF STEP]
by(simp add:L2_def) arith
[PROOF STATE]
proof (state)
this:
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}

goal (1 subgoal):
 1. \<And>n a b i j. \<lbrakk>\<And>a b i j. \<lbrakk>i \<le> a; a < 2 ^ n + i; j \<le> b; b < 2 ^ n + j\<rbrakk> \<Longrightarrow> square2 n i j - {(a, b)} \<in> tiling Ls; i \<le> a; a < 2 ^ Suc n + i; j \<le> b; b < 2 ^ Suc n + j\<rbrakk> \<Longrightarrow> square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a < 2 ^ n + i \<and> b < 2 ^ n + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<or> a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j
a < 2 ^ n + i \<and> b < 2 ^ n + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
a < 2 ^ n + i \<and> b < 2 ^ n + j \<Longrightarrow> L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<Longrightarrow> L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a < 2 ^ n + i \<and> b < 2 ^ n + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<or> a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<or> 2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j
a < 2 ^ n + i \<and> b < 2 ^ n + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> square2 (n + 1) i j - {(a, b)} - L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<in> tiling Ls
a < 2 ^ n + i \<and> b < 2 ^ n + j \<Longrightarrow> L0 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> b < 2 ^ n + j \<Longrightarrow> L1 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
a < 2 ^ n + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> L3 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}
2 ^ n + i \<le> a \<and> a < 2 ^ (n + 1) + i \<and> 2 ^ n + j \<le> b \<and> b < 2 ^ (n + 1) + j \<Longrightarrow> L2 (2 ^ n + i - 1) (2 ^ n + j - 1) \<subseteq> square2 (n + 1) i j - {(a, b)}

goal (1 subgoal):
 1. square2 (Suc n) i j - {(a, b)} \<in> tiling Ls
[PROOF STEP]
by simp (metis LinLs tiling_Diff1E)
[PROOF STATE]
proof (state)
this:
square2 (Suc n) i j - {(a, b)} \<in> tiling Ls

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proper_map_paired_continuous_map_right:
   "\<lbrakk>continuous_map X Y f; Hausdorff_space Y\<rbrakk>
        \<Longrightarrow> proper_map X (prod_topology X Y) (\<lambda>x. (x,f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X Y f; Hausdorff_space Y\<rbrakk> \<Longrightarrow> proper_map X (prod_topology X Y) (\<lambda>x. (x, f x))
[PROOF STEP]
using closed_injective_imp_proper_map closed_map_paired_continuous_map_right
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>closed_map ?X ?Y ?f; inj_on ?f (topspace ?X)\<rbrakk> \<Longrightarrow> proper_map ?X ?Y ?f
\<lbrakk>continuous_map ?X ?Y ?f; Hausdorff_space ?Y\<rbrakk> \<Longrightarrow> closed_map ?X (prod_topology ?X ?Y) (\<lambda>x. (x, ?f x))

goal (1 subgoal):
 1. \<lbrakk>continuous_map X Y f; Hausdorff_space Y\<rbrakk> \<Longrightarrow> proper_map X (prod_topology X Y) (\<lambda>x. (x, f x))
[PROOF STEP]
by (metis (mono_tags, lifting) Pair_inject inj_onI)


[STATEMENT]
lemma triangular_mat_P_upper: "upper_triangular_mat (P_upper d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_triangular_mat (P_upper d)
[PROOF STEP]
unfolding upper_triangular_mat_def P_upper_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. j < i \<longrightarrow> (\<chi>i j. if i \<le> j then P_dec d $ i $ j else 0) $ i $ j = 0
[PROOF STEP]
by auto