[STATEMENT]
lemma sauer_shelah_0:
  fixes F :: "'a set set"
  shows "finite (\<Union> F) \<Longrightarrow> card F \<le> card (shattered_by F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union> F) \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
proof (induction F rule: measure_induct_rule[of "card"])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>y. \<lbrakk>card y < card x; finite (\<Union> y)\<rbrakk> \<Longrightarrow> card y \<le> card (shattered_by y); finite (\<Union> x)\<rbrakk> \<Longrightarrow> card x \<le> card (shattered_by x)
[PROOF STEP]
case (less F)
[PROOF STATE]
proof (state)
this:
\<lbrakk>card ?y < card F; finite (\<Union> ?y)\<rbrakk> \<Longrightarrow> card ?y \<le> card (shattered_by ?y)
finite (\<Union> F)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>y. \<lbrakk>card y < card x; finite (\<Union> y)\<rbrakk> \<Longrightarrow> card y \<le> card (shattered_by y); finite (\<Union> x)\<rbrakk> \<Longrightarrow> card x \<le> card (shattered_by x)
[PROOF STEP]
note finite_F = finite_UnionD[OF less(2)]
[PROOF STATE]
proof (state)
this:
finite F

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>y. \<lbrakk>card y < card x; finite (\<Union> y)\<rbrakk> \<Longrightarrow> card y \<le> card (shattered_by y); finite (\<Union> x)\<rbrakk> \<Longrightarrow> card x \<le> card (shattered_by x)
[PROOF STEP]
note finite_shF = finite_shattered_by[OF less(2)]
[PROOF STATE]
proof (state)
this:
finite (shattered_by F)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>y. \<lbrakk>card y < card x; finite (\<Union> y)\<rbrakk> \<Longrightarrow> card y \<le> card (shattered_by y); finite (\<Union> x)\<rbrakk> \<Longrightarrow> card x \<le> card (shattered_by x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card F \<le> card (shattered_by F)
[PROOF STEP]
proof (cases "2 \<le> card F")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
2 \<le> card F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from obtain_difference_element[OF True]
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. \<lbrakk>x \<in> \<Union> F; x \<notin> \<Inter> F\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain x :: 'a where x_in_Union_F: "x \<in> \<Union>F"
                     and x_not_in_Int_F: "x \<notin> \<Inter>F"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. \<lbrakk>x \<in> \<Union> F; x \<notin> \<Inter> F\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

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

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
text \<open>Define F0 as the subfamily of F containing sets that don't contain @{term x}.\<close>
[PROOF STATE]
proof (state)
this:
x \<in> \<Union> F
x \<notin> \<Inter> F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
let ?F0 = "{S \<in> F. x \<notin> S}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from x_in_Union_F
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<Union> F
[PROOF STEP]
have F0_psubset_F: "?F0 \<subset> F"
[PROOF STATE]
proof (prove)
using this:
x \<in> \<Union> F

goal (1 subgoal):
 1. {S \<in> F. x \<notin> S} \<subset> F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{S \<in> F. x \<notin> S} \<subset> F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from F0_psubset_F
[PROOF STATE]
proof (chain)
picking this:
{S \<in> F. x \<notin> S} \<subset> F
[PROOF STEP]
have F0_in_F: "?F0 \<subseteq> F"
[PROOF STATE]
proof (prove)
using this:
{S \<in> F. x \<notin> S} \<subset> F

goal (1 subgoal):
 1. {S \<in> F. x \<notin> S} \<subseteq> F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{S \<in> F. x \<notin> S} \<subseteq> F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from subset_shattered_by[OF F0_in_F]
[PROOF STATE]
proof (chain)
picking this:
shattered_by {S \<in> F. x \<notin> S} \<subseteq> shattered_by F
[PROOF STEP]
have shF0_subset_shF: "shattered_by ?F0 \<subseteq> shattered_by F"
[PROOF STATE]
proof (prove)
using this:
shattered_by {S \<in> F. x \<notin> S} \<subseteq> shattered_by F

goal (1 subgoal):
 1. shattered_by {S \<in> F. x \<notin> S} \<subseteq> shattered_by F
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
shattered_by {S \<in> F. x \<notin> S} \<subseteq> shattered_by F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from F0_in_F
[PROOF STATE]
proof (chain)
picking this:
{S \<in> F. x \<notin> S} \<subseteq> F
[PROOF STEP]
have Un_F0_in_Un_F:"\<Union> ?F0 \<subseteq> \<Union> F"
[PROOF STATE]
proof (prove)
using this:
{S \<in> F. x \<notin> S} \<subseteq> F

goal (1 subgoal):
 1. \<Union> {S \<in> F. x \<notin> S} \<subseteq> \<Union> F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Union> {S \<in> F. x \<notin> S} \<subseteq> \<Union> F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
text \<open>F0 shatters at least as many sets as @{term "card F0"} by the induction hypothesis.\<close>
[PROOF STATE]
proof (state)
this:
\<Union> {S \<in> F. x \<notin> S} \<subseteq> \<Union> F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
note IH_F0 = less(1)[OF psubset_card_mono[OF finite_F F0_psubset_F] rev_finite_subset[OF less(2) Un_F0_in_Un_F]]
[PROOF STATE]
proof (state)
this:
card {S \<in> F. x \<notin> S} \<le> card (shattered_by {S \<in> F. x \<notin> S})

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
text \<open>Define F1 as the subfamily of F containing sets that contain @{term x}.\<close>
[PROOF STATE]
proof (state)
this:
card {S \<in> F. x \<notin> S} \<le> card (shattered_by {S \<in> F. x \<notin> S})

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
let ?F1 = "{S \<in> F. x \<in> S}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from x_not_in_Int_F
[PROOF STATE]
proof (chain)
picking this:
x \<notin> \<Inter> F
[PROOF STEP]
have F1_psubset_F: "?F1 \<subset> F"
[PROOF STATE]
proof (prove)
using this:
x \<notin> \<Inter> F

goal (1 subgoal):
 1. {S \<in> F. x \<in> S} \<subset> F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{S \<in> F. x \<in> S} \<subset> F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from F1_psubset_F
[PROOF STATE]
proof (chain)
picking this:
{S \<in> F. x \<in> S} \<subset> F
[PROOF STEP]
have F1_in_F: "?F1 \<subseteq> F"
[PROOF STATE]
proof (prove)
using this:
{S \<in> F. x \<in> S} \<subset> F

goal (1 subgoal):
 1. {S \<in> F. x \<in> S} \<subseteq> F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{S \<in> F. x \<in> S} \<subseteq> F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from subset_shattered_by[OF F1_in_F]
[PROOF STATE]
proof (chain)
picking this:
shattered_by {S \<in> F. x \<in> S} \<subseteq> shattered_by F
[PROOF STEP]
have shF1_subset_shF: "shattered_by ?F1 \<subseteq> shattered_by F"
[PROOF STATE]
proof (prove)
using this:
shattered_by {S \<in> F. x \<in> S} \<subseteq> shattered_by F

goal (1 subgoal):
 1. shattered_by {S \<in> F. x \<in> S} \<subseteq> shattered_by F
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
shattered_by {S \<in> F. x \<in> S} \<subseteq> shattered_by F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from F1_in_F
[PROOF STATE]
proof (chain)
picking this:
{S \<in> F. x \<in> S} \<subseteq> F
[PROOF STEP]
have Un_F1_in_Un_F:"\<Union> ?F1 \<subseteq> \<Union> F"
[PROOF STATE]
proof (prove)
using this:
{S \<in> F. x \<in> S} \<subseteq> F

goal (1 subgoal):
 1. \<Union> {S \<in> F. x \<in> S} \<subseteq> \<Union> F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Union> {S \<in> F. x \<in> S} \<subseteq> \<Union> F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
text \<open>F1 shatters at least as many sets as @{term "card F1"} by the induction hypothesis.\<close>
[PROOF STATE]
proof (state)
this:
\<Union> {S \<in> F. x \<in> S} \<subseteq> \<Union> F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
note IH_F1 = less(1)[OF psubset_card_mono[OF finite_F F1_psubset_F] rev_finite_subset[OF less(2) Un_F1_in_Un_F]]
[PROOF STATE]
proof (state)
this:
card {S \<in> F. x \<in> S} \<le> card (shattered_by {S \<in> F. x \<in> S})

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from shF0_subset_shF shF1_subset_shF
[PROOF STATE]
proof (chain)
picking this:
shattered_by {S \<in> F. x \<notin> S} \<subseteq> shattered_by F
shattered_by {S \<in> F. x \<in> S} \<subseteq> shattered_by F
[PROOF STEP]
have shattered_subset: "(shattered_by ?F0) \<union> (shattered_by ?F1) \<subseteq> shattered_by F"
[PROOF STATE]
proof (prove)
using this:
shattered_by {S \<in> F. x \<notin> S} \<subseteq> shattered_by F
shattered_by {S \<in> F. x \<in> S} \<subseteq> shattered_by F

goal (1 subgoal):
 1. shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S} \<subseteq> shattered_by F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S} \<subseteq> shattered_by F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
text \<open>There is a set with the same cardinality as the intersection of
        @{term "shattered_by F0"} and @{term "shattered_by F1"} which is disjoint from their union and is also contained in @{term "shattered_by F"}.\<close>
[PROOF STATE]
proof (state)
this:
shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S} \<subseteq> shattered_by F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
have f_copies_the_intersection:
      "\<exists>f. inj_on f (shattered_by ?F0 \<inter> shattered_by ?F1) \<and>
       (shattered_by ?F0 \<union> shattered_by ?F1) \<inter> (f ` (shattered_by ?F0 \<inter> shattered_by ?F1)) = {} \<and>
       f ` (shattered_by ?F0 \<inter> shattered_by ?F1) \<subseteq> shattered_by F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. inj_on f (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on ?f (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
have x_not_in_shattered: "\<forall>S\<in>(shattered_by ?F0) \<union> (shattered_by ?F1). x \<notin> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S\<in>shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}. x \<notin> S
[PROOF STEP]
unfolding shattered_by_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S\<in>{A. {S \<in> F. x \<notin> S} shatters A} \<union> {A. {S \<in> F. x \<in> S} shatters A}. x \<notin> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>S\<in>shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}. x \<notin> S

goal (1 subgoal):
 1. inj_on ?f (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
text \<open>This set is precisely the image of the intersection under @{term "insert x"}.\<close>
[PROOF STATE]
proof (state)
this:
\<forall>S\<in>shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}. x \<notin> S

goal (1 subgoal):
 1. inj_on ?f (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
let ?f = "insert x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on ?f (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
have 0: "inj_on ?f (shattered_by ?F0 \<inter> shattered_by ?F1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (insert x) (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; y \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; insert x xa = insert x y\<rbrakk> \<Longrightarrow> xa = y
[PROOF STEP]
fix X Y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; y \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; insert x xa = insert x y\<rbrakk> \<Longrightarrow> xa = y
[PROOF STEP]
assume x0: "X \<in> (shattered_by ?F0 \<inter> shattered_by ?F1)" and y0: "Y \<in> (shattered_by ?F0 \<inter> shattered_by ?F1)"
               and 0: "?f X = ?f Y"
[PROOF STATE]
proof (state)
this:
X \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}
Y \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}
insert x X = insert x Y

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; y \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; insert x xa = insert x y\<rbrakk> \<Longrightarrow> xa = y
[PROOF STEP]
from x_not_in_shattered x0
[PROOF STATE]
proof (chain)
picking this:
\<forall>S\<in>shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}. x \<notin> S
X \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}
[PROOF STEP]
have "X = ?f X - {x}"
[PROOF STATE]
proof (prove)
using this:
\<forall>S\<in>shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}. x \<notin> S
X \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}

goal (1 subgoal):
 1. X = insert x X - {x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
X = insert x X - {x}

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; y \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; insert x xa = insert x y\<rbrakk> \<Longrightarrow> xa = y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X = insert x X - {x}

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; y \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; insert x xa = insert x y\<rbrakk> \<Longrightarrow> xa = y
[PROOF STEP]
from 0
[PROOF STATE]
proof (chain)
picking this:
insert x X = insert x Y
[PROOF STEP]
have "... = ?f Y - {x}"
[PROOF STATE]
proof (prove)
using this:
insert x X = insert x Y

goal (1 subgoal):
 1. insert x X - {x} = insert x Y - {x}
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
insert x X - {x} = insert x Y - {x}

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; y \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; insert x xa = insert x y\<rbrakk> \<Longrightarrow> xa = y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
insert x X - {x} = insert x Y - {x}

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; y \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; insert x xa = insert x y\<rbrakk> \<Longrightarrow> xa = y
[PROOF STEP]
from x_not_in_shattered y0
[PROOF STATE]
proof (chain)
picking this:
\<forall>S\<in>shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}. x \<notin> S
Y \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}
[PROOF STEP]
have "... = Y"
[PROOF STATE]
proof (prove)
using this:
\<forall>S\<in>shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}. x \<notin> S
Y \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}

goal (1 subgoal):
 1. insert x Y - {x} = Y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
insert x Y - {x} = Y

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; y \<in> shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}; insert x xa = insert x y\<rbrakk> \<Longrightarrow> xa = y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
X = Y
[PROOF STEP]
show "X = Y"
[PROOF STATE]
proof (prove)
using this:
X = Y

goal (1 subgoal):
 1. X = Y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
X = Y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj_on (insert x) (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})

goal (1 subgoal):
 1. inj_on ?f (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
text \<open>The set is disjoint from the union.\<close>
[PROOF STATE]
proof (state)
this:
inj_on (insert x) (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})

goal (1 subgoal):
 1. inj_on ?f (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
have 1: "(shattered_by ?F0 \<union> shattered_by ?F1) \<inter> ?f ` (shattered_by ?F0 \<inter> shattered_by ?F1) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {}
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
assume "(shattered_by ?F0 \<union> shattered_by ?F1) \<inter> ?f ` (shattered_by ?F0 \<inter> shattered_by ?F1) \<noteq> {}"
[PROOF STATE]
proof (state)
this:
(shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<noteq> {}

goal (1 subgoal):
 1. (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<noteq> {}
[PROOF STEP]
obtain S where 10: "S \<in> (shattered_by ?F0 \<union> shattered_by ?F1)"
                        and 11: "S \<in> ?f ` (shattered_by ?F0 \<inter> shattered_by ?F1)"
[PROOF STATE]
proof (prove)
using this:
(shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<noteq> {}

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>S \<in> shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}; S \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<in> shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}
S \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})

goal (1 subgoal):
 1. (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
from 10 x_not_in_shattered
[PROOF STATE]
proof (chain)
picking this:
S \<in> shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}
\<forall>S\<in>shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}. x \<notin> S
[PROOF STEP]
have "x \<notin> S"
[PROOF STATE]
proof (prove)
using this:
S \<in> shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}
\<forall>S\<in>shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}. x \<notin> S

goal (1 subgoal):
 1. x \<notin> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<notin> S

goal (1 subgoal):
 1. (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
with 11
[PROOF STATE]
proof (chain)
picking this:
S \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})
x \<notin> S
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
S \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})
x \<notin> S

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {}

goal (1 subgoal):
 1. inj_on ?f (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
text \<open>This set is also in @{term "shattered_by F"}.\<close>
[PROOF STATE]
proof (state)
this:
(shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {}

goal (1 subgoal):
 1. inj_on ?f (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
have 2: "?f ` (shattered_by ?F0 \<inter> shattered_by ?F1) \<subseteq> shattered_by F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
fix S_x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
assume "S_x \<in> ?f ` (shattered_by ?F0 \<inter> shattered_by ?F1)"
[PROOF STATE]
proof (state)
this:
S_x \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S_x \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})
[PROOF STEP]
obtain S where 20: "S \<in> shattered_by ?F0"
                        and 21: "S \<in> shattered_by ?F1"
                        and 22: "S_x = ?f S"
[PROOF STATE]
proof (prove)
using this:
S_x \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>S \<in> shattered_by {S \<in> F. x \<notin> S}; S \<in> shattered_by {S \<in> F. x \<in> S}; S_x = insert x S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S \<in> shattered_by {S \<in> F. x \<notin> S}
S \<in> shattered_by {S \<in> F. x \<in> S}
S_x = insert x S

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
from x_not_in_shattered 20
[PROOF STATE]
proof (chain)
picking this:
\<forall>S\<in>shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}. x \<notin> S
S \<in> shattered_by {S \<in> F. x \<notin> S}
[PROOF STEP]
have x_not_in_S: "x \<notin> S"
[PROOF STATE]
proof (prove)
using this:
\<forall>S\<in>shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}. x \<notin> S
S \<in> shattered_by {S \<in> F. x \<notin> S}

goal (1 subgoal):
 1. x \<notin> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<notin> S

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
from 22 Pow_insert[of x S]
[PROOF STATE]
proof (chain)
picking this:
S_x = insert x S
Pow (insert x S) = Pow S \<union> insert x ` Pow S
[PROOF STEP]
have "Pow S_x = Pow S \<union> ?f ` Pow S"
[PROOF STATE]
proof (prove)
using this:
S_x = insert x S
Pow (insert x S) = Pow S \<union> insert x ` Pow S

goal (1 subgoal):
 1. Pow S_x = Pow S \<union> insert x ` Pow S
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
Pow S_x = Pow S \<union> insert x ` Pow S

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Pow S_x = Pow S \<union> insert x ` Pow S

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
from 20
[PROOF STATE]
proof (chain)
picking this:
S \<in> shattered_by {S \<in> F. x \<notin> S}
[PROOF STEP]
have "... = (?F0 \<inter>* S) \<union> (?f ` Pow S)"
[PROOF STATE]
proof (prove)
using this:
S \<in> shattered_by {S \<in> F. x \<notin> S}

goal (1 subgoal):
 1. Pow S \<union> insert x ` Pow S = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` Pow S
[PROOF STEP]
unfolding shattered_by_def
[PROOF STATE]
proof (prove)
using this:
S \<in> {A. {S \<in> F. x \<notin> S} shatters A}

goal (1 subgoal):
 1. Pow S \<union> insert x ` Pow S = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` Pow S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Pow S \<union> insert x ` Pow S = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` Pow S

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Pow S \<union> insert x ` Pow S = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` Pow S

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
from 21
[PROOF STATE]
proof (chain)
picking this:
S \<in> shattered_by {S \<in> F. x \<in> S}
[PROOF STEP]
have "... = (?F0 \<inter>* S) \<union> (?f ` (?F1 \<inter>* S))"
[PROOF STATE]
proof (prove)
using this:
S \<in> shattered_by {S \<in> F. x \<in> S}

goal (1 subgoal):
 1. ({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` Pow S = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` ({S \<in> F. x \<in> S} \<inter>* S)
[PROOF STEP]
unfolding shattered_by_def
[PROOF STATE]
proof (prove)
using this:
S \<in> {A. {S \<in> F. x \<in> S} shatters A}

goal (1 subgoal):
 1. ({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` Pow S = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` ({S \<in> F. x \<in> S} \<inter>* S)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` Pow S = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` ({S \<in> F. x \<in> S} \<inter>* S)

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` Pow S = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` ({S \<in> F. x \<in> S} \<inter>* S)

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
from insert_IntF[of x S ?F1]
[PROOF STATE]
proof (chain)
picking this:
insert x ` ({S \<in> F. x \<in> S} \<inter>* S) = insert x ` {S \<in> F. x \<in> S} \<inter>* insert x S
[PROOF STEP]
have "... = (?F0 \<inter>* S) \<union> (?f ` ?F1 \<inter>* (?f S))"
[PROOF STATE]
proof (prove)
using this:
insert x ` ({S \<in> F. x \<in> S} \<inter>* S) = insert x ` {S \<in> F. x \<in> S} \<inter>* insert x S

goal (1 subgoal):
 1. ({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` ({S \<in> F. x \<in> S} \<inter>* S) = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> (insert x ` {S \<in> F. x \<in> S} \<inter>* insert x S)
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` ({S \<in> F. x \<in> S} \<inter>* S) = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> (insert x ` {S \<in> F. x \<in> S} \<inter>* insert x S)

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
({S \<in> F. x \<notin> S} \<inter>* S) \<union> insert x ` ({S \<in> F. x \<in> S} \<inter>* S) = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> (insert x ` {S \<in> F. x \<in> S} \<inter>* insert x S)

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
from 22
[PROOF STATE]
proof (chain)
picking this:
S_x = insert x S
[PROOF STEP]
have "... = (?F0 \<inter>* S) \<union> (?F1 \<inter>* S_x)"
[PROOF STATE]
proof (prove)
using this:
S_x = insert x S

goal (1 subgoal):
 1. ({S \<in> F. x \<notin> S} \<inter>* S) \<union> (insert x ` {S \<in> F. x \<in> S} \<inter>* insert x S) = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> ({S \<in> F. x \<in> S} \<inter>* S_x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
({S \<in> F. x \<notin> S} \<inter>* S) \<union> (insert x ` {S \<in> F. x \<in> S} \<inter>* insert x S) = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> ({S \<in> F. x \<in> S} \<inter>* S_x)

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
({S \<in> F. x \<notin> S} \<inter>* S) \<union> (insert x ` {S \<in> F. x \<in> S} \<inter>* insert x S) = ({S \<in> F. x \<notin> S} \<inter>* S) \<union> ({S \<in> F. x \<in> S} \<inter>* S_x)

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
from 22
[PROOF STATE]
proof (chain)
picking this:
S_x = insert x S
[PROOF STEP]
have "... = (?F0 \<inter>* S_x) \<union> (?F1 \<inter>* S_x)"
[PROOF STATE]
proof (prove)
using this:
S_x = insert x S

goal (1 subgoal):
 1. ({S \<in> F. x \<notin> S} \<inter>* S) \<union> ({S \<in> F. x \<in> S} \<inter>* S_x) = ({S \<in> F. x \<notin> S} \<inter>* S_x) \<union> ({S \<in> F. x \<in> S} \<inter>* S_x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
({S \<in> F. x \<notin> S} \<inter>* S) \<union> ({S \<in> F. x \<in> S} \<inter>* S_x) = ({S \<in> F. x \<notin> S} \<inter>* S_x) \<union> ({S \<in> F. x \<in> S} \<inter>* S_x)

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
({S \<in> F. x \<notin> S} \<inter>* S) \<union> ({S \<in> F. x \<in> S} \<inter>* S_x) = ({S \<in> F. x \<notin> S} \<inter>* S_x) \<union> ({S \<in> F. x \<in> S} \<inter>* S_x)

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
from subset_IntF[OF F0_in_F, of S_x] subset_IntF[OF F1_in_F, of S_x]
[PROOF STATE]
proof (chain)
picking this:
{S \<in> F. x \<notin> S} \<inter>* S_x \<subseteq> F \<inter>* S_x
{S \<in> F. x \<in> S} \<inter>* S_x \<subseteq> F \<inter>* S_x
[PROOF STEP]
have "... \<subseteq> (F \<inter>* S_x)"
[PROOF STATE]
proof (prove)
using this:
{S \<in> F. x \<notin> S} \<inter>* S_x \<subseteq> F \<inter>* S_x
{S \<in> F. x \<in> S} \<inter>* S_x \<subseteq> F \<inter>* S_x

goal (1 subgoal):
 1. ({S \<in> F. x \<notin> S} \<inter>* S_x) \<union> ({S \<in> F. x \<in> S} \<inter>* S_x) \<subseteq> F \<inter>* S_x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
({S \<in> F. x \<notin> S} \<inter>* S_x) \<union> ({S \<in> F. x \<in> S} \<inter>* S_x) \<subseteq> F \<inter>* S_x

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Pow S_x \<subseteq> F \<inter>* S_x
[PROOF STEP]
have "Pow S_x \<subseteq> (F \<inter>* S_x)"
[PROOF STATE]
proof (prove)
using this:
Pow S_x \<subseteq> F \<inter>* S_x

goal (1 subgoal):
 1. Pow S_x \<subseteq> F \<inter>* S_x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Pow S_x \<subseteq> F \<inter>* S_x

goal (1 subgoal):
 1. \<And>xa. xa \<in> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<Longrightarrow> xa \<in> shattered_by F
[PROOF STEP]
thus "S_x \<in> shattered_by F"
[PROOF STATE]
proof (prove)
using this:
Pow S_x \<subseteq> F \<inter>* S_x

goal (1 subgoal):
 1. S_x \<in> shattered_by F
[PROOF STEP]
unfolding shattered_by_def
[PROOF STATE]
proof (prove)
using this:
Pow S_x \<subseteq> F \<inter>* S_x

goal (1 subgoal):
 1. S_x \<in> {A. F shatters A}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S_x \<in> shattered_by F

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F

goal (1 subgoal):
 1. inj_on ?f (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> ?f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
from 0 1 2
[PROOF STATE]
proof (chain)
picking this:
inj_on (insert x) (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})
(shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {}
insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
show "inj_on ?f (shattered_by ?F0 \<inter> shattered_by ?F1) \<and>
        (shattered_by ?F0 \<union> shattered_by ?F1) \<inter> (?f ` (shattered_by ?F0 \<inter> shattered_by ?F1)) = {} \<and>
        ?f ` (shattered_by ?F0 \<inter> shattered_by ?F1) \<subseteq> shattered_by F"
[PROOF STATE]
proof (prove)
using this:
inj_on (insert x) (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S})
(shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {}
insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F

goal (1 subgoal):
 1. inj_on (insert x) (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on (insert x) (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> insert x ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>f. inj_on f (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<and> (shattered_by {S \<in> F. x \<notin> S} \<union> shattered_by {S \<in> F. x \<in> S}) \<inter> f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) = {} \<and> f ` (shattered_by {S \<in> F. x \<notin> S} \<inter> shattered_by {S \<in> F. x \<in> S}) \<subseteq> shattered_by F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
have F0_union_F1_is_F: "?F0 \<union> ?F1 = F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {S \<in> F. x \<notin> S} \<union> {S \<in> F. x \<in> S} = F
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{S \<in> F. x \<notin> S} \<union> {S \<in> F. x \<in> S} = F

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from finite_F
[PROOF STATE]
proof (chain)
picking this:
finite F
[PROOF STEP]
have finite_F0: "finite ?F0" and finite_F1: "finite ?F1"
[PROOF STATE]
proof (prove)
using this:
finite F

goal (1 subgoal):
 1. finite {S \<in> F. x \<notin> S} &&& finite {S \<in> F. x \<in> S}
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
finite {S \<in> F. x \<notin> S}
finite {S \<in> F. x \<in> S}

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
have disjoint_F0_F1: "?F0 \<inter> ?F1 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {S \<in> F. x \<notin> S} \<inter> {S \<in> F. x \<in> S} = {}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{S \<in> F. x \<notin> S} \<inter> {S \<in> F. x \<in> S} = {}

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
text \<open>We have the following lower bound on the cardinality of @{term "shattered_by F"}:\<close>
[PROOF STATE]
proof (state)
this:
{S \<in> F. x \<notin> S} \<inter> {S \<in> F. x \<in> S} = {}

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from F0_union_F1_is_F card_Un_disjoint[OF finite_F0 finite_F1 disjoint_F0_F1]
[PROOF STATE]
proof (chain)
picking this:
{S \<in> F. x \<notin> S} \<union> {S \<in> F. x \<in> S} = F
card ({S \<in> F. x \<notin> S} \<union> {S \<in> F. x \<in> S}) = card {S \<in> F. x \<notin> S} + card {S \<in> F. x \<in> S}
[PROOF STEP]
have "card F = card ?F0 + card ?F1"
[PROOF STATE]
proof (prove)
using this:
{S \<in> F. x \<notin> S} \<union> {S \<in> F. x \<in> S} = F
card ({S \<in> F. x \<notin> S} \<union> {S \<in> F. x \<in> S}) = card {S \<in> F. x \<notin> S} + card {S \<in> F. x \<in> S}

goal (1 subgoal):
 1. card F = card {S \<in> F. x \<notin> S} + card {S \<in> F. x \<in> S}
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
card F = card {S \<in> F. x \<notin> S} + card {S \<in> F. x \<in> S}

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card F = card {S \<in> F. x \<notin> S} + card {S \<in> F. x \<in> S}

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from IH_F0
[PROOF STATE]
proof (chain)
picking this:
card {S \<in> F. x \<notin> S} \<le> card (shattered_by {S \<in> F. x \<notin> S})
[PROOF STEP]
have "... \<le> card (shattered_by ?F0) + card ?F1"
[PROOF STATE]
proof (prove)
using this:
card {S \<in> F. x \<notin> S} \<le> card (shattered_by {S \<in> F. x \<notin> S})

goal (1 subgoal):
 1. card {S \<in> F. x \<notin> S} + card {S \<in> F. x \<in> S} \<le> card (shattered_by {S \<in> F. x \<notin> S}) + card {S \<in> F. x \<in> S}
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
card {S \<in> F. x \<notin> S} + card {S \<in> F. x \<in> S} \<le> card (shattered_by {S \<in> F. x \<notin> S}) + card {S \<in> F. x \<in> S}

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {S \<in> F. x \<notin> S} + card {S \<in> F. x \<in> S} \<le> card (shattered_by {S \<in> F. x \<notin> S}) + card {S \<in> F. x \<in> S}

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from IH_F1
[PROOF STATE]
proof (chain)
picking this:
card {S \<in> F. x \<in> S} \<le> card (shattered_by {S \<in> F. x \<in> S})
[PROOF STEP]
have "... \<le> card (shattered_by ?F0) + card (shattered_by ?F1)"
[PROOF STATE]
proof (prove)
using this:
card {S \<in> F. x \<in> S} \<le> card (shattered_by {S \<in> F. x \<in> S})

goal (1 subgoal):
 1. card (shattered_by {S \<in> F. x \<notin> S}) + card {S \<in> F. x \<in> S} \<le> card (shattered_by {S \<in> F. x \<notin> S}) + card (shattered_by {S \<in> F. x \<in> S})
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
card (shattered_by {S \<in> F. x \<notin> S}) + card {S \<in> F. x \<in> S} \<le> card (shattered_by {S \<in> F. x \<notin> S}) + card (shattered_by {S \<in> F. x \<in> S})

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (shattered_by {S \<in> F. x \<notin> S}) + card {S \<in> F. x \<in> S} \<le> card (shattered_by {S \<in> F. x \<notin> S}) + card (shattered_by {S \<in> F. x \<in> S})

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from card_Int_copy[OF finite_shF shattered_subset f_copies_the_intersection]
[PROOF STATE]
proof (chain)
picking this:
card (shattered_by {S \<in> F. x \<notin> S}) + card (shattered_by {S \<in> F. x \<in> S}) \<le> card (shattered_by F)
[PROOF STEP]
have "... \<le> card (shattered_by F)"
[PROOF STATE]
proof (prove)
using this:
card (shattered_by {S \<in> F. x \<notin> S}) + card (shattered_by {S \<in> F. x \<in> S}) \<le> card (shattered_by F)

goal (1 subgoal):
 1. card (shattered_by {S \<in> F. x \<notin> S}) + card (shattered_by {S \<in> F. x \<in> S}) \<le> card (shattered_by F)
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
card (shattered_by {S \<in> F. x \<notin> S}) + card (shattered_by {S \<in> F. x \<in> S}) \<le> card (shattered_by F)

goal (2 subgoals):
 1. 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
 2. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card F \<le> card (shattered_by F)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card F \<le> card (shattered_by F)

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

goal (1 subgoal):
 1. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
text \<open>If @{term F} contains less than 2 sets, the statement follows trivially.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 2 \<le> card F

goal (1 subgoal):
 1. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
hence "card F = 0 \<or> card F = 1"
[PROOF STATE]
proof (prove)
using this:
\<not> 2 \<le> card F

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

goal (1 subgoal):
 1. \<not> 2 \<le> card F \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card F = 0 \<or> card F = 1

goal (1 subgoal):
 1. card F \<le> card (shattered_by F)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card F = 0 \<Longrightarrow> card F \<le> card (shattered_by F)
 2. card F = 1 \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
assume "card F = 0"
[PROOF STATE]
proof (state)
this:
card F = 0

goal (2 subgoals):
 1. card F = 0 \<Longrightarrow> card F \<le> card (shattered_by F)
 2. card F = 1 \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card F = 0

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

goal (1 subgoal):
 1. card F = 1 \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card F = 1 \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
assume asm: "card F = 1"
[PROOF STATE]
proof (state)
this:
card F = 1

goal (1 subgoal):
 1. card F = 1 \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
hence F_not_empty: "F \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
card F = 1

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

goal (1 subgoal):
 1. card F = 1 \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from shatters_empty[OF F_not_empty]
[PROOF STATE]
proof (chain)
picking this:
F shatters {}
[PROOF STEP]
have "{{}} \<subseteq> shattered_by F"
[PROOF STATE]
proof (prove)
using this:
F shatters {}

goal (1 subgoal):
 1. {{}} \<subseteq> shattered_by F
[PROOF STEP]
unfolding shattered_by_def
[PROOF STATE]
proof (prove)
using this:
F shatters {}

goal (1 subgoal):
 1. {{}} \<subseteq> {A. F shatters A}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{{}} \<subseteq> shattered_by F

goal (1 subgoal):
 1. card F = 1 \<Longrightarrow> card F \<le> card (shattered_by F)
[PROOF STEP]
from card_mono[OF finite_shF this] asm
[PROOF STATE]
proof (chain)
picking this:
card {{}} \<le> card (shattered_by F)
card F = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {{}} \<le> card (shattered_by F)
card F = 1

goal (1 subgoal):
 1. card F \<le> card (shattered_by F)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
card F \<le> card (shattered_by F)

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Module) indmhomTr2:"\<lbrakk>R module N; f \<in> mHom R M N\<rbrakk>
      \<Longrightarrow> (f\<^sup>\<flat>\<^bsub>R M,N\<^esub>) \<in> set_mr_cos M (ker\<^bsub>M,N\<^esub> f) \<rightarrow> carrier N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N\<rbrakk> \<Longrightarrow> f\<^sup>\<flat>\<^bsub>R M, N\<^esub> \<in> set_mr_cos M (ker\<^bsub>M,N\<^esub> f) \<rightarrow> carrier N
[PROOF STEP]
apply (rule Pi_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>R module N; f \<in> mHom R M N; x \<in> set_mr_cos M (ker\<^bsub>M,N\<^esub> f)\<rbrakk> \<Longrightarrow> (f\<^sup>\<flat>\<^bsub>R M, N\<^esub>) x \<in> carrier N
[PROOF STEP]
apply (simp add:set_mr_cos_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>R module N; f \<in> mHom R M N; \<exists>a\<in>carrier M. x = a \<uplus>\<^bsub>M\<^esub> ker\<^bsub>M,N\<^esub> f\<rbrakk> \<Longrightarrow> (f\<^sup>\<flat>\<^bsub>R M, N\<^esub>) x \<in> carrier N
[PROOF STEP]
apply (erule bexE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; x = a \<uplus>\<^bsub>M\<^esub> ker\<^bsub>M,N\<^esub> f\<rbrakk> \<Longrightarrow> (f\<^sup>\<flat>\<^bsub>R M, N\<^esub>) x \<in> carrier N
[PROOF STEP]
apply (frule_tac m = a in indmhomTr1 [of N f], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; x = a \<uplus>\<^bsub>M\<^esub> ker\<^bsub>M,N\<^esub> f; (f\<^sup>\<flat>\<^bsub>R M, N\<^esub>) (a \<uplus>\<^bsub>M\<^esub> ker\<^bsub>M,N\<^esub> f) = f a\<rbrakk> \<Longrightarrow> (f\<^sup>\<flat>\<^bsub>R M, N\<^esub>) x \<in> carrier N
[PROOF STEP]
apply (simp add:mHom_mem)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lcons_correct: "toList (lcons a t) = a#toList t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. toList (lcons a t) = a # toList t
[PROOF STEP]
apply (unfold toList_def lcons_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FingerTreeStruc.toList (Rep_FingerTree (Abs_FingerTree (FingerTreeStruc.lcons a (Rep_FingerTree t)))) = a # FingerTreeStruc.toList (Rep_FingerTree t)
[PROOF STEP]
apply (simp add: FingerTreeStruc.lcons_correct)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma op_norm_ge_0: "0 \<le> \<parallel>A\<parallel>\<^sub>o\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<parallel>A\<parallel>\<^sub>o\<^sub>p
[PROOF STEP]
using ex_norm_eq_1 norm_ge_zero norm_matrix_le_op_norm basic_trans_rules(23)
[PROOF STATE]
proof (prove)
using this:
\<exists>x. \<parallel>x\<parallel> = 1
0 \<le> \<parallel>?x\<parallel>
\<parallel>?x\<parallel> = 1 \<Longrightarrow> \<parallel>?A *v ?x\<parallel> \<le> \<parallel>?A\<parallel>\<^sub>o\<^sub>p
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. 0 \<le> \<parallel>A\<parallel>\<^sub>o\<^sub>p
[PROOF STEP]
by blast


[STATEMENT]
theorem kingman_theorem_AE_nonergodic_ereal:
  assumes "subcocycle u"
  shows "AE x in M. (\<lambda>n. u n x / n) \<longlonglongrightarrow> subcocycle_lim_ereal u x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x
[PROOF STEP]
have *: "\<exists>(g::'a\<Rightarrow>ereal). (g\<in>borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>n. u n x / n) \<longlonglongrightarrow> g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
using kingman_theorem_AE_aux2[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)

goal (1 subgoal):
 1. AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have "subcocycle_lim_ereal u = (SOME (g::'a\<Rightarrow>ereal). g\<in>borel_measurable Invariants \<and>
        (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>n. u n x / n) \<longlonglongrightarrow> g x))"
[PROOF STATE]
proof (prove)
using this:
\<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)

goal (1 subgoal):
 1. subcocycle_lim_ereal u = (SOME g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x))
[PROOF STEP]
unfolding subcocycle_lim_ereal_def
[PROOF STATE]
proof (prove)
using this:
\<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)

goal (1 subgoal):
 1. (if \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x) then SOME g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x) else (\<lambda>_. 0)) = (SOME g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subcocycle_lim_ereal u = (SOME g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x))

goal (1 subgoal):
 1. AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subcocycle_lim_ereal u = (SOME g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
subcocycle_lim_ereal u = (SOME g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x))

goal (1 subgoal):
 1. AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x
[PROOF STEP]
using someI_ex[OF *]
[PROOF STATE]
proof (prove)
using this:
subcocycle_lim_ereal u = (SOME g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x))
(SOME x. x \<in> borel_measurable Invariants \<and> (\<forall>xa. x xa < \<infinity>) \<and> (AE xa in M. (\<lambda>x. ereal (u x xa / real x)) \<longlonglongrightarrow> x xa)) \<in> borel_measurable Invariants \<and> (\<forall>x. (SOME x. x \<in> borel_measurable Invariants \<and> (\<forall>xa. x xa < \<infinity>) \<and> (AE xa in M. (\<lambda>x. ereal (u x xa / real x)) \<longlonglongrightarrow> x xa)) x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> (SOME x. x \<in> borel_measurable Invariants \<and> (\<forall>xa. x xa < \<infinity>) \<and> (AE xa in M. (\<lambda>x. ereal (u x xa / real x)) \<longlonglongrightarrow> x xa)) x)

goal (1 subgoal):
 1. AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal u x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Times_mset_image_mset2: "A \<times># image_mset f B = image_mset (\<lambda>(a, b). (a, f b)) (A \<times># B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times># image_mset f B = {#(a, f b). (a, b) \<in># A \<times># B#}
[PROOF STEP]
by (induct A) (auto simp: Times_insert_right)


[STATEMENT]
lemma frontier_of_components_closed_complement:
  fixes S :: "'a::real_normed_vector set"
  shows "\<lbrakk>closed S; C \<in> components (- S)\<rbrakk> \<Longrightarrow> frontier C \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed S; C \<in> components (- S)\<rbrakk> \<Longrightarrow> frontier C \<subseteq> S
[PROOF STEP]
using frontier_complement frontier_of_components_subset frontier_subset_eq
[PROOF STATE]
proof (prove)
using this:
frontier (- ?S) = frontier ?S
?C \<in> components ?S \<Longrightarrow> frontier ?C \<subseteq> frontier ?S
(frontier ?S \<subseteq> ?S) = closed ?S

goal (1 subgoal):
 1. \<lbrakk>closed S; C \<in> components (- S)\<rbrakk> \<Longrightarrow> frontier C \<subseteq> S
[PROOF STEP]
by blast


[STATEMENT]
lemma plus_cont: "f \<in> bcontfun \<Longrightarrow> g \<in> bcontfun \<Longrightarrow> (\<lambda>x. f x + g x) \<in> bcontfun" for f g::"'a \<Rightarrow> 'b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> bcontfun; g \<in> bcontfun\<rbrakk> \<Longrightarrow> (\<lambda>x. f x + g x) \<in> bcontfun
[PROOF STEP]
by (auto simp: bcontfun_def intro!: continuous_intros bounded_plus_comp)


[STATEMENT]
lemma add_rat_roots_below[simp]: "roots_below (poly_add_rat r p) x = (\<lambda>y. y + of_rat r) ` roots_below p (x - of_rat r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. y \<le> x \<and> poly (real_of_int_poly (poly_add_rat r p)) y = 0} = (\<lambda>y. y + real_of_rat r) ` {y. y \<le> x - real_of_rat r \<and> poly (real_of_int_poly p) y = 0}
[PROOF STEP]
proof (unfold add_rat_roots image_def, intro Collect_eqI, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. (xa \<le> x \<and> poly (real_of_int_poly p) (xa - real_of_rat r) = 0) = (\<exists>x\<in>{y. y \<le> x - real_of_rat r \<and> poly (real_of_int_poly p) y = 0}. xa = x + real_of_rat r)
[PROOF STEP]
case (1 y)
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>xa. (xa \<le> x \<and> poly (real_of_int_poly p) (xa - real_of_rat r) = 0) = (\<exists>x\<in>{y. y \<le> x - real_of_rat r \<and> poly (real_of_int_poly p) y = 0}. xa = x + real_of_rat r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<le> x \<and> poly (real_of_int_poly p) (y - real_of_rat r) = 0) = (\<exists>x\<in>{y. y \<le> x - real_of_rat r \<and> poly (real_of_int_poly p) y = 0}. y = x + real_of_rat r)
[PROOF STEP]
by (auto intro: exI[of _ "y - real_of_rat r"])
[PROOF STATE]
proof (state)
this:
(y \<le> x \<and> poly (real_of_int_poly p) (y - real_of_rat r) = 0) = (\<exists>x\<in>{y. y \<le> x - real_of_rat r \<and> poly (real_of_int_poly p) y = 0}. y = x + real_of_rat r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Order) minimum_elem_unique:"\<lbrakk>X \<subseteq> carrier D; minimum_elem D X a1;
                    minimum_elem D X a2\<rbrakk> \<Longrightarrow> a1 = a2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; minimum_elem D X a1; minimum_elem D X a2\<rbrakk> \<Longrightarrow> a1 = a2
[PROOF STEP]
apply (frule minimum_elem_mem[of "X" "a1"], assumption+,
       frule minimum_elem_mem[of "X" "a2"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; minimum_elem D X a1; minimum_elem D X a2; a1 \<in> X; a2 \<in> X\<rbrakk> \<Longrightarrow> a1 = a2
[PROOF STEP]
apply (simp add:minimum_elem_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; \<forall>x\<in>X. a1 \<preceq> x; \<forall>x\<in>X. a2 \<preceq> x; a1 \<in> X; a2 \<in> X\<rbrakk> \<Longrightarrow> a1 = a2
[PROOF STEP]
apply (drule_tac x = a2 in bspec, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; \<forall>x\<in>X. a2 \<preceq> x; a1 \<in> X; a2 \<in> X; a1 \<preceq> a2\<rbrakk> \<Longrightarrow> a1 = a2
[PROOF STEP]
apply (drule_tac x = a1 in bspec, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> carrier D; a1 \<in> X; a2 \<in> X; a1 \<preceq> a2; a2 \<preceq> a1\<rbrakk> \<Longrightarrow> a1 = a2
[PROOF STEP]
apply (rule le_antisym[of a1 a2])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>X \<subseteq> carrier D; a1 \<in> X; a2 \<in> X; a1 \<preceq> a2; a2 \<preceq> a1\<rbrakk> \<Longrightarrow> a1 \<in> carrier D
 2. \<lbrakk>X \<subseteq> carrier D; a1 \<in> X; a2 \<in> X; a1 \<preceq> a2; a2 \<preceq> a1\<rbrakk> \<Longrightarrow> a2 \<in> carrier D
 3. \<lbrakk>X \<subseteq> carrier D; a1 \<in> X; a2 \<in> X; a1 \<preceq> a2; a2 \<preceq> a1\<rbrakk> \<Longrightarrow> a1 \<preceq> a2
 4. \<lbrakk>X \<subseteq> carrier D; a1 \<in> X; a2 \<in> X; a1 \<preceq> a2; a2 \<preceq> a1\<rbrakk> \<Longrightarrow> a2 \<preceq> a1
[PROOF STEP]
apply (simp add:subsetD)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma zfact_iso_ran:
  "zfact_iso n ` {..<n} = carrier (ZFact (int n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zfact_iso n ` {..<n} = carrier (ZFact (int n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. zfact_iso n ` {..<n} = carrier (ZFact (int n))
[PROOF STEP]
have "zfact_iso n ` {..<n} \<subseteq> carrier (ZFact (int n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zfact_iso n ` {..<n} \<subseteq> carrier (ZFact (int n))
[PROOF STEP]
unfolding zfact_iso_def ZFact_def FactRing_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. I +>\<^bsub>\<Z>\<^esub> int k) ` {..<n} \<subseteq> carrier \<lparr>carrier = \<Union>a\<in>carrier (add_monoid \<Z>). {I +>\<^bsub>\<Z>\<^esub> a}, monoid.mult = rcoset_mult \<Z> I, one = I +>\<^bsub>\<Z>\<^esub> \<one>\<^bsub>\<Z>\<^esub>, zero = I, add = (<+>\<^bsub>\<Z>\<^esub>)\<rparr>
[PROOF STEP]
using int.a_rcosetsI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?H \<subseteq> UNIV; ?x \<in> UNIV\<rbrakk> \<Longrightarrow> ?H +>\<^bsub>\<Z>\<^esub> ?x \<in> a_rcosets\<^bsub>\<Z>\<^esub> ?H

goal (1 subgoal):
 1. (\<lambda>k. I +>\<^bsub>\<Z>\<^esub> int k) ` {..<n} \<subseteq> carrier \<lparr>carrier = \<Union>a\<in>carrier (add_monoid \<Z>). {I +>\<^bsub>\<Z>\<^esub> a}, monoid.mult = rcoset_mult \<Z> I, one = I +>\<^bsub>\<Z>\<^esub> \<one>\<^bsub>\<Z>\<^esub>, zero = I, add = (<+>\<^bsub>\<Z>\<^esub>)\<rparr>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
zfact_iso n ` {..<n} \<subseteq> carrier (ZFact (int n))

goal (1 subgoal):
 1. zfact_iso n ` {..<n} = carrier (ZFact (int n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
zfact_iso n ` {..<n} \<subseteq> carrier (ZFact (int n))

goal (1 subgoal):
 1. zfact_iso n ` {..<n} = carrier (ZFact (int n))
[PROOF STEP]
have "x \<in> zfact_iso n ` {..<n}"
    if a:"x \<in> carrier (ZFact (int n))" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
obtain y where y_def: "x = I +>\<^bsub>\<Z>\<^esub> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. x = I +>\<^bsub>\<Z>\<^esub> y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (ZFact (int n))

goal (1 subgoal):
 1. (\<And>y. x = I +>\<^bsub>\<Z>\<^esub> y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding ZFact_def FactRing_simps
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier \<lparr>carrier = \<Union>a\<in>carrier (add_monoid \<Z>). {I +>\<^bsub>\<Z>\<^esub> a}, monoid.mult = rcoset_mult \<Z> I, one = I +>\<^bsub>\<Z>\<^esub> \<one>\<^bsub>\<Z>\<^esub>, zero = I, add = (<+>\<^bsub>\<Z>\<^esub>)\<rparr>

goal (1 subgoal):
 1. (\<And>y. x = I +>\<^bsub>\<Z>\<^esub> y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = I +>\<^bsub>\<Z>\<^esub> y

goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
obtain z where z_def: "(int z) mod (int n) = y mod (int n)" "z < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. \<lbrakk>int z mod int n = y mod int n; z < n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Euclidean_Division.pos_mod_sign mod_mod_trivial
          nonneg_int_cases of_nat_0_less_iff of_nat_mod n_gt_0
          unique_euclidean_semiring_numeral_class.pos_mod_bound)
[PROOF STATE]
proof (state)
this:
int z mod int n = y mod int n
z < n

goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
have "x = I  +>\<^bsub>\<Z>\<^esub> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = I +>\<^bsub>\<Z>\<^esub> y
[PROOF STEP]
by (simp add:y_def)
[PROOF STATE]
proof (state)
this:
x = I +>\<^bsub>\<Z>\<^esub> y

goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = I +>\<^bsub>\<Z>\<^esub> y

goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
have "... = I +>\<^bsub>\<Z>\<^esub> (int z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I +>\<^bsub>\<Z>\<^esub> y = I +>\<^bsub>\<Z>\<^esub> int z
[PROOF STEP]
by (intro int_cosetI, simp add:z_def)
[PROOF STATE]
proof (state)
this:
I +>\<^bsub>\<Z>\<^esub> y = I +>\<^bsub>\<Z>\<^esub> int z

goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
I +>\<^bsub>\<Z>\<^esub> y = I +>\<^bsub>\<Z>\<^esub> int z

goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
have "... = zfact_iso n z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I +>\<^bsub>\<Z>\<^esub> int z = zfact_iso n z
[PROOF STEP]
by (simp add:zfact_iso_def)
[PROOF STATE]
proof (state)
this:
I +>\<^bsub>\<Z>\<^esub> int z = zfact_iso n z

goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x = zfact_iso n z
[PROOF STEP]
have "x = zfact_iso n z"
[PROOF STATE]
proof (prove)
using this:
x = zfact_iso n z

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

goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
thus "x \<in> zfact_iso n ` {..<n}"
[PROOF STATE]
proof (prove)
using this:
x = zfact_iso n z

goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
using z_def(2)
[PROOF STATE]
proof (prove)
using this:
x = zfact_iso n z
z < n

goal (1 subgoal):
 1. x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> zfact_iso n ` {..<n}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> carrier (ZFact (int n)) \<Longrightarrow> ?x \<in> zfact_iso n ` {..<n}

goal (1 subgoal):
 1. zfact_iso n ` {..<n} = carrier (ZFact (int n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
zfact_iso n ` {..<n} \<subseteq> carrier (ZFact (int n))
?x \<in> carrier (ZFact (int n)) \<Longrightarrow> ?x \<in> zfact_iso n ` {..<n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
zfact_iso n ` {..<n} \<subseteq> carrier (ZFact (int n))
?x \<in> carrier (ZFact (int n)) \<Longrightarrow> ?x \<in> zfact_iso n ` {..<n}

goal (1 subgoal):
 1. zfact_iso n ` {..<n} = carrier (ZFact (int n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
zfact_iso n ` {..<n} = carrier (ZFact (int n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma common_refinement: "common_refinement \
 = (\<Union>f \<in> (\<Pi> P\<in>\
. P). {\<Inter> (f ` \
)}) - {{}}"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. common_refinement \
 = (\<Union>f\<in>\<Pi> P\<in>\
. P. {\<Inter> (f ` \
)}) - {{}}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. common_refinement \
 \<subseteq> (\<Union>f\<in>\<Pi> P\<in>\
. P. {\<Inter> (f ` \
)}) - {{}}
 2. (\<Union>f\<in>\<Pi> P\<in>\
. P. {\<Inter> (f ` \
)}) - {{}} \<subseteq> common_refinement \

[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>f\<in>\<Pi> P\<in>\
. P. {\<Inter> (f ` \
)}) - {{}} \<subseteq> common_refinement \

[PROOF STEP]
apply (clarsimp simp add: common_refinement_def PiE_def Ball_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa \<in> (\<Pi> P\<in>\
. P); \<forall>x. x \<in> (\<Pi> P\<in>\
. P) \<and> x \<in> extensional \
 \<longrightarrow> \<Inter> (xa ` \<P>) \<noteq> \<Inter> (x ` \
)\<rbrakk> \<Longrightarrow> \<Inter> (xa ` \
) = {}
[PROOF STEP]
by (metis restrict_Pi_cancel image_restrict_eq restrict_extensional)
[PROOF STATE]
proof (state)
this:
(\<Union>f\<in>\<Pi> P\<in>\
. P. {\<Inter> (f ` \
)}) - {{}} \<subseteq> common_refinement \

goal (1 subgoal):
 1. common_refinement \
 \<subseteq> (\<Union>f\<in>\<Pi> P\<in>\
. P. {\<Inter> (f ` \
)}) - {{}}
[PROOF STEP]
qed (auto simp add: common_refinement_def PiE_def)


[STATEMENT]
lemma cmp_swapI:
  fixes arr::"'a::order \<Rightarrow> 'a::order"
  assumes
    "m < n \<and> x < y"
    "m < n \<and> x < y \<Longrightarrow> x = m \<Longrightarrow> y = n \<Longrightarrow> P (arr n) (arr m)"
    "m < n \<and> x < y \<Longrightarrow> x \<noteq> m \<Longrightarrow> x \<noteq> n \<Longrightarrow> y \<noteq> m \<Longrightarrow> y \<noteq> n \<Longrightarrow> P (arr m) (arr n)"
    "m < n \<and> x < y \<Longrightarrow> x = m \<Longrightarrow> y \<noteq> m \<Longrightarrow> y \<noteq> n \<Longrightarrow>  P (arr y) (arr n)"
    "m < n \<and> x < y \<Longrightarrow> x = n \<Longrightarrow> y \<noteq> m \<Longrightarrow> y \<noteq> n \<Longrightarrow>  P (arr m) (arr y)"
    "m < n \<and> x < y \<Longrightarrow> x \<noteq> m \<Longrightarrow> x \<noteq> n \<Longrightarrow> y = n \<Longrightarrow> P (arr m) (arr x)"
    "m < n \<and> x < y \<Longrightarrow> x \<noteq> m \<Longrightarrow> x \<noteq> n \<Longrightarrow> y = m \<Longrightarrow> P (arr x) (arr n)"
  shows "P (swap arr x y m) (swap arr x y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (swap arr x y m) (swap arr x y n)
[PROOF STEP]
by (metis assms order.asym swap_only_swaps swap_swaps)


[STATEMENT]
lemma path_image_circlepath_minus_subset:
     "path_image (circlepath z (-r)) \<subseteq> path_image (circlepath z r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (circlepath z (- r)) \<subseteq> path_image (circlepath z r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path_image (circlepath z (- r)) \<subseteq> path_image (circlepath z r)
[PROOF STEP]
have "\<exists>x\<in>{0..1}. circlepath z r (y + 1/2) = circlepath z r x"
    if "0 \<le> y" "y \<le> 1" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>{0..1}. circlepath z r (y + 1 / 2) = circlepath z r x
[PROOF STEP]
proof (cases "y \<le> 1/2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y \<le> 1 / 2 \<Longrightarrow> \<exists>x\<in>{0..1}. circlepath z r (y + 1 / 2) = circlepath z r x
 2. \<not> y \<le> 1 / 2 \<Longrightarrow> \<exists>x\<in>{0..1}. circlepath z r (y + 1 / 2) = circlepath z r x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> y \<le> 1 / 2

goal (2 subgoals):
 1. y \<le> 1 / 2 \<Longrightarrow> \<exists>x\<in>{0..1}. circlepath z r (y + 1 / 2) = circlepath z r x
 2. \<not> y \<le> 1 / 2 \<Longrightarrow> \<exists>x\<in>{0..1}. circlepath z r (y + 1 / 2) = circlepath z r x
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
0 \<le> y
y \<le> 1
\<not> y \<le> 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> y
y \<le> 1
\<not> y \<le> 1 / 2

goal (1 subgoal):
 1. \<exists>x\<in>{0..1}. circlepath z r (y + 1 / 2) = circlepath z r x
[PROOF STEP]
by (force simp: circlepath_add_half)
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>{0..1}. circlepath z r (y + 1 / 2) = circlepath z r x

goal (1 subgoal):
 1. y \<le> 1 / 2 \<Longrightarrow> \<exists>x\<in>{0..1}. circlepath z r (y + 1 / 2) = circlepath z r x
[PROOF STEP]
qed (use that in force)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?y; ?y \<le> 1\<rbrakk> \<Longrightarrow> \<exists>x\<in>{0..1}. circlepath z r (?y + 1 / 2) = circlepath z r x

goal (1 subgoal):
 1. path_image (circlepath z (- r)) \<subseteq> path_image (circlepath z r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> ?y; ?y \<le> 1\<rbrakk> \<Longrightarrow> \<exists>x\<in>{0..1}. circlepath z r (?y + 1 / 2) = circlepath z r x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?y; ?y \<le> 1\<rbrakk> \<Longrightarrow> \<exists>x\<in>{0..1}. circlepath z r (?y + 1 / 2) = circlepath z r x

goal (1 subgoal):
 1. path_image (circlepath z (- r)) \<subseteq> path_image (circlepath z r)
[PROOF STEP]
by (auto simp add: path_image_def image_def circlepath_minus)
[PROOF STATE]
proof (state)
this:
path_image (circlepath z (- r)) \<subseteq> path_image (circlepath z r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma csum_czero2: "Card_order r \<Longrightarrow> czero +c r =o r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Card_order r \<Longrightarrow> czero +c r =o r
[PROOF STEP]
unfolding czero_def csum_def Field_card_of
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Card_order r \<Longrightarrow> |{} <+> Field r| =o r
[PROOF STEP]
by (rule ordIso_transitive[OF ordIso_symmetric[OF card_of_Plus_empty2] card_of_Field_ordIso])


[STATEMENT]
lemma Lim_inject: "Lim f = Lim g ==> f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lim f = Lim g \<Longrightarrow> f = g
[PROOF STEP]
apply (simp add: Lim_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` f x} = \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` g x} \<Longrightarrow> f = g
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` f x} = \<Union> {z. \<exists>x. z = Push_Node (Inl x) ` g x} \<Longrightarrow> f x = g x
[PROOF STEP]
apply (blast elim!: Push_Node_inject)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma less_le_not_le_sum :
  fixes x :: "'a + 'b"
  and   y :: "'a + 'b"
shows "(x < y) = (x \<le> y \<and> \<not> y \<le> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x < y) = (x \<le> y \<and> \<not> y \<le> x)
[PROOF STEP]
by (cases x; cases y; auto)


[STATEMENT]
lemma orthogonal_proj_set:
  assumes yC: "y\<in>C" and C: "finite C" and p: "pairwise orthogonal C"
  shows "orthogonal (a - proj_onto a C) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal (a - proj_onto a C) y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. orthogonal (a - proj_onto a C) y
[PROOF STEP]
have Cy: "C = insert y (C - {y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C = insert y (C - {y})
[PROOF STEP]
using yC
[PROOF STATE]
proof (prove)
using this:
y \<in> C

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

goal (1 subgoal):
 1. orthogonal (a - proj_onto a C) y
[PROOF STEP]
have fth: "finite (C - {y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (C - {y})
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
finite C

goal (1 subgoal):
 1. finite (C - {y})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (C - {y})

goal (1 subgoal):
 1. orthogonal (a - proj_onto a C) y
[PROOF STEP]
show "orthogonal (a - proj_onto a C) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal (a - proj_onto a C) y
[PROOF STEP]
unfolding orthogonal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - proj_onto a C) \<bullet> y = 0
[PROOF STEP]
unfolding proj_onto_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - sum (proj a) C) \<bullet> y = 0
[PROOF STEP]
unfolding proj_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - (\<Sum>u\<in>C. (a \<bullet> u / (u \<bullet> u)) *\<^sub>R u)) \<bullet> y = 0
[PROOF STEP]
unfolding inner_diff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<bullet> y - (\<Sum>u\<in>C. (a \<bullet> u / (u \<bullet> u)) *\<^sub>R u) \<bullet> y = 0
[PROOF STEP]
unfolding inner_sum_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<bullet> y - (\<Sum>x\<in>C. (a \<bullet> x / (x \<bullet> x)) *\<^sub>R x \<bullet> y) = 0
[PROOF STEP]
unfolding right_minus_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<bullet> y = (\<Sum>x\<in>C. (a \<bullet> x / (x \<bullet> x)) *\<^sub>R x \<bullet> y)
[PROOF STEP]
unfolding sum.remove[OF C yC]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<bullet> y = (a \<bullet> y / (y \<bullet> y)) *\<^sub>R y \<bullet> y + (\<Sum>x\<in>C - {y}. (a \<bullet> x / (x \<bullet> x)) *\<^sub>R x \<bullet> y)
[PROOF STEP]
apply (clarsimp simp add: inner_commute[of y a])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> (\<Sum>x\<in>C - {y}. a \<bullet> x * (x \<bullet> y) / (x \<bullet> x)) = 0
[PROOF STEP]
apply (rule sum.neutral)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<forall>x\<in>C - {y}. a \<bullet> x * (x \<bullet> y) / (x \<bullet> x) = 0
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>y \<noteq> (0::'a); x \<in> C; x \<noteq> y; a \<bullet> x \<noteq> 0; x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> x \<bullet> y = 0
[PROOF STEP]
apply (rule p[unfolded pairwise_def orthogonal_def, rule_format])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>y \<noteq> (0::'a); x \<in> C; x \<noteq> y; a \<bullet> x \<noteq> 0; x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> x \<in> C
 2. \<And>x. \<lbrakk>y \<noteq> (0::'a); x \<in> C; x \<noteq> y; a \<bullet> x \<noteq> 0; x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> y \<in> C
 3. \<And>x. \<lbrakk>y \<noteq> (0::'a); x \<in> C; x \<noteq> y; a \<bullet> x \<noteq> 0; x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> x \<noteq> y
[PROOF STEP]
using yC
[PROOF STATE]
proof (prove)
using this:
y \<in> C

goal (3 subgoals):
 1. \<And>x. \<lbrakk>y \<noteq> (0::'a); x \<in> C; x \<noteq> y; a \<bullet> x \<noteq> 0; x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> x \<in> C
 2. \<And>x. \<lbrakk>y \<noteq> (0::'a); x \<in> C; x \<noteq> y; a \<bullet> x \<noteq> 0; x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> y \<in> C
 3. \<And>x. \<lbrakk>y \<noteq> (0::'a); x \<in> C; x \<noteq> y; a \<bullet> x \<noteq> 0; x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> x \<noteq> y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
orthogonal (a - proj_onto a C) y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_all_iff_butlast_last:
  assumes "xs \<noteq> []"
  shows "list_all P xs \<longleftrightarrow> list_all P (butlast xs) \<and> P (last xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all P xs = (list_all P (butlast xs) \<and> P (last xs))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. list_all P xs = (list_all P (butlast xs) \<and> P (last xs))
[PROOF STEP]
by (induction xs) auto


[STATEMENT]
lemma prim_rev_iff[reversal_rule]: "primitive (rev u) \<longleftrightarrow> primitive u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primitive (rev u) = primitive u
[PROOF STEP]
unfolding primitive_def[reversed]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x k. x \<^sup>@ k = u \<longrightarrow> k = 1) = primitive u
[PROOF STEP]
using primitive_def
[PROOF STATE]
proof (prove)
using this:
primitive ?u = (\<forall>r k. r \<^sup>@ k = ?u \<longrightarrow> k = 1)

goal (1 subgoal):
 1. (\<forall>x k. x \<^sup>@ k = u \<longrightarrow> k = 1) = primitive u
[PROOF STEP]
..


[STATEMENT]
lemma PosOrd_RightI:
  assumes "v1 :\<sqsubset>val v2" "flat v1 = flat v2"
  shows  "Right v1 :\<sqsubset>val Right v2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val.Right v1 :\<sqsubset>val val.Right v2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v1 :\<sqsubset>val v2
flat v1 = flat v2

goal (1 subgoal):
 1. val.Right v1 :\<sqsubset>val val.Right v2
[PROOF STEP]
unfolding PosOrd_ex_def PosOrd_def2
[PROOF STATE]
proof (prove)
using this:
\<exists>p. pflat_len v2 p < pflat_len v1 p \<and> (\<forall>q\<in>Pos v1. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q) \<and> (\<forall>q\<in>Pos v2. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q)
flat v1 = flat v2

goal (1 subgoal):
 1. \<exists>p. pflat_len (val.Right v2) p < pflat_len (val.Right v1) p \<and> (\<forall>q\<in>Pos (val.Right v1). q \<sqsubset>lex p \<longrightarrow> pflat_len (val.Right v1) q = pflat_len (val.Right v2) q) \<and> (\<forall>q\<in>Pos (val.Right v2). q \<sqsubset>lex p \<longrightarrow> pflat_len (val.Right v1) q = pflat_len (val.Right v2) q)
[PROOF STEP]
apply(auto simp add: pflat_len_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>flat v1 = flat v2; pflat_len v2 p < pflat_len v1 p; \<forall>q\<in>Pos v1. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q; \<forall>q\<in>Pos v2. q \<sqsubset>lex p \<longrightarrow> pflat_len v1 q = pflat_len v2 q\<rbrakk> \<Longrightarrow> \<exists>p. pflat_len (val.Right v2) p < pflat_len (val.Right v1) p \<and> (\<forall>q. (\<exists>ps. q = Suc 0 # ps \<and> ps \<in> Pos v1) \<longrightarrow> q \<sqsubset>lex p \<longrightarrow> pflat_len (val.Right v1) q = pflat_len (val.Right v2) q) \<and> (\<forall>q. (\<exists>ps. q = Suc 0 # ps \<and> ps \<in> Pos v2) \<longrightarrow> q \<sqsubset>lex p \<longrightarrow> pflat_len (val.Right v1) q = pflat_len (val.Right v2) q)
[PROOF STEP]
by (metis lex_simps(3) nat_neq_iff pflat_len_simps(5))