[STATEMENT]
lemma twiddleHeap_compose:
  "\<lbrakk> twiddleHeap \<beta> h1 h2; twiddleHeap \<gamma> h2 h3; \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk>
   \<Longrightarrow> twiddleHeap (Pbij_compose \<beta> \<gamma>) h1 h3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>twiddleHeap \<beta> h1 h2; twiddleHeap \<gamma> h2 h3; \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> twiddleHeap (Pbij_compose \<beta> \<gamma>) h1 h3
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>twiddleHeap \<beta> h1 h2; twiddleHeap \<gamma> h2 h3; \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> twiddleHeap (Pbij_compose \<beta> \<gamma>) h1 h3
[PROOF STEP]
apply (simp add: twiddleHeap_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_compose \<beta> \<gamma> \<in> Pbij \<and> Pbij_Dom (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h1 \<and> Pbij_Rng (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> Pbij_compose \<beta> \<gamma> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))))
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_compose \<beta> \<gamma> \<in> Pbij
 2. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_Dom (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h1 \<and> Pbij_Rng (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> Pbij_compose \<beta> \<gamma> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))))
[PROOF STEP]
apply (erule Pbij_compose_Pbij)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> \<gamma> \<in> Pbij
 2. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_Dom (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h1 \<and> Pbij_Rng (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> Pbij_compose \<beta> \<gamma> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))))
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_Dom (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h1 \<and> Pbij_Rng (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> Pbij_compose \<beta> \<gamma> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))))
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_Dom (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h1
 2. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_Rng (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> Pbij_compose \<beta> \<gamma> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))))
[PROOF STEP]
apply (subgoal_tac "Pbij_Dom (Pbij_compose \<beta> \<gamma>) \<subseteq> Pbij_Dom \<beta>", fast)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_Dom (Pbij_compose \<beta> \<gamma>) \<subseteq> Pbij_Dom \<beta>
 2. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_Rng (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> Pbij_compose \<beta> \<gamma> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))))
[PROOF STEP]
apply (rule Pbij_compose_Dom)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_Rng (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> Pbij_compose \<beta> \<gamma> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))))
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_Rng (Pbij_compose \<beta> \<gamma>) \<subseteq> Dom h3
 2. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> \<forall>l ll. (l, ll) \<in> Pbij_compose \<beta> \<gamma> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)))
[PROOF STEP]
apply (subgoal_tac "Pbij_Rng (Pbij_compose \<beta> \<gamma>) \<subseteq> Pbij_Rng \<gamma>", fast)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> Pbij_Rng (Pbij_compose \<beta> \<gamma>) \<subseteq> Pbij_Rng \<gamma>
 2. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> \<forall>l ll. (l, ll) \<in> Pbij_compose \<beta> \<gamma> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)))
[PROOF STEP]
apply (rule Pbij_compose_Rng)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Pbij_Dom \<beta> \<subseteq> Dom h1 \<and> Pbij_Rng \<beta> \<subseteq> Dom h2 \<and> (\<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)))); Pbij_Dom \<gamma> \<subseteq> Dom h2 \<and> Pbij_Rng \<gamma> \<subseteq> Dom h3 \<and> (\<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))); \<beta> \<in> Pbij; \<gamma> \<in> Pbij\<rbrakk> \<Longrightarrow> \<forall>l ll. (l, ll) \<in> Pbij_compose \<beta> \<gamma> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)))
[PROOF STEP]
apply (erule conjE)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)))\<rbrakk> \<Longrightarrow> \<forall>l ll. (l, ll) \<in> Pbij_compose \<beta> \<gamma> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)))
[PROOF STEP]
apply (rule, rule, rule)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>\<rbrakk> \<Longrightarrow> \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))
[PROOF STEP]
apply (subgoal_tac "\<exists> l1 . (l,l1) : \<beta> \<and> (l1,ll):\<gamma>", erule exE, erule conjE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>\<rbrakk> \<Longrightarrow> \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))
 2. \<And>l ll. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>\<rbrakk> \<Longrightarrow> \<exists>l1. (l, l1) \<in> \<beta> \<and> (l1, ll) \<in> \<gamma>
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>\<rbrakk> \<Longrightarrow> \<exists>l1. (l, l1) \<in> \<beta> \<and> (l1, ll) \<in> \<gamma>
 2. \<And>l ll l1. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>\<rbrakk> \<Longrightarrow> \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))
[PROOF STEP]
apply (simp add: Pbij_compose_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>\<rbrakk> \<Longrightarrow> \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))
[PROOF STEP]
apply (subgoal_tac "\<exists> x y . lookup h2 l1 = Some(x,y)", (erule exE)+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1 x y. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y)\<rbrakk> \<Longrightarrow> \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))
 2. \<And>l ll l1. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>\<rbrakk> \<Longrightarrow> \<exists>x y. lookup h2 l1 = Some (x, y)
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>\<rbrakk> \<Longrightarrow> \<exists>x y. lookup h2 l1 = Some (x, y)
 2. \<And>l ll l1 x y. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y)\<rbrakk> \<Longrightarrow> \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))
[PROOF STEP]
apply (subgoal_tac "l1 : Dom h2", simp add: Dom_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>\<rbrakk> \<Longrightarrow> l1 \<in> Dom h2
 2. \<And>l ll l1 x y. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y)\<rbrakk> \<Longrightarrow> \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))
[PROOF STEP]
apply (simp add:Pbij_compose_def Pbij_Dom_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; {l. \<exists>ll. (l, ll) \<in> \<beta>} \<subseteq> Dom h1; {l. \<exists>ll. (l, ll) \<in> \<gamma>} \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); \<exists>l1. (l, l1) \<in> \<beta> \<and> (l1, ll) \<in> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>\<rbrakk> \<Longrightarrow> l1 \<in> Dom h2
 2. \<And>l ll l1 x y. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y)\<rbrakk> \<Longrightarrow> \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1 l1a. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; {l. \<exists>ll. (l, ll) \<in> \<beta>} \<subseteq> Dom h1; {l. \<exists>ll. (l, ll) \<in> \<gamma>} \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; (l, l1a) \<in> \<beta>; (l1a, ll) \<in> \<gamma>\<rbrakk> \<Longrightarrow> l1 \<in> Dom h2
 2. \<And>l ll l1 x y. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y)\<rbrakk> \<Longrightarrow> \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y)\<rbrakk> \<Longrightarrow> \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba))
[PROOF STEP]
apply (rule, rule, rule)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y a b. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (a, b)\<rbrakk> \<Longrightarrow> \<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)
[PROOF STEP]
apply (rule, rule, rule)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y a b aa ba. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; \<forall>l ll. (l, ll) \<in> \<beta> \<longrightarrow> (\<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))); Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (a, b); lookup h3 ll = Some (aa, ba)\<rbrakk> \<Longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)
[PROOF STEP]
apply (erule_tac x=l in allE, erule_tac x=l1 in allE, erule impE, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y a b aa ba. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; \<forall>l ll. (l, ll) \<in> \<gamma> \<longrightarrow> (\<forall>a b. lookup h2 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))); (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (a, b); lookup h3 ll = Some (aa, ba); \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 l1 = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba))\<rbrakk> \<Longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)
[PROOF STEP]
apply (erule_tac x=l1 in allE, erule_tac x=ll in allE, erule impE, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y a b aa ba. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (a, b); lookup h3 ll = Some (aa, ba); \<forall>a b. lookup h1 l = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h2 l1 = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)); \<forall>a b. lookup h2 l1 = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba))\<rbrakk> \<Longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)
[PROOF STEP]
apply (erule_tac x=a in allE, erule_tac x=b in allE, erule impE, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y a b aa ba. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (a, b); lookup h3 ll = Some (aa, ba); \<forall>a b. lookup h2 l1 = Some (a, b) \<longrightarrow> (\<forall>aa ba. lookup h3 ll = Some (aa, ba) \<longrightarrow> twiddleObj \<gamma> (a, b) (aa, ba)); \<forall>aa ba. lookup h2 l1 = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba)\<rbrakk> \<Longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)
[PROOF STEP]
apply (erule_tac x=x in allE, erule_tac x=y in allE, erule impE, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y a b aa ba. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (a, b); lookup h3 ll = Some (aa, ba); \<forall>aa ba. lookup h2 l1 = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba); \<forall>a b. lookup h3 ll = Some (a, b) \<longrightarrow> twiddleObj \<gamma> (x, y) (a, b)\<rbrakk> \<Longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)
[PROOF STEP]
apply (erule_tac x=aa in allE, erule_tac x=ba in allE, erule impE, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y a b aa ba. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (a, b); lookup h3 ll = Some (aa, ba); \<forall>aa ba. lookup h2 l1 = Some (aa, ba) \<longrightarrow> twiddleObj \<beta> (a, b) (aa, ba); twiddleObj \<gamma> (x, y) (aa, ba)\<rbrakk> \<Longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)
[PROOF STEP]
apply (erule_tac x=x in allE, erule_tac x=y in allE, erule impE, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y a b aa ba. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (a, b); lookup h3 ll = Some (aa, ba); twiddleObj \<gamma> (x, y) (aa, ba); twiddleObj \<beta> (a, b) (x, y)\<rbrakk> \<Longrightarrow> twiddleObj (Pbij_compose \<beta> \<gamma>) (a, b) (aa, ba)
[PROOF STEP]
apply (simp add: twiddleObj_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y b ba. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba \<and> (\<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal)); LowDom b = LowDom ba \<and> (\<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal))\<rbrakk> \<Longrightarrow> \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (Pbij_compose \<beta> \<gamma>, v, w) \<in> twiddleVal)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y b ba f v w. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; \<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); LowDom b = LowDom ba; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low\<rbrakk> \<Longrightarrow> (Pbij_compose \<beta> \<gamma>, v, w) \<in> twiddleVal
[PROOF STEP]
apply (subgoal_tac "\<exists> u . lookup y f = Some u", erule exE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1 x y b ba f v w u. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; \<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); LowDom b = LowDom ba; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; lookup y f = Some u\<rbrakk> \<Longrightarrow> (Pbij_compose \<beta> \<gamma>, v, w) \<in> twiddleVal
 2. \<And>l ll l1 x y b ba f v w. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; \<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); LowDom b = LowDom ba; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low\<rbrakk> \<Longrightarrow> \<exists>u. lookup y f = Some u
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1 x y b ba f v w. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; \<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); LowDom b = LowDom ba; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low\<rbrakk> \<Longrightarrow> \<exists>u. lookup y f = Some u
 2. \<And>l ll l1 x y b ba f v w u. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; \<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); LowDom b = LowDom ba; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; lookup y f = Some u\<rbrakk> \<Longrightarrow> (Pbij_compose \<beta> \<gamma>, v, w) \<in> twiddleVal
[PROOF STEP]
apply (simp add: LowDom_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1 x y b ba f v w. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); {f. (\<exists>v. lookup y f = Some v) \<and> GAMMA f = low} = {f. (\<exists>v. lookup ba f = Some v) \<and> GAMMA f = low}; \<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); {f. (\<exists>v. lookup b f = Some v) \<and> GAMMA f = low} = {f. (\<exists>v. lookup ba f = Some v) \<and> GAMMA f = low}; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low\<rbrakk> \<Longrightarrow> \<exists>u. lookup y f = Some u
 2. \<And>l ll l1 x y b ba f v w u. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; \<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); LowDom b = LowDom ba; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; lookup y f = Some u\<rbrakk> \<Longrightarrow> (Pbij_compose \<beta> \<gamma>, v, w) \<in> twiddleVal
[PROOF STEP]
apply (rotate_tac -6)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1 x y b ba f v w. \<lbrakk>\<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); {f. (\<exists>v. lookup b f = Some v) \<and> GAMMA f = low} = {f. (\<exists>v. lookup ba f = Some v) \<and> GAMMA f = low}; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; \<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); {f. (\<exists>v. lookup y f = Some v) \<and> GAMMA f = low} = {f. (\<exists>v. lookup ba f = Some v) \<and> GAMMA f = low}\<rbrakk> \<Longrightarrow> \<exists>u. lookup y f = Some u
 2. \<And>l ll l1 x y b ba f v w u. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; \<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); LowDom b = LowDom ba; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; lookup y f = Some u\<rbrakk> \<Longrightarrow> (Pbij_compose \<beta> \<gamma>, v, w) \<in> twiddleVal
[PROOF STEP]
apply (erule thin_rl, erule thin_rl)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1 x y b ba f v w. \<lbrakk>\<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; \<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); {f. (\<exists>v. lookup y f = Some v) \<and> GAMMA f = low} = {f. (\<exists>v. lookup ba f = Some v) \<and> GAMMA f = low}\<rbrakk> \<Longrightarrow> \<exists>u. lookup y f = Some u
 2. \<And>l ll l1 x y b ba f v w u. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; \<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); LowDom b = LowDom ba; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; lookup y f = Some u\<rbrakk> \<Longrightarrow> (Pbij_compose \<beta> \<gamma>, v, w) \<in> twiddleVal
[PROOF STEP]
apply (erule thin_rl)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l ll l1 x y b ba f v w. \<lbrakk>lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; \<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); {f. (\<exists>v. lookup y f = Some v) \<and> GAMMA f = low} = {f. (\<exists>v. lookup ba f = Some v) \<and> GAMMA f = low}\<rbrakk> \<Longrightarrow> \<exists>u. lookup y f = Some u
 2. \<And>l ll l1 x y b ba f v w u. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; \<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); LowDom b = LowDom ba; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; lookup y f = Some u\<rbrakk> \<Longrightarrow> (Pbij_compose \<beta> \<gamma>, v, w) \<in> twiddleVal
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y b ba f v w u. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; \<forall>f v. lookup y f = Some v \<longrightarrow> (\<forall>w. lookup ba f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<gamma>, v, w) \<in> twiddleVal); LowDom b = LowDom ba; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; lookup y f = Some u\<rbrakk> \<Longrightarrow> (Pbij_compose \<beta> \<gamma>, v, w) \<in> twiddleVal
[PROOF STEP]
apply (erule_tac x=f in allE, erule_tac x=u in allE, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y b ba f v w u. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; LowDom b = LowDom ba; \<forall>f v. lookup b f = Some v \<longrightarrow> (\<forall>w. lookup y f = Some w \<longrightarrow> GAMMA f = low \<longrightarrow> (\<beta>, v, w) \<in> twiddleVal); lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; lookup y f = Some u; (\<gamma>, u, w) \<in> twiddleVal\<rbrakk> \<Longrightarrow> (Pbij_compose \<beta> \<gamma>, v, w) \<in> twiddleVal
[PROOF STEP]
apply (erule_tac x=f in allE, erule_tac x=v in allE, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y b ba f v w u. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; LowDom b = LowDom ba; lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; lookup y f = Some u; (\<gamma>, u, w) \<in> twiddleVal; (\<beta>, v, u) \<in> twiddleVal\<rbrakk> \<Longrightarrow> (Pbij_compose \<beta> \<gamma>, v, w) \<in> twiddleVal
[PROOF STEP]
apply (erule twiddleVal_compose)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l ll l1 x y b ba f v w u. \<lbrakk>\<beta> \<in> Pbij; \<gamma> \<in> Pbij; Pbij_Dom \<beta> \<subseteq> Dom h1; Pbij_Dom \<gamma> \<subseteq> Dom h2; Pbij_Rng \<beta> \<subseteq> Dom h2; Pbij_Rng \<gamma> \<subseteq> Dom h3; (l, ll) \<in> Pbij_compose \<beta> \<gamma>; (l, l1) \<in> \<beta>; (l1, ll) \<in> \<gamma>; lookup h2 l1 = Some (x, y); lookup h1 l = Some (x, b); lookup h3 ll = Some (x, ba); LowDom y = LowDom ba; LowDom b = LowDom ba; lookup b f = Some v; lookup ba f = Some w; GAMMA f = low; lookup y f = Some u; (\<gamma>, u, w) \<in> twiddleVal\<rbrakk> \<Longrightarrow> (\<gamma>, u, w) \<in> twiddleVal
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_of_abs_interval: "set_of (abs_interval x) = abs ` set_of x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (abs_interval x) = abs ` set_of x
[PROOF STEP]
by (auto simp: set_of_eq not_less intro: in_abs_intervalI1 in_abs_intervalI2 cong del: image_cong_simp)


[STATEMENT]
lemma LeastI2_order:
  assumes "P x"
    and "\<And>y. P y \<Longrightarrow> x \<le>\<^sub>a y"
    and "\<And>x. P x \<Longrightarrow> \<forall>y. P y \<longrightarrow> x \<le>\<^sub>a y \<Longrightarrow> Q x"
  obtains z where "Least P = Some z" and "Q z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. \<lbrakk>local.Least P = Some z; Q z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding Least_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. \<lbrakk>(THE x on UNIV. P x \<and> (\<forall>y\<in>UNIV. P y \<longrightarrow> x \<le>\<^sub>a y)) = Some z; Q z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P x
P ?y \<Longrightarrow> x \<le>\<^sub>a ?y
\<lbrakk>P ?x; \<forall>y. P y \<longrightarrow> ?x \<le>\<^sub>a y\<rbrakk> \<Longrightarrow> Q ?x

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>(THE x on UNIV. P x \<and> (\<forall>y\<in>UNIV. P y \<longrightarrow> x \<le>\<^sub>a y)) = Some z; Q z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (clarsimp simp: that Least_equality)


[STATEMENT]
lemma bij_clinear_imp_inv_clinear: "clinear (inv f)"
  if a1: "clinear f" and a2: "bij f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clinear (inv f)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b1 b2. inv f (b1 + b2) = inv f b1 + inv f b2
 2. \<And>r b. inv f (r *\<^sub>C b) = r *\<^sub>C inv f b
[PROOF STEP]
fix b1 b2 r b
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b1 b2. inv f (b1 + b2) = inv f b1 + inv f b2
 2. \<And>r b. inv f (r *\<^sub>C b) = r *\<^sub>C inv f b
[PROOF STEP]
show "inv f (b1 + b2) = inv f b1 + inv f b2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv f (b1 + b2) = inv f b1 + inv f b2
[PROOF STEP]
by (simp add: a1 a2 bij_is_inj bij_is_surj complex_vector.linear_add inv_f_eq surj_f_inv_f)
[PROOF STATE]
proof (state)
this:
inv f (b1 + b2) = inv f b1 + inv f b2

goal (1 subgoal):
 1. \<And>r b. inv f (r *\<^sub>C b) = r *\<^sub>C inv f b
[PROOF STEP]
show "inv f (r *\<^sub>C b) = r *\<^sub>C inv f b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv f (r *\<^sub>C b) = r *\<^sub>C inv f b
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
clinear f
bij f

goal (1 subgoal):
 1. inv f (r *\<^sub>C b) = r *\<^sub>C inv f b
[PROOF STEP]
by (smt bij_inv_eq_iff clinear_def complex_vector.linear_scale)
[PROOF STATE]
proof (state)
this:
inv f (r *\<^sub>C b) = r *\<^sub>C inv f b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sd_power_prop_aux: "\<alpha> (x ^ 0) y \<squnion> (\<Squnion>{\<alpha> (x ^ k) y |k.  0 < k \<and> k \<le> Suc i}) = \<Squnion>{\<alpha> (x ^ k) y |k. k \<le> Suc i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> (x ^ 0) y \<squnion> \<Squnion> {\<alpha> (x ^ k) y |k. 0 < k \<and> k \<le> Suc i} = \<Squnion> {\<alpha> (x ^ k) y |k. k \<le> Suc i}
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<alpha> (x ^ 0) y \<squnion> \<Squnion> {\<alpha> (x ^ k) y |k. 0 < k \<and> k \<le> Suc i} \<le> \<Squnion> {\<alpha> (x ^ k) y |k. k \<le> Suc i}
 2. \<Squnion> {\<alpha> (x ^ k) y |k. k \<le> Suc i} \<le> \<alpha> (x ^ 0) y \<squnion> \<Squnion> {\<alpha> (x ^ k) y |k. 0 < k \<and> k \<le> Suc i}
[PROOF STEP]
apply (rule sup_least, intro Sup_upper, blast, intro Sup_mono, blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> {\<alpha> (x ^ k) y |k. k \<le> Suc i} \<le> \<alpha> (x ^ 0) y \<squnion> \<Squnion> {\<alpha> (x ^ k) y |k. 0 < k \<and> k \<le> Suc i}
[PROOF STEP]
apply (rule Sup_least, safe)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa k. k \<le> Suc i \<Longrightarrow> \<alpha> (x ^ k) y \<le> \<alpha> (x ^ 0) y \<squnion> \<Squnion> {\<alpha> (x ^ k) y |k. 0 < k \<and> k \<le> Suc i}
[PROOF STEP]
by (metis (mono_tags, lifting) Sup_insert Sup_upper insert_iff le_0_eq linorder_not_le mem_Collect_eq)


[STATEMENT]
lemma DERIV_cos_add [simp]: "DERIV (\<lambda>x. cos (x + k)) xa :> - sin (xa + k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. cos (x + k)) has_field_derivative - sin (xa + k)) (at xa)
[PROOF STEP]
by (auto intro!: derivative_eq_intros)


[STATEMENT]
lemma length_empty_boxes[simp]: "length (empty_boxes n) = 2*n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (empty_boxes n) = 2 * n
[PROOF STEP]
apply(induct n, simp, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma less_eq_complexI: "Re x \<le> Re y \<Longrightarrow> Im x = Im y \<Longrightarrow> x\<le>y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Re x \<le> Re y; Im x = Im y\<rbrakk> \<Longrightarrow> x \<le> y
[PROOF STEP]
unfolding less_eq_complex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Re x \<le> Re y; Im x = Im y\<rbrakk> \<Longrightarrow> Re x \<le> Re y \<and> Im x = Im y
[PROOF STEP]
by simp


[STATEMENT]
lemma fold_mset_fun_left_comm: "f x (fold_mset f s M) = fold_mset f (f x s) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x (fold_mset f s M) = fold_mset f (f x s) M
[PROOF STEP]
by (induct M) (simp_all add: fun_left_comm)


[STATEMENT]
theorem (in group) solvable_imp_trivial_derived_seq:
  assumes "solvable_seq G H" shows "\<exists>n. (derived G ^^ n) H = { \<one> }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
solvable_seq G H

goal (1 subgoal):
 1. \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
proof (induction)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>n. (derived G ^^ n) {\<one>} = {\<one>}
 2. \<And>K H. \<lbrakk>solvable_seq G K; \<exists>n. (derived G ^^ n) K = {\<one>}; K \<lhd> G\<lparr>carrier := H\<rparr>; subgroup H G; comm_group (G\<lparr>carrier := H\<rparr> Mod K)\<rbrakk> \<Longrightarrow> \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
case unity
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<exists>n. (derived G ^^ n) {\<one>} = {\<one>}
 2. \<And>K H. \<lbrakk>solvable_seq G K; \<exists>n. (derived G ^^ n) K = {\<one>}; K \<lhd> G\<lparr>carrier := H\<rparr>; subgroup H G; comm_group (G\<lparr>carrier := H\<rparr> Mod K)\<rbrakk> \<Longrightarrow> \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
have "(derived G ^^ 0) { \<one> } = { \<one> }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (derived G ^^ 0) {\<one>} = {\<one>}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(derived G ^^ 0) {\<one>} = {\<one>}

goal (2 subgoals):
 1. \<exists>n. (derived G ^^ n) {\<one>} = {\<one>}
 2. \<And>K H. \<lbrakk>solvable_seq G K; \<exists>n. (derived G ^^ n) K = {\<one>}; K \<lhd> G\<lparr>carrier := H\<rparr>; subgroup H G; comm_group (G\<lparr>carrier := H\<rparr> Mod K)\<rbrakk> \<Longrightarrow> \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(derived G ^^ 0) {\<one>} = {\<one>}

goal (1 subgoal):
 1. \<exists>n. (derived G ^^ n) {\<one>} = {\<one>}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n. (derived G ^^ n) {\<one>} = {\<one>}

goal (1 subgoal):
 1. \<And>K H. \<lbrakk>solvable_seq G K; \<exists>n. (derived G ^^ n) K = {\<one>}; K \<lhd> G\<lparr>carrier := H\<rparr>; subgroup H G; comm_group (G\<lparr>carrier := H\<rparr> Mod K)\<rbrakk> \<Longrightarrow> \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>K H. \<lbrakk>solvable_seq G K; \<exists>n. (derived G ^^ n) K = {\<one>}; K \<lhd> G\<lparr>carrier := H\<rparr>; subgroup H G; comm_group (G\<lparr>carrier := H\<rparr> Mod K)\<rbrakk> \<Longrightarrow> \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
case (extension K H)
[PROOF STATE]
proof (state)
this:
solvable_seq G K
K \<lhd> G\<lparr>carrier := H\<rparr>
subgroup H G
comm_group (G\<lparr>carrier := H\<rparr> Mod K)
\<exists>n. (derived G ^^ n) K = {\<one>}

goal (1 subgoal):
 1. \<And>K H. \<lbrakk>solvable_seq G K; \<exists>n. (derived G ^^ n) K = {\<one>}; K \<lhd> G\<lparr>carrier := H\<rparr>; subgroup H G; comm_group (G\<lparr>carrier := H\<rparr> Mod K)\<rbrakk> \<Longrightarrow> \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
obtain n where "(derived G ^^ n) K = { \<one> }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. (derived G ^^ n) K = {\<one>} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using solvable_imp_subgroup extension(1,5)
[PROOF STATE]
proof (prove)
using this:
solvable_seq G ?H \<Longrightarrow> subgroup ?H G
solvable_seq G K
\<exists>n. (derived G ^^ n) K = {\<one>}

goal (1 subgoal):
 1. (\<And>n. (derived G ^^ n) K = {\<one>} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(derived G ^^ n) K = {\<one>}

goal (1 subgoal):
 1. \<And>K H. \<lbrakk>solvable_seq G K; \<exists>n. (derived G ^^ n) K = {\<one>}; K \<lhd> G\<lparr>carrier := H\<rparr>; subgroup H G; comm_group (G\<lparr>carrier := H\<rparr> Mod K)\<rbrakk> \<Longrightarrow> \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
hence "(derived G ^^ (Suc n)) H \<subseteq> { \<one> }"
[PROOF STATE]
proof (prove)
using this:
(derived G ^^ n) K = {\<one>}

goal (1 subgoal):
 1. (derived G ^^ Suc n) H \<subseteq> {\<one>}
[PROOF STEP]
using mono_exp_of_derived[OF derived_of_subgroup_minimal[OF extension(2-4)], of n]
[PROOF STATE]
proof (prove)
using this:
(derived G ^^ n) K = {\<one>}
(derived G ^^ n) (derived G H) \<subseteq> (derived G ^^ n) K

goal (1 subgoal):
 1. (derived G ^^ Suc n) H \<subseteq> {\<one>}
[PROOF STEP]
by (simp add: funpow_swap1)
[PROOF STATE]
proof (state)
this:
(derived G ^^ Suc n) H \<subseteq> {\<one>}

goal (1 subgoal):
 1. \<And>K H. \<lbrakk>solvable_seq G K; \<exists>n. (derived G ^^ n) K = {\<one>}; K \<lhd> G\<lparr>carrier := H\<rparr>; subgroup H G; comm_group (G\<lparr>carrier := H\<rparr> Mod K)\<rbrakk> \<Longrightarrow> \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(derived G ^^ Suc n) H \<subseteq> {\<one>}

goal (1 subgoal):
 1. \<And>K H. \<lbrakk>solvable_seq G K; \<exists>n. (derived G ^^ n) K = {\<one>}; K \<lhd> G\<lparr>carrier := H\<rparr>; subgroup H G; comm_group (G\<lparr>carrier := H\<rparr> Mod K)\<rbrakk> \<Longrightarrow> \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
have "{ \<one> } \<subseteq> (derived G ^^ (Suc n)) H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<one>} \<subseteq> (derived G ^^ Suc n) H
[PROOF STEP]
using subgroup.one_closed[OF exp_of_derived_is_subgroup[OF extension(3)], of "Suc n"]
[PROOF STATE]
proof (prove)
using this:
\<one> \<in> (derived G ^^ Suc n) H

goal (1 subgoal):
 1. {\<one>} \<subseteq> (derived G ^^ Suc n) H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{\<one>} \<subseteq> (derived G ^^ Suc n) H

goal (1 subgoal):
 1. \<And>K H. \<lbrakk>solvable_seq G K; \<exists>n. (derived G ^^ n) K = {\<one>}; K \<lhd> G\<lparr>carrier := H\<rparr>; subgroup H G; comm_group (G\<lparr>carrier := H\<rparr> Mod K)\<rbrakk> \<Longrightarrow> \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(derived G ^^ Suc n) H \<subseteq> {\<one>}
{\<one>} \<subseteq> (derived G ^^ Suc n) H
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(derived G ^^ Suc n) H \<subseteq> {\<one>}
{\<one>} \<subseteq> (derived G ^^ Suc n) H

goal (1 subgoal):
 1. \<exists>n. (derived G ^^ n) H = {\<one>}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n. (derived G ^^ n) H = {\<one>}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma balanced_net_shallow_model': "balanced_net (shallow_model' Z M N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. balanced_net (shallow_model' Z M N)
[PROOF STEP]
proof(induction N)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. balanced_net (shallow_model' Z M 0)
 2. \<And>N. balanced_net (shallow_model' Z M N) \<Longrightarrow> balanced_net (shallow_model' Z M (Suc N))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. balanced_net (shallow_model' Z M 0)
 2. \<And>N. balanced_net (shallow_model' Z M N) \<Longrightarrow> balanced_net (shallow_model' Z M (Suc N))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. balanced_net (shallow_model' Z M 0)
[PROOF STEP]
by (metis balanced_net.simps shallow_model'.simps(1))
[PROOF STATE]
proof (state)
this:
balanced_net (shallow_model' Z M 0)

goal (1 subgoal):
 1. \<And>N. balanced_net (shallow_model' Z M N) \<Longrightarrow> balanced_net (shallow_model' Z M (Suc N))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>N. balanced_net (shallow_model' Z M N) \<Longrightarrow> balanced_net (shallow_model' Z M (Suc N))
[PROOF STEP]
case (Suc N)
[PROOF STATE]
proof (state)
this:
balanced_net (shallow_model' Z M N)

goal (1 subgoal):
 1. \<And>N. balanced_net (shallow_model' Z M N) \<Longrightarrow> balanced_net (shallow_model' Z M (Suc N))
[PROOF STEP]
have "count_weights True (Conv (Z, M) (Input M)) = count_weights True (shallow_model' Z M N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_weights True (Conv (Z, M) (Input M)) = count_weights True (shallow_model' Z M N)
[PROOF STEP]
by (induction N; simp)
[PROOF STATE]
proof (state)
this:
count_weights True (Conv (Z, M) (Input M)) = count_weights True (shallow_model' Z M N)

goal (1 subgoal):
 1. \<And>N. balanced_net (shallow_model' Z M N) \<Longrightarrow> balanced_net (shallow_model' Z M (Suc N))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
count_weights True (Conv (Z, M) (Input M)) = count_weights True (shallow_model' Z M N)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
count_weights True (Conv (Z, M) (Input M)) = count_weights True (shallow_model' Z M N)

goal (1 subgoal):
 1. balanced_net (shallow_model' Z M (Suc N))
[PROOF STEP]
unfolding shallow_model'.simps
[PROOF STATE]
proof (prove)
using this:
count_weights True (Conv (Z, M) (Input M)) = count_weights True (shallow_model' Z M N)

goal (1 subgoal):
 1. balanced_net (Pool (Conv (Z, M) (Input M)) (shallow_model' Z M N))
[PROOF STEP]
by (simp add: Suc.IH balanced_net_Conv balanced_net_Input balanced_net_Pool)
[PROOF STATE]
proof (state)
this:
balanced_net (shallow_model' Z M (Suc N))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma col_zero[simp]:
  "j < nc \<Longrightarrow> col (0\<^sub>m nr nc) j = 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < nc \<Longrightarrow> col (0\<^sub>m nr nc) j = 0\<^sub>v nr
[PROOF STEP]
by (intro eq_vecI, auto)


[STATEMENT]
lemma fun_graph_memE:
  assumes "f \<in> carrier (Fun\<^bsub>n\<^esub> R)"
  assumes "p \<in> fun_graph R n f"
  shows "(take n p) \<in> carrier (R\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take n p \<in> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (function_ring (carrier (R\<^bsup>n\<^esup>)) R)
p \<in> fun_graph R n f

goal (1 subgoal):
 1. take n p \<in> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
unfolding fun_graph_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (function_ring (carrier (R\<^bsup>n\<^esup>)) R)
p \<in> {as. \<exists>x\<in>carrier (R\<^bsup>n\<^esup>). as = x @ [f x]}

goal (1 subgoal):
 1. take n p \<in> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
by (metis (no_types, lifting) assms(2) graph_range le_add2 plus_1_eq_Suc subsetD take_closed)


[STATEMENT]
lemma neg_divideR_less_eq [field_simps]:
  "b /\<^sub>R c < a \<longleftrightarrow> c *\<^sub>R a < b" if "c < 0"
    for a b :: "'a :: ordered_real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b /\<^sub>R c < a) = (c *\<^sub>R a < b)
[PROOF STEP]
using that neg_divideR_le_eq [of c b a]
[PROOF STATE]
proof (prove)
using this:
c < 0
c < 0 \<Longrightarrow> (b /\<^sub>R c \<le> a) = (c *\<^sub>R a \<le> b)

goal (1 subgoal):
 1. (b /\<^sub>R c < a) = (c *\<^sub>R a < b)
[PROOF STEP]
by (auto simp add: le_less)


[STATEMENT]
lemma cong_eval_trans: "\<lbrakk> l \<sim> r; r \<sim> t\<rbrakk> \<Longrightarrow> l \<sim> t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>l \<sim> r; r \<sim> t\<rbrakk> \<Longrightarrow> l \<sim> t
[PROOF STEP]
by (simp add: cong_eval_def)


[STATEMENT]
lemma is_pole_inverse: "is_pole (\<lambda>z::complex. 1 / (z - a)) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pole (\<lambda>z. 1 / (z - a)) a
[PROOF STEP]
using is_pole_inverse_power[of 1 a]
[PROOF STATE]
proof (prove)
using this:
0 < 1 \<Longrightarrow> is_pole (\<lambda>z. 1 / (z - a) ^ 1) a

goal (1 subgoal):
 1. is_pole (\<lambda>z. 1 / (z - a)) a
[PROOF STEP]
by simp


[STATEMENT]
lemma hbex_succ [simp]: "(\<exists>x \<^bold>\<in> succ k. P x) \<longleftrightarrow> P k \<or> (\<exists>x \<^bold>\<in> k. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HBex (succ k) P = (P k \<or> HBex k P)
[PROOF STEP]
by (auto simp: HBex_def)


[STATEMENT]
theorem proper_STRIPS_generalization:
  "\<lbrakk>wm_basic M; is_STRIPS_fmla \<phi>\<rbrakk> \<Longrightarrow> M \<^sup>c\<TTurnstile>\<^sub>= \<phi> \<longleftrightarrow> M \<TTurnstile> \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wm_basic M; is_STRIPS_fmla \<phi>\<rbrakk> \<Longrightarrow> M \<^sup>c\<TTurnstile>\<^sub>= \<phi> = M \<TTurnstile> \<phi>
[PROOF STEP]
by (simp add: valuation_iff_close_world[symmetric] valuation_iff_STRIPS)


[STATEMENT]
lemma bernoulli_eq_bernoulli_pmf:
  "bernoulli p = spmf_of_pmf (bernoulli_pmf p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli p = spmf_of_pmf (bernoulli_pmf p)
[PROOF STEP]
by(rule spmf_eqI; simp)(transfer; auto simp add: max_def min_def)


[STATEMENT]
lemma cUNION_cinsert: "cUNION (cinsert x A) f = cUn (f x) (cUNION A f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cUnion (cimage f (cinsert x A)) = cUn (f x) (cUnion (cimage f A))
[PROOF STEP]
by (simp add: cUnion_cinsert)


[STATEMENT]
lemma map_ds_iso_pres:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'b::complete_lattice"
  shows "mono f \<Longrightarrow> mono (map_ds f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> mono (map_ds f)
[PROOF STEP]
unfolding fun_eq_iff mono_def map_ds_def ds_def SSup_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x \<le> y \<longrightarrow> f x \<le> f y \<Longrightarrow> \<forall>x y. x \<le> y \<longrightarrow> Abs_downset (\<down> (f (\<Squnion> Rep_downset x))) \<le> Abs_downset (\<down> (f (\<Squnion> Rep_downset y)))
[PROOF STEP]
by (metis Abs_downset_inverse Sup_subset_mono downset_iso_iff less_eq_downset.rep_eq rangeI)


[STATEMENT]
lemma prod_insert_eqpoll:
  assumes "a \<notin> A" shows "insert a A \<times> B \<approx> B <+> A \<times> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert a A \<times> B \<approx> B <+> A \<times> B
[PROOF STEP]
unfolding eqpoll_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. bij_betw f (insert a A \<times> B) (B <+> A \<times> B)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bij_betw ?f (insert a A \<times> B) (B <+> A \<times> B)
[PROOF STEP]
show "bij_betw (\<lambda>(x,y). if x=a then Inl y else Inr (x,y)) (insert a A \<times> B) (B <+> A \<times> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>(x, y). if x = a then Inl y else Inr (x, y)) (insert a A \<times> B) (B <+> A \<times> B)
[PROOF STEP]
by (rule bij_betw_byWitness [where f' = "case_sum (\<lambda>y. (a,y)) id"]) (auto simp: assms)
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>(x, y). if x = a then Inl y else Inr (x, y)) (insert a A \<times> B) (B <+> A \<times> B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uniqueness_algorithm_division_Mp_Rel:
  assumes monic_Mpg: "monic (Mp g)"
    and f: "(F :: 'a mod_ring poly) = of_int_poly f"
  and g: "(G :: 'a mod_ring poly) = of_int_poly g"
  and qr: "pseudo_divmod (Mp f) (Mp g) = (q,r)"
  and QR: "pseudo_divmod F G = (Q,R)"
shows "MP_Rel q Q \<and> MP_Rel r R "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MP_Rel q Q \<and> MP_Rel r R
[PROOF STEP]
proof (unfold MP_Rel_def, rule uniqueness_algorithm_division_to_int_poly[OF _ f g])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. Mp g \<noteq> 0
 2. F = G * Q + R
 3. R = 0 \<or> degree R < degree G
 4. Mp f = Mp g * q + r
 5. r = 0 \<or> degree r < degree_m g
[PROOF STEP]
show f_gq_r: "Mp f = Mp g * q + r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mp f = Mp g * q + r
[PROOF STEP]
by (rule pdivmod_monic(1)[OF monic_Mpg], simp add: pdivmod_monic_pseudo_divmod qr monic_Mpg)
[PROOF STATE]
proof (state)
this:
Mp f = Mp g * q + r

goal (4 subgoals):
 1. Mp g \<noteq> 0
 2. F = G * Q + R
 3. R = 0 \<or> degree R < degree G
 4. r = 0 \<or> degree r < degree_m g
[PROOF STEP]
have monic_G: "monic G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic G
[PROOF STEP]
using monic_Mpg
[PROOF STATE]
proof (prove)
using this:
monic (Mp g)

goal (1 subgoal):
 1. monic G
[PROOF STEP]
using Mp_f_representative g
[PROOF STATE]
proof (prove)
using this:
monic (Mp g)
Mp ?f = to_int_poly (of_int_poly ?f)
G = of_int_poly g

goal (1 subgoal):
 1. monic G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
monic G

goal (4 subgoals):
 1. Mp g \<noteq> 0
 2. F = G * Q + R
 3. R = 0 \<or> degree R < degree G
 4. r = 0 \<or> degree r < degree_m g
[PROOF STEP]
show "F = G * Q + R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F = G * Q + R
[PROOF STEP]
by (rule pdivmod_monic(1)[OF monic_G], simp add: pdivmod_monic_pseudo_divmod QR monic_G)
[PROOF STATE]
proof (state)
this:
F = G * Q + R

goal (3 subgoals):
 1. Mp g \<noteq> 0
 2. R = 0 \<or> degree R < degree G
 3. r = 0 \<or> degree r < degree_m g
[PROOF STEP]
show "Mp g \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mp g \<noteq> 0
[PROOF STEP]
using monic_Mpg
[PROOF STATE]
proof (prove)
using this:
monic (Mp g)

goal (1 subgoal):
 1. Mp g \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Mp g \<noteq> 0

goal (2 subgoals):
 1. R = 0 \<or> degree R < degree G
 2. r = 0 \<or> degree r < degree_m g
[PROOF STEP]
show "R = 0 \<or> degree R < degree G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R = 0 \<or> degree R < degree G
[PROOF STEP]
by (rule pdivmod_monic(2)[OF monic_G],
        auto simp add: pdivmod_monic_pseudo_divmod monic_G intro: QR)
[PROOF STATE]
proof (state)
this:
R = 0 \<or> degree R < degree G

goal (1 subgoal):
 1. r = 0 \<or> degree r < degree_m g
[PROOF STEP]
show "r = 0 \<or> degree r < degree (Mp g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r = 0 \<or> degree r < degree_m g
[PROOF STEP]
by (rule pdivmod_monic(2)[OF monic_Mpg],
        auto simp add: pdivmod_monic_pseudo_divmod monic_Mpg intro: qr)
[PROOF STATE]
proof (state)
this:
r = 0 \<or> degree r < degree_m g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_Inter [continuous_intros, intro]: "finite S \<Longrightarrow> \<forall>T\<in>S. open T \<Longrightarrow> open (\<Inter>S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; Ball S open\<rbrakk> \<Longrightarrow> open (\<Inter> S)
[PROOF STEP]
by (induction set: finite) auto


[STATEMENT]
lemma real_Gromov_completion_rel_PInf:
  fixes u v::"nat \<Rightarrow> real"
  assumes "u \<longlonglongrightarrow> \<infinity>" "v \<longlonglongrightarrow> \<infinity>"
  shows "Gromov_completion_rel u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_completion_rel u v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gromov_completion_rel u v
[PROOF STEP]
have *: "Gromov_product_at 0 m n \<ge> min m n" for m n::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min m n \<le> Gromov_product_at 0 m n
[PROOF STEP]
unfolding Gromov_product_at_def dist_real_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min m n \<le> (\<bar>0 - m\<bar> + \<bar>0 - n\<bar> - \<bar>m - n\<bar>) / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
min ?m ?n \<le> Gromov_product_at 0 ?m ?n

goal (1 subgoal):
 1. Gromov_completion_rel u v
[PROOF STEP]
have **: "Gromov_product_at a m n \<ge> min m n - abs a" for m n a::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min m n - \<bar>a\<bar> \<le> Gromov_product_at a m n
[PROOF STEP]
using Gromov_product_at_diff1[of 0 m n a] *[of m n]
[PROOF STATE]
proof (prove)
using this:
\<bar>Gromov_product_at 0 m n - Gromov_product_at a m n\<bar> \<le> dist 0 a
min m n \<le> Gromov_product_at 0 m n

goal (1 subgoal):
 1. min m n - \<bar>a\<bar> \<le> Gromov_product_at a m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
min ?m ?n - \<bar>?a\<bar> \<le> Gromov_product_at ?a ?m ?n

goal (1 subgoal):
 1. Gromov_completion_rel u v
[PROOF STEP]
have "(\<lambda>n. Gromov_product_at a (u n) (v n)) \<longlonglongrightarrow> \<infinity>" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ereal (Gromov_product_at a (u x) (v x))) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
proof (rule tendsto_sandwich[of "\<lambda>n. min (u n) (v n) - abs a" _ _ "\<lambda>n. \<infinity>"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>\<^sub>F n in sequentially. ereal (min (u n) (v n) - \<bar>a\<bar>) \<le> ereal (Gromov_product_at a (u n) (v n))
 2. \<forall>\<^sub>F n in sequentially. ereal (Gromov_product_at a (u n) (v n)) \<le> \<infinity>
 3. (\<lambda>x. ereal (min (u x) (v x) - \<bar>a\<bar>)) \<longlonglongrightarrow> \<infinity>
 4. (\<lambda>n. \<infinity>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
have "ereal (min (u n) (v n) - \<bar>a\<bar>) \<le> ereal (Gromov_product_at a (u n) (v n))" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (min (u n) (v n) - \<bar>a\<bar>) \<le> ereal (Gromov_product_at a (u n) (v n))
[PROOF STEP]
using **[of "u n" "v n" a]
[PROOF STATE]
proof (prove)
using this:
min (u n) (v n) - \<bar>a\<bar> \<le> Gromov_product_at a (u n) (v n)

goal (1 subgoal):
 1. ereal (min (u n) (v n) - \<bar>a\<bar>) \<le> ereal (Gromov_product_at a (u n) (v n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (min (u ?n) (v ?n) - \<bar>a\<bar>) \<le> ereal (Gromov_product_at a (u ?n) (v ?n))

goal (4 subgoals):
 1. \<forall>\<^sub>F n in sequentially. ereal (min (u n) (v n) - \<bar>a\<bar>) \<le> ereal (Gromov_product_at a (u n) (v n))
 2. \<forall>\<^sub>F n in sequentially. ereal (Gromov_product_at a (u n) (v n)) \<le> \<infinity>
 3. (\<lambda>x. ereal (min (u x) (v x) - \<bar>a\<bar>)) \<longlonglongrightarrow> \<infinity>
 4. (\<lambda>n. \<infinity>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ereal (min (u ?n) (v ?n) - \<bar>a\<bar>) \<le> ereal (Gromov_product_at a (u ?n) (v ?n))
[PROOF STEP]
show "\<forall>\<^sub>F n in sequentially. ereal (min (u n) (v n) - \<bar>a\<bar>) \<le> ereal (Gromov_product_at a (u n) (v n))"
[PROOF STATE]
proof (prove)
using this:
ereal (min (u ?n) (v ?n) - \<bar>a\<bar>) \<le> ereal (Gromov_product_at a (u ?n) (v ?n))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ereal (min (u n) (v n) - \<bar>a\<bar>) \<le> ereal (Gromov_product_at a (u n) (v n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ereal (min (u n) (v n) - \<bar>a\<bar>) \<le> ereal (Gromov_product_at a (u n) (v n))

goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. ereal (Gromov_product_at a (u n) (v n)) \<le> \<infinity>
 2. (\<lambda>x. ereal (min (u x) (v x) - \<bar>a\<bar>)) \<longlonglongrightarrow> \<infinity>
 3. (\<lambda>n. \<infinity>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
have "(\<lambda>x. min (ereal(u x)) (ereal (v x)) - ereal \<bar>a\<bar>) \<longlonglongrightarrow> min \<infinity> \<infinity> - ereal \<bar>a\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. min (ereal (u x)) (ereal (v x)) - ereal \<bar>a\<bar>) \<longlonglongrightarrow> min \<infinity> \<infinity> - ereal \<bar>a\<bar>
[PROOF STEP]
apply (intro tendsto_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity>
 2. (\<lambda>x. ereal (v x)) \<longlonglongrightarrow> \<infinity>
 3. \<not> (min \<infinity> \<infinity> = \<infinity> \<and> ereal \<bar>a\<bar> = \<infinity> \<or> min \<infinity> \<infinity> = - \<infinity> \<and> ereal \<bar>a\<bar> = - \<infinity>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity>
(\<lambda>x. ereal (v x)) \<longlonglongrightarrow> \<infinity>

goal (3 subgoals):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity>
 2. (\<lambda>x. ereal (v x)) \<longlonglongrightarrow> \<infinity>
 3. \<not> (min \<infinity> \<infinity> = \<infinity> \<and> ereal \<bar>a\<bar> = \<infinity> \<or> min \<infinity> \<infinity> = - \<infinity> \<and> ereal \<bar>a\<bar> = - \<infinity>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. min (ereal (u x)) (ereal (v x)) - ereal \<bar>a\<bar>) \<longlonglongrightarrow> min \<infinity> \<infinity> - ereal \<bar>a\<bar>

goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. ereal (Gromov_product_at a (u n) (v n)) \<le> \<infinity>
 2. (\<lambda>x. ereal (min (u x) (v x) - \<bar>a\<bar>)) \<longlonglongrightarrow> \<infinity>
 3. (\<lambda>n. \<infinity>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. min (ereal (u x)) (ereal (v x)) - ereal \<bar>a\<bar>) \<longlonglongrightarrow> min \<infinity> \<infinity> - ereal \<bar>a\<bar>
[PROOF STEP]
show "(\<lambda>x. ereal (min (u x) (v x) - \<bar>a\<bar>)) \<longlonglongrightarrow> \<infinity>"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. min (ereal (u x)) (ereal (v x)) - ereal \<bar>a\<bar>) \<longlonglongrightarrow> min \<infinity> \<infinity> - ereal \<bar>a\<bar>

goal (1 subgoal):
 1. (\<lambda>x. ereal (min (u x) (v x) - \<bar>a\<bar>)) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. min (ereal (u x)) (ereal (v x)) - ereal \<bar>a\<bar>) \<longlonglongrightarrow> \<infinity> \<Longrightarrow> (\<lambda>x. ereal (min (u x) (v x) - \<bar>a\<bar>)) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
unfolding ereal_minus(1)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. min (ereal (u x)) (ereal (v x)) - ereal \<bar>a\<bar>) \<longlonglongrightarrow> \<infinity> \<Longrightarrow> (\<lambda>x. ereal (min (u x) (v x)) - ereal \<bar>a\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (min (u x) (v x) - \<bar>a\<bar>)) \<longlonglongrightarrow> \<infinity>

goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. ereal (Gromov_product_at a (u n) (v n)) \<le> \<infinity>
 2. (\<lambda>n. \<infinity>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
qed (auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (Gromov_product_at ?a (u x) (v x))) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. Gromov_completion_rel u v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (Gromov_product_at ?a (u x) (v x))) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. Gromov_completion_rel u v
[PROOF STEP]
have "Gromov_converging_at_boundary u" "Gromov_converging_at_boundary v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_converging_at_boundary u &&& Gromov_converging_at_boundary v
[PROOF STEP]
using real_Gromov_converging_to_boundary assms
[PROOF STATE]
proof (prove)
using this:
Gromov_converging_at_boundary ?u = ((\<lambda>x. ereal (?u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (?u x)) \<longlonglongrightarrow> - \<infinity>)
(\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity>
(\<lambda>x. ereal (v x)) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. Gromov_converging_at_boundary u &&& Gromov_converging_at_boundary v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_converging_at_boundary u
Gromov_converging_at_boundary v

goal (1 subgoal):
 1. Gromov_completion_rel u v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. ereal (Gromov_product_at ?a (u x) (v x))) \<longlonglongrightarrow> \<infinity>
Gromov_converging_at_boundary u
Gromov_converging_at_boundary v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ereal (Gromov_product_at ?a (u x) (v x))) \<longlonglongrightarrow> \<infinity>
Gromov_converging_at_boundary u
Gromov_converging_at_boundary v

goal (1 subgoal):
 1. Gromov_completion_rel u v
[PROOF STEP]
unfolding Gromov_completion_rel_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ereal (Gromov_product_at ?a (u x) (v x))) \<longlonglongrightarrow> \<infinity>
Gromov_converging_at_boundary u
Gromov_converging_at_boundary v

goal (1 subgoal):
 1. Gromov_converging_at_boundary u \<and> Gromov_converging_at_boundary v \<and> (\<forall>a. (\<lambda>x. ereal (Gromov_product_at a (u x) (v x))) \<longlonglongrightarrow> \<infinity>) \<or> (\<forall>n m. u n = v m \<and> u n = u m \<and> v n = v m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_completion_rel u v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_components_of_overlap:
    "\<lbrakk>C \<in> path_components_of X; C' \<in> path_components_of X\<rbrakk> \<Longrightarrow> C \<inter> C' \<noteq> {} \<longleftrightarrow> C = C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>C \<in> path_components_of X; C' \<in> path_components_of X\<rbrakk> \<Longrightarrow> (C \<inter> C' \<noteq> {}) = (C = C')
[PROOF STEP]
by (auto simp: path_components_of_def path_component_of_equiv)


[STATEMENT]
lemma foundedUn: "(founded subs P (A Un B)) = (founded subs P A & founded subs P B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. founded subs P (A \<union> B) = (founded subs P A \<and> founded subs P B)
[PROOF STEP]
apply(simp add: founded_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>A \<union> B. case x of (n, delta) \<Rightarrow> terminal subs delta \<longrightarrow> P delta) = ((\<forall>x\<in>A. case x of (n, delta) \<Rightarrow> terminal subs delta \<longrightarrow> P delta) \<and> (\<forall>x\<in>B. case x of (n, delta) \<Rightarrow> terminal subs delta \<longrightarrow> P delta))
[PROOF STEP]
by force


[STATEMENT]
lemma nonneg_has_sum_le_0D:
  fixes f :: "'a \<Rightarrow> 'b::{topological_ab_group_add,ordered_ab_group_add,linorder_topology}"
  assumes "has_sum f A a" \<open>a \<le> 0\<close>
    and nneg: "\<And>x. x \<in> A \<Longrightarrow> f x \<ge> 0"
    and "x \<in> A"
  shows "f x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x = (0::'b)
[PROOF STEP]
by (metis assms(1) assms(2) assms(4) infsumI nonneg_infsum_le_0D summable_on_def nneg)


[STATEMENT]
lemma in_sccs_verts_conv:
    "S \<in> sccs_verts \<longleftrightarrow> G \<restriction> S \<in> sccs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S \<in> sccs_verts) = (G \<restriction> S \<in> sccs)
[PROOF STEP]
by (auto simp: sccs_verts_conv intro: rev_image_eqI)
      (metis in_sccs_imp_induced induce_subgraph_verts induced_eq_verts_imp_eq induced_imp_subgraph induced_induce subgraphE)


[STATEMENT]
lemma in_span_listI:
  assumes "c : {0..<length vs} \<rightarrow> carrier R" and "v = lincomb_list c vs"
  shows "v \<in> span_list vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> span_list vs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<in> {0..<length vs} \<rightarrow> carrier R
v = lincomb_list c vs

goal (1 subgoal):
 1. v \<in> span_list vs
[PROOF STEP]
by (auto simp: span_list_def)


[STATEMENT]
lemma app_correct:
  assumes "ft_invar t1" "ft_invar t2"
  shows "toList (app t1 t2) = (toList t1) @ (toList t2)"
    and "ft_invar (app t1 t2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. toList (app t1 t2) = toList t1 @ toList t2 &&& ft_invar (app t1 t2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ft_invar t1
ft_invar t2

goal (1 subgoal):
 1. toList (app t1 t2) = toList t1 @ toList t2 &&& ft_invar (app t1 t2)
[PROOF STEP]
by (auto simp add: app3_inv app3_list ft_invar_def app_def)


[STATEMENT]
lemma vifunion_absorb:
  assumes "j \<in>\<^sub>\<circ> I"
  shows "f j \<union>\<^sub>\<circ> (\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. f i) = (\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f j \<union>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I f `\<^sub>\<circ> I) = \<Union>\<^sub>\<circ> (VLambda I f `\<^sub>\<circ> I)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
j \<in>\<^sub>\<circ> I

goal (1 subgoal):
 1. f j \<union>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I f `\<^sub>\<circ> I) = \<Union>\<^sub>\<circ> (VLambda I f `\<^sub>\<circ> I)
[PROOF STEP]
by force


[STATEMENT]
lemma (in finite_incidence_system) image_set_system_finite:
  "finite_incidence_system (f ` \<V>) (blocks_image \<B> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_incidence_system (f ` \<V>) (blocks_image \<B> f)
[PROOF STEP]
using image_set_system_wellformed finite_sets
[PROOF STATE]
proof (prove)
using this:
incidence_system (?f ` \<V>) (blocks_image \<B> ?f)
finite \<V>

goal (1 subgoal):
 1. finite_incidence_system (f ` \<V>) (blocks_image \<B> f)
[PROOF STEP]
by (intro_locales) (simp_all add: blocks_image_def finite_incidence_system_axioms.intro)


[STATEMENT]
lemma finite_dom_cond_override:
 "\<lbrakk> finite (dom s); finite (dom t) \<rbrakk> \<Longrightarrow> finite (dom (cond_override C s t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (dom s); finite (dom t)\<rbrakk> \<Longrightarrow> finite (dom (cond_override C s t))
[PROOF STEP]
apply (rule_tac B="dom s \<union> dom t" in finite_subset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite (dom s); finite (dom t)\<rbrakk> \<Longrightarrow> dom (cond_override C s t) \<subseteq> dom s \<union> dom t
 2. \<lbrakk>finite (dom s); finite (dom t)\<rbrakk> \<Longrightarrow> finite (dom s \<union> dom t)
[PROOF STEP]
apply (rule dom_cond_override)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (dom s); finite (dom t)\<rbrakk> \<Longrightarrow> finite (dom s \<union> dom t)
[PROOF STEP]
by (rule finite_UnI)