[STATEMENT]
lemma (in group) normal_subgroup_factorize:
  assumes "N \<lhd> G" and "N \<subseteq> H" and "subgroup H G"
  shows "subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
interpret GModN: group "G Mod N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (G Mod N)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
N \<lhd> G

goal (1 subgoal):
 1. Group.group (G Mod N)
[PROOF STEP]
by (rule normal.factorgroup_is_group)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
have "N \<lhd> G\<lparr>carrier := H\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<lhd> G\<lparr>carrier := H\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N \<lhd> G
N \<subseteq> H
subgroup H G

goal (1 subgoal):
 1. N \<lhd> G\<lparr>carrier := H\<rparr>
[PROOF STEP]
by (metis normal_restrict_supergroup)
[PROOF STATE]
proof (state)
this:
N \<lhd> G\<lparr>carrier := H\<rparr>

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
hence grpHN:"group (G\<lparr>carrier := H\<rparr> Mod N)"
[PROOF STATE]
proof (prove)
using this:
N \<lhd> G\<lparr>carrier := H\<rparr>

goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := H\<rparr> Mod N)
[PROOF STEP]
by (rule normal.factorgroup_is_group)
[PROOF STATE]
proof (state)
this:
Group.group (G\<lparr>carrier := H\<rparr> Mod N)

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
have "(<#>\<^bsub>G\<lparr>carrier:=H\<rparr>\<^esub>) = (\<lambda>U K. (\<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k})
[PROOF STEP]
using set_mult_def
[PROOF STATE]
proof (prove)
using this:
?H <#>\<^bsub>?G\<^esub> ?K = (\<Union>h\<in>?H. \<Union>k\<in>?K. {h \<otimes>\<^bsub>?G\<^esub> k})

goal (1 subgoal):
 1. (<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k})
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k})

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k})

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
have "\<dots> = (\<lambda>U K. (\<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<^esub> k}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k}) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes> k})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k}) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes> k})

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k}) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes> k})

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
have "(<#>) = (\<lambda>U K. (\<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes> k}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (<#>) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes> k})
[PROOF STEP]
using set_mult_def
[PROOF STATE]
proof (prove)
using this:
?H <#>\<^bsub>?G\<^esub> ?K = (\<Union>h\<in>?H. \<Union>k\<in>?K. {h \<otimes>\<^bsub>?G\<^esub> k})

goal (1 subgoal):
 1. (<#>) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes> k})
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(<#>) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes> k})

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k})
(\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k}) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes> k})
(<#>) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes> k})
[PROOF STEP]
have "(<#>\<^bsub>G\<lparr>carrier:=H\<rparr>\<^esub>) = (<#>\<^bsub>G\<^esub>)"
[PROOF STATE]
proof (prove)
using this:
(<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k})
(\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> k}) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes> k})
(<#>) = (\<lambda>U K. \<Union>h\<in>U. \<Union>k\<in>K. {h \<otimes> k})

goal (1 subgoal):
 1. (<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (<#>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (<#>)

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
with grpHN
[PROOF STATE]
proof (chain)
picking this:
Group.group (G\<lparr>carrier := H\<rparr> Mod N)
(<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (<#>)
[PROOF STEP]
have "group ((G Mod N)\<lparr>carrier := (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N)\<rparr>)"
[PROOF STATE]
proof (prove)
using this:
Group.group (G\<lparr>carrier := H\<rparr> Mod N)
(<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (<#>)

goal (1 subgoal):
 1. Group.group ((G Mod N)\<lparr>carrier := rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N\<rparr>)
[PROOF STEP]
unfolding FactGroup_def
[PROOF STATE]
proof (prove)
using this:
Group.group \<lparr>carrier = rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N, monoid.mult = (<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>), one = N\<rparr>
(<#>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>) = (<#>)

goal (1 subgoal):
 1. Group.group (\<lparr>carrier = rcosets N, monoid.mult = (<#>), one = N\<rparr>\<lparr>carrier := rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N\<rparr>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Group.group ((G Mod N)\<lparr>carrier := rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N\<rparr>)

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Group.group ((G Mod N)\<lparr>carrier := rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N\<rparr>)

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
have "rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N \<subseteq> carrier (G Mod N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N \<subseteq> carrier (G Mod N)
[PROOF STEP]
unfolding FactGroup_def RCOSETS_def r_coset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>a\<in>carrier (G\<lparr>carrier := H\<rparr>). {\<Union>h\<in>N. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a}}) \<subseteq> carrier \<lparr>carrier = \<Union>a\<in>carrier G. {\<Union>h\<in>N. {h \<otimes> a}}, monoid.mult = (<#>), one = N\<rparr>
[PROOF STEP]
using assms(3) subgroup.subset
[PROOF STATE]
proof (prove)
using this:
subgroup H G
subgroup ?H ?G \<Longrightarrow> ?H \<subseteq> carrier ?G

goal (1 subgoal):
 1. (\<Union>a\<in>carrier (G\<lparr>carrier := H\<rparr>). {\<Union>h\<in>N. {h \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a}}) \<subseteq> carrier \<lparr>carrier = \<Union>a\<in>carrier G. {\<Union>h\<in>N. {h \<otimes> a}}, monoid.mult = (<#>), one = N\<rparr>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N \<subseteq> carrier (G Mod N)

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Group.group ((G Mod N)\<lparr>carrier := rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N\<rparr>)
rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N \<subseteq> carrier (G Mod N)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Group.group ((G Mod N)\<lparr>carrier := rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N\<rparr>)
rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N \<subseteq> carrier (G Mod N)

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
using GModN.is_group group.restrict_group_imp_subgroup
[PROOF STATE]
proof (prove)
using this:
Group.group ((G Mod N)\<lparr>carrier := rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N\<rparr>)
rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N \<subseteq> carrier (G Mod N)
Group.group (G Mod N)
\<lbrakk>Group.group ?G; ?H \<subseteq> carrier ?G; Group.group (?G\<lparr>carrier := ?H\<rparr>)\<rbrakk> \<Longrightarrow> subgroup ?H ?G

goal (1 subgoal):
 1. subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subgroup (rcosets\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> N) (G Mod N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enat_of_option_le_conv:
  "enat_of_option m \<le> enat_of_option n \<longleftrightarrow> (case (m,n) of
      (_,None) \<Rightarrow> True
    | (Some a, Some b) \<Rightarrow> a\<le>b
    | (_, _) \<Rightarrow> False
  )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Dijkstra_Abstract.enat_of_option m \<le> Dijkstra_Abstract.enat_of_option n) = (case (m, n) of (None, None) \<Rightarrow> True | (None, Some aa) \<Rightarrow> False | (Some aa, None) \<Rightarrow> True | (Some aa, Some b) \<Rightarrow> aa \<le> b)
[PROOF STEP]
by (auto split: option.split)


[STATEMENT]
lemma Limsup_lessD:
  "y > Limsup F (f :: _ \<Rightarrow> 'a :: complete_linorder) \<Longrightarrow> eventually (\<lambda>x. f x < y) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limsup F f < y \<Longrightarrow> \<forall>\<^sub>F x in F. f x < y
[PROOF STEP]
using Limsup_le_iff[of F f "Limsup F f"]
[PROOF STATE]
proof (prove)
using this:
(Limsup F f \<le> Limsup F f) = (\<forall>y>Limsup F f. \<forall>\<^sub>F x in F. f x < y)

goal (1 subgoal):
 1. Limsup F f < y \<Longrightarrow> \<forall>\<^sub>F x in F. f x < y
[PROOF STEP]
by simp


[STATEMENT]
lemma card_UNIV_char:
  "card (UNIV :: char set) = 256"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card UNIV = 256
[PROOF STEP]
by (auto simp add: UNIV_char_of_nat card_image)


[STATEMENT]
lemma has_bochner_integral_diff:
  "has_bochner_integral M f x \<Longrightarrow> has_bochner_integral M g y \<Longrightarrow>
    has_bochner_integral M (\<lambda>x. f x - g x) (x - y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>has_bochner_integral M f x; has_bochner_integral M g y\<rbrakk> \<Longrightarrow> has_bochner_integral M (\<lambda>x. f x - g x) (x - y)
[PROOF STEP]
unfolding diff_conv_add_uminus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>has_bochner_integral M f x; has_bochner_integral M g y\<rbrakk> \<Longrightarrow> has_bochner_integral M (\<lambda>x. f x + - g x) (x + - y)
[PROOF STEP]
by (intro has_bochner_integral_add has_bochner_integral_minus)


[STATEMENT]
lemma Ima''m_calc: "$(I^{m}a'')^{m}_n = (1 - (n*m+1)*$v^n + n*m*$v.^(n+1/m)) / (m*(1-$v.^(1/m)))^2"
  if "i \<noteq> 0" "m \<noteq> 0" for n m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $(I^{m}a'')^{m}_n = (1 - real (n * m + 1) * $v ^ n + real (n * m) * $v .^ (real n + 1 / real m)) / (real m * (1 - $v .^ (1 / real m)))\<^sup>2
[PROOF STEP]
using that v_pos
[PROOF STATE]
proof (prove)
using this:
i \<noteq> 0
m \<noteq> 0
0 < $v

goal (1 subgoal):
 1. $(I^{m}a'')^{m}_n = (1 - real (n * m + 1) * $v ^ n + real (n * m) * $v .^ (real n + 1 / real m)) / (real m * (1 - $v .^ (1 / real m)))\<^sup>2
[PROOF STEP]
apply (subst Ila''m_Ilam, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<noteq> 0; m \<noteq> 0; 0 < $v\<rbrakk> \<Longrightarrow> (1 + i) .^ (1 / real m) * $(I^{m}a)^{m}_n = (1 - real (n * m + 1) * $v ^ n + real (n * m) * $v .^ (real n + 1 / real m)) / (real m * (1 - $v .^ (1 / real m)))\<^sup>2
[PROOF STEP]
apply (subst Imam_calc; simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<noteq> 0; 0 < m; 0 < $v\<rbrakk> \<Longrightarrow> $v .^ (1 / real m) = 1 \<or> 1 - (1 + real n * real m) * $v ^ n + real n * real m * $v .^ (real n + 1 / real m) = 0 \<or> (1 + i) .^ (1 / real m) * $v .^ (1 / real m) = 1
[PROOF STEP]
by (smt (verit, del_insts) i_v_powr powr_add powr_zero_eq_one)


[STATEMENT]
lemma cltn2_abs_rep_abs_mult:
  assumes "invertible M" and "invertible N"
  shows "cltn2_abs (cltn2_rep (cltn2_abs M) ** N) = cltn2_abs (M ** N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cltn2_abs (cltn2_rep (cltn2_abs M) ** N) = cltn2_abs (M ** N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cltn2_abs (cltn2_rep (cltn2_abs M) ** N) = cltn2_abs (M ** N)
[PROOF STEP]
from \<open>invertible M\<close> and \<open>invertible N\<close>
[PROOF STATE]
proof (chain)
picking this:
invertible M
invertible N
[PROOF STEP]
have "invertible (M ** N)"
[PROOF STATE]
proof (prove)
using this:
invertible M
invertible N

goal (1 subgoal):
 1. invertible (M ** N)
[PROOF STEP]
by (simp add: invertible_mult)
[PROOF STATE]
proof (state)
this:
invertible (M ** N)

goal (1 subgoal):
 1. cltn2_abs (cltn2_rep (cltn2_abs M) ** N) = cltn2_abs (M ** N)
[PROOF STEP]
from \<open>invertible M\<close> and cltn2_rep_abs2
[PROOF STATE]
proof (chain)
picking this:
invertible M
invertible ?A \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> cltn2_rep (cltn2_abs ?A) = k *\<^sub>R ?A
[PROOF STEP]
obtain k where "k \<noteq> 0" and "cltn2_rep (cltn2_abs M) = k *\<^sub>R M"
[PROOF STATE]
proof (prove)
using this:
invertible M
invertible ?A \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> cltn2_rep (cltn2_abs ?A) = k *\<^sub>R ?A

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>k \<noteq> 0; cltn2_rep (cltn2_abs M) = k *\<^sub>R M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<noteq> 0
cltn2_rep (cltn2_abs M) = k *\<^sub>R M

goal (1 subgoal):
 1. cltn2_abs (cltn2_rep (cltn2_abs M) ** N) = cltn2_abs (M ** N)
[PROOF STEP]
from \<open>cltn2_rep (cltn2_abs M) = k *\<^sub>R M\<close>
[PROOF STATE]
proof (chain)
picking this:
cltn2_rep (cltn2_abs M) = k *\<^sub>R M
[PROOF STEP]
have "cltn2_rep (cltn2_abs M) ** N = k *\<^sub>R M ** N"
[PROOF STATE]
proof (prove)
using this:
cltn2_rep (cltn2_abs M) = k *\<^sub>R M

goal (1 subgoal):
 1. cltn2_rep (cltn2_abs M) ** N = k *\<^sub>R M ** N
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cltn2_rep (cltn2_abs M) ** N = k *\<^sub>R M ** N

goal (1 subgoal):
 1. cltn2_abs (cltn2_rep (cltn2_abs M) ** N) = cltn2_abs (M ** N)
[PROOF STEP]
with \<open>k \<noteq> 0\<close> and \<open>invertible (M ** N)\<close> and cltn2_abs_mult
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 0
invertible (M ** N)
\<lbrakk>?k \<noteq> 0; invertible ?A\<rbrakk> \<Longrightarrow> cltn2_abs (?k *\<^sub>R ?A) = cltn2_abs ?A
cltn2_rep (cltn2_abs M) ** N = k *\<^sub>R M ** N
[PROOF STEP]
show "cltn2_abs (cltn2_rep (cltn2_abs M) ** N) = cltn2_abs (M ** N)"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
invertible (M ** N)
\<lbrakk>?k \<noteq> 0; invertible ?A\<rbrakk> \<Longrightarrow> cltn2_abs (?k *\<^sub>R ?A) = cltn2_abs ?A
cltn2_rep (cltn2_abs M) ** N = k *\<^sub>R M ** N

goal (1 subgoal):
 1. cltn2_abs (cltn2_rep (cltn2_abs M) ** N) = cltn2_abs (M ** N)
[PROOF STEP]
by (simp add: scalar_matrix_assoc [symmetric])
[PROOF STATE]
proof (state)
this:
cltn2_abs (cltn2_rep (cltn2_abs M) ** N) = cltn2_abs (M ** N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma d_reaches_unique_cases[simp] : "{ q . d_reaches M (initial M) xs q } = {}
                                      \<or> (\<exists> q2 . { q . d_reaches M (initial M) xs q } = { q2 })"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {q. d_reaches M (initial M) xs q} = {} \<or> (\<exists>q2. {q. d_reaches M (initial M) xs q} = {q2})
[PROOF STEP]
unfolding d_reaches.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {q. \<exists>tr ys. d_reached_by M (initial M) xs q tr ys} = {} \<or> (\<exists>q2. {q. \<exists>tr ys. d_reached_by M (initial M) xs q tr ys} = {q2})
[PROOF STEP]
by blast


[STATEMENT]
lemma rtrancl_listrel1_if_listrel:
  "(xs,ys) \<in> listrel r \<Longrightarrow> (xs,ys) \<in> (listrel1 r)\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs, ys) \<in> listrel r \<Longrightarrow> (xs, ys) \<in> (listrel1 r)\<^sup>*
[PROOF STEP]
by(metis listrel_rtrancl_eq_rtrancl_listrel1 subsetD[OF listrel_mono] r_into_rtrancl subsetI)


[STATEMENT]
lemma quotient_of_inject:
  assumes "quotient_of a = quotient_of b"
  shows "a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = b
[PROOF STEP]
obtain p q r s where a: "a = Fract p q" and b: "b = Fract r s" and "q > 0" and "s > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p q r s. \<lbrakk>a = Fract p q; b = Fract r s; 0 < q; 0 < s\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases a, cases b)
[PROOF STATE]
proof (state)
this:
a = Fract p q
b = Fract r s
0 < q
0 < s

goal (1 subgoal):
 1. a = b
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
quotient_of a = quotient_of b
a = Fract p q
b = Fract r s
0 < q
0 < s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
quotient_of a = quotient_of b
a = Fract p q
b = Fract r s
0 < q
0 < s

goal (1 subgoal):
 1. a = b
[PROOF STEP]
by (simp add: eq_rat quotient_of_Fract normalize_crossproduct)
[PROOF STATE]
proof (state)
this:
a = b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_bound:
  fixes f :: "('a::topological_space, 'b::real_normed_vector) bcontfun"
  assumes "\<And>x. norm (apply_bcontfun f x) \<le> b"
  shows "norm f \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm f \<le> b
[PROOF STEP]
using dist_bound[of f 0 b] assms
[PROOF STATE]
proof (prove)
using this:
(\<And>x. dist (apply_bcontfun f x) (apply_bcontfun 0 x) \<le> b) \<Longrightarrow> dist f 0 \<le> b
norm (apply_bcontfun f ?x) \<le> b

goal (1 subgoal):
 1. norm f \<le> b
[PROOF STEP]
by (simp add: dist_norm)


[STATEMENT]
lemma pmf_map_inj: "inj_on f (set_pmf M) \<Longrightarrow> x \<in> set_pmf M \<Longrightarrow> pmf (map_pmf f M) (f x) = pmf M x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f (set_pmf M); x \<in> set_pmf M\<rbrakk> \<Longrightarrow> pmf (map_pmf f M) (f x) = pmf M x
[PROOF STEP]
by (auto simp: pmf.rep_eq map_pmf_rep_eq measure_distr AE_measure_pmf_iff inj_onD
           intro!: measure_pmf.finite_measure_eq_AE)


[STATEMENT]
lemma left_options_plus:
  "left_options (plus_game u v) =  zunion (zimage (\<lambda>g. plus_game g v) (left_options u)) (zimage (\<lambda>h. plus_game u h) (left_options v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. left_options (plus_game u v) = zunion (zimage (\<lambda>g. plus_game g v) (left_options u)) (zimage (plus_game u) (left_options v))
[PROOF STEP]
by (subst plus_game.simps, simp)


[STATEMENT]
lemma nn_integral_pmf_of_set: "nn_integral (measure_pmf pmf_of_set) f = sum f S / card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (measure_pmf local.pmf_of_set) f = sum f S / of_nat (card S)
[PROOF STEP]
by (subst nn_integral_measure_pmf_finite)
     (simp_all add: sum_distrib_right[symmetric] card_gt_0_iff S_not_empty S_finite divide_ennreal_def
                divide_ennreal[symmetric] ennreal_of_nat_eq_real_of_nat[symmetric] ennreal_times_divide)


[STATEMENT]
lemma NSLIMSEQ_inverse_real_of_nat_add: "(\<lambda>n. r + inverse (real (Suc n))) \<longlonglongrightarrow>\<^sub>N\<^sub>S r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. r + inverse (real (Suc n))) \<longlonglongrightarrow>\<^sub>N\<^sub>S r
[PROOF STEP]
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_real_of_nat_add del: of_nat_Suc)


[STATEMENT]
lemma succ_tran_correct: "FiniteGraph.succ_tran (list_graph_to_graph G) v = set (succ_tran G v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FiniteGraph.succ_tran (list_graph_to_graph G) v = set (FiniteListGraph.succ_tran G v)
[PROOF STEP]
unfolding FiniteGraph.succ_tran_def succ_tran_def list_graph_to_graph_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {e2. (v, e2) \<in> (edges \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>)\<^sup>+} = set (trancl_list_impl (edgesL G) [v])
[PROOF STEP]
by (simp add:trancl_list_impl)

  \<comment> \<open>num_reachable\<close>


[STATEMENT]
lemma rot_circle_bot_right_edges_neq [simp]: "rot_circle_bot_edge \<noteq> rot_circle_right_edge"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rot_circle_bot_edge \<noteq> rot_circle_right_edge
[PROOF STEP]
apply (simp add: rot_circle_right_edge_def rot_circle_bot_edge_def x_coord_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. (0, - (d / 2))) \<noteq> (\<lambda>t. (d * circle_y (t - 1 / 2), (t - 1 / 2) * d))
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) cancel_comm_monoid_add_class.diff_cancel d_gt_0 divide_eq_0_iff mult_zero_left neg_0_equal_iff_equal order_less_irrefl prod.sel(2) zero_neq_numeral)


[STATEMENT]
lemma F1map_comp_id: "F1map g1 g2 g3 (F1map id f2 f3 x) = F1map g1 (g2 o f2) (g3 o f3) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F1map g1 g2 g3 (F1map id f2 f3 x) = F1map g1 (g2 \<circ> f2) (g3 \<circ> f3) x
[PROOF STEP]
apply (rule trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. F1map g1 g2 g3 (F1map id f2 f3 x) = ?s
 2. ?s = F1map g1 (g2 \<circ> f2) (g3 \<circ> f3) x
[PROOF STEP]
apply (rule F1.map_comp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F1map (g1 \<circ> id) (g2 \<circ> f2) (g3 \<circ> f3) x = F1map g1 (g2 \<circ> f2) (g3 \<circ> f3) x
[PROOF STEP]
unfolding o_id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F1map g1 (g2 \<circ> f2) (g3 \<circ> f3) x = F1map g1 (g2 \<circ> f2) (g3 \<circ> f3) x
[PROOF STEP]
apply (rule refl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma concat_equal_length_map:
assumes "\<And>i. i<a \<Longrightarrow> length (f i) = d"
shows "length (concat (map (\<lambda>i. f i) [0..<a])) = a*d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (concat (map f [0..<a])) = a * d
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i < a \<Longrightarrow> length (f ?i) = d

goal (1 subgoal):
 1. length (concat (map f [0..<a])) = a * d
[PROOF STEP]
by (induction a;auto)


[STATEMENT]
lemma complex_unimodular_polar:
  assumes "norm z = 1"
  obtains t where "0 \<le> t" "t < 2 * pi" "z = Complex (cos t) (sin t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t. \<lbrakk>0 \<le> t; t < 2 * pi; z = Complex (cos t) (sin t)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis cmod_power2 one_power2 complex_surj sincos_total_2pi [of "Re z" "Im z"] assms)


[STATEMENT]
lemma graph_map_insert [simp]: "\<lbrakk>functional g; g``{x} \<subseteq> {y}\<rbrakk> \<Longrightarrow> graph_map (insert (x,y) g) = (graph_map g)(x \<mapsto> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>functional g; g `` {x} \<subseteq> {y}\<rbrakk> \<Longrightarrow> graph_map (insert (x, y) g) = graph_map g(x \<mapsto> y)
[PROOF STEP]
by (rule ext, auto simp add:graph_map_def)


[STATEMENT]
lemma interpret_floatarith_sin:
  "interpret_floatarith (Cos (Add (Mult Pi (Num (Float 1 (- 1)))) (Minus a))) vs =
    sin (interpret_floatarith a vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interpret_floatarith (Cos (Add (Mult Pi (Num (Float 1 (- 1)))) (Minus a))) vs = sin (interpret_floatarith a vs)
[PROOF STEP]
unfolding sin_cos_eq interpret_floatarith.simps
    interpret_floatarith_divide interpret_floatarith_diff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (pi * real_of_float (Float 1 (- 1)) + - interpret_floatarith a vs) = cos (of_real pi / 2 - interpret_floatarith a vs)
[PROOF STEP]
by auto


[STATEMENT]
lemma iotaTr0: "\<lbrakk>Group G; G \<guillemotright> H; G \<triangleright> N\<rbrakk> \<Longrightarrow>
               ginj\<^bsub>(Gp G H),(Gp G (H \<diamondop>\<^bsub>G\<^esub> N))\<^esub> (\<iota>\<^bsub>(Gp G H)\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; G \<guillemotright> H ; G \<triangleright> N\<rbrakk> \<Longrightarrow> ginj\<^bsub>(\<natural>\<^bsub>G\<^esub>H),(\<natural>\<^bsub>G\<^esub>H \<diamondop>\<^bsub>G\<^esub> N)\<^esub> \<iota>\<^bsub>(\<natural>\<^bsub>G\<^esub>H)\<^esub>
[PROOF STEP]
apply (simp add:ginjec_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; G \<guillemotright> H ; G \<triangleright> N\<rbrakk> \<Longrightarrow> \<iota>\<^bsub>(\<natural>\<^bsub>G\<^esub>H)\<^esub> \<in> gHom (\<natural>\<^bsub>G\<^esub>H) (\<natural>\<^bsub>G\<^esub>H \<diamondop>\<^bsub>G\<^esub> N) \<and> inj_on (\<iota>\<^bsub>(\<natural>\<^bsub>G\<^esub>H)\<^esub>) (carrier (\<natural>\<^bsub>G\<^esub>H))
[PROOF STEP]
apply (simp add:iotahom)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group G; G \<guillemotright> H ; G \<triangleright> N\<rbrakk> \<Longrightarrow> inj_on (\<iota>\<^bsub>(\<natural>\<^bsub>G\<^esub>H)\<^esub>) (carrier (\<natural>\<^bsub>G\<^esub>H))
[PROOF STEP]
apply (simp add:inj_on_def iota_def Gp_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_iterator_image_filter_correct :
  fixes it :: "('a,'\<sigma>) set_iterator"
  fixes g :: "'a \<Rightarrow> 'b option"
  assumes it_OK: "set_iterator it S"
  assumes g_inj_on: "inj_on g (S \<inter> dom g)"
  shows "set_iterator (set_iterator_image_filter g it) {y. \<exists>x. x \<in> S \<and> g x = Some y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator (set_iterator_image_filter g it) {y. \<exists>x. x \<in> S \<and> g x = Some y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_iterator (set_iterator_image_filter g it) {y. \<exists>x. x \<in> S \<and> g x = Some y}
[PROOF STEP]
note res' = set_iterator_genord_image_filter_correct [OF it_OK[unfolded set_iterator_def],
     of g "\<lambda>_ _. True"]
[PROOF STATE]
proof (state)
this:
\<lbrakk>inj_on g (S \<inter> dom g); \<And>x y x' y'. \<lbrakk>x \<in> S; g x = Some x'; y \<in> S; g y = Some y'; True\<rbrakk> \<Longrightarrow> True\<rbrakk> \<Longrightarrow> set_iterator_genord (set_iterator_image_filter g it) {y. \<exists>x. x \<in> S \<and> g x = Some y} (\<lambda>_ _. True)

goal (1 subgoal):
 1. set_iterator (set_iterator_image_filter g it) {y. \<exists>x. x \<in> S \<and> g x = Some y}
[PROOF STEP]
note res = set_iterator_intro [OF res']
[PROOF STATE]
proof (state)
this:
\<lbrakk>inj_on g (S \<inter> dom g); \<And>x y x' y'. \<lbrakk>x \<in> S; g x = Some x'; y \<in> S; g y = Some y'; True\<rbrakk> \<Longrightarrow> True\<rbrakk> \<Longrightarrow> set_iterator (set_iterator_image_filter g it) {y. \<exists>x. x \<in> S \<and> g x = Some y}

goal (1 subgoal):
 1. set_iterator (set_iterator_image_filter g it) {y. \<exists>x. x \<in> S \<and> g x = Some y}
[PROOF STEP]
with g_inj_on
[PROOF STATE]
proof (chain)
picking this:
inj_on g (S \<inter> dom g)
\<lbrakk>inj_on g (S \<inter> dom g); \<And>x y x' y'. \<lbrakk>x \<in> S; g x = Some x'; y \<in> S; g y = Some y'; True\<rbrakk> \<Longrightarrow> True\<rbrakk> \<Longrightarrow> set_iterator (set_iterator_image_filter g it) {y. \<exists>x. x \<in> S \<and> g x = Some y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on g (S \<inter> dom g)
\<lbrakk>inj_on g (S \<inter> dom g); \<And>x y x' y'. \<lbrakk>x \<in> S; g x = Some x'; y \<in> S; g y = Some y'; True\<rbrakk> \<Longrightarrow> True\<rbrakk> \<Longrightarrow> set_iterator (set_iterator_image_filter g it) {y. \<exists>x. x \<in> S \<and> g x = Some y}

goal (1 subgoal):
 1. set_iterator (set_iterator_image_filter g it) {y. \<exists>x. x \<in> S \<and> g x = Some y}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_iterator (set_iterator_image_filter g it) {y. \<exists>x. x \<in> S \<and> g x = Some y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<forall>x::'a::linordered_field. \<exists>y. \<forall>z>19. y \<le> x + z \<and> (\<exists>w. \<bar>y - x\<bar> < w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<exists>y. \<forall>z>19::'a. y \<le> x + z \<and> (\<exists>w. \<bar>y - x\<bar> < w)
[PROOF STEP]
by ferrack


[STATEMENT]
lemma Mndet_cont[simp]: "(\<And>x. cont (f x)) \<Longrightarrow> cont (\<lambda>y. (\<sqinter> z \<in> A \<rightarrow> (f z y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. cont (f x)) \<Longrightarrow> cont (\<lambda>y. \<sqinter>z\<in>A \<rightarrow>  f z y)
[PROOF STEP]
apply(rule_tac f = "\<lambda>z y. (f y z)" in Cont.cont_compose, rule monocontlub2cont)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (\<And>x. cont (f x)) \<Longrightarrow> monofun (mndet A)
 2. (\<And>x. cont (f x)) \<Longrightarrow> contlub (mndet A)
 3. (\<And>x. cont (f x)) \<Longrightarrow> cont (\<lambda>x y. f y x)
[PROOF STEP]
by (auto intro: mono_Mndet contlub_Mndet Fun_Cpo.cont2cont_lambda)


[STATEMENT]
lemma kruskal_exchange_acyclic_inv_1:
  assumes "acyclic f"
      and "covector q"
    shows "acyclic ((f \<sqinter> -q) \<squnion> (f \<sqinter> q)\<^sup>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pd_kleene_allegory_class.acyclic (f \<sqinter> - q \<squnion> (f \<sqinter> q)\<^sup>T)
[PROOF STEP]
using kruskal_acyclic_inv[where e=bot]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>pd_kleene_allegory_class.acyclic ?f; covector ?q; (?f \<sqinter> ?q)\<^sup>T * ?f\<^sup>\<star> * bot = bot; bot * ?f\<^sup>\<star> * bot = bot; forest_components ?f \<le> - bot\<rbrakk> \<Longrightarrow> pd_kleene_allegory_class.acyclic (?f \<sqinter> - ?q \<squnion> (?f \<sqinter> ?q)\<^sup>T \<squnion> bot)

goal (1 subgoal):
 1. pd_kleene_allegory_class.acyclic (f \<sqinter> - q \<squnion> (f \<sqinter> q)\<^sup>T)
[PROOF STEP]
by (simp add: assms)


[STATEMENT]
lemma word_split_bl_eq:
  "(word_split c :: ('c::len word \<times> 'd::len word)) =
    (of_bl (take (LENGTH('a::len) - LENGTH('d::len)) (to_bl c)),
     of_bl (drop (LENGTH('a) - LENGTH('d)) (to_bl c)))"
  for c :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_split c = (of_bl (take (LENGTH('a) - LENGTH('d)) (to_bl c)), of_bl (drop (LENGTH('a) - LENGTH('d)) (to_bl c)))
[PROOF STEP]
apply (rule word_split_bl [THEN iffD1])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ?std1 = size c - size (of_bl (drop (LENGTH('a) - LENGTH('d)) (to_bl c)))
 2. of_bl (take (LENGTH('a) - LENGTH('d)) (to_bl c)) = of_bl (take ?std1 (to_bl c)) \<and> of_bl (drop (LENGTH('a) - LENGTH('d)) (to_bl c)) = of_bl (drop ?std1 (to_bl c))
[PROOF STEP]
apply (unfold word_size)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ?std1 = LENGTH('a) - LENGTH('d)
 2. of_bl (take (LENGTH('a) - LENGTH('d)) (to_bl c)) = of_bl (take ?std1 (to_bl c)) \<and> of_bl (drop (LENGTH('a) - LENGTH('d)) (to_bl c)) = of_bl (drop ?std1 (to_bl c))
[PROOF STEP]
apply (rule refl conjI)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma xor_numerals [simp]:
  \<open>1 XOR numeral (Num.Bit0 y) = numeral (Num.Bit1 y)\<close>
  \<open>1 XOR numeral (Num.Bit1 y) = numeral (Num.Bit0 y)\<close>
  \<open>numeral (Num.Bit0 x) XOR numeral (Num.Bit0 y) = 2 * (numeral x XOR numeral y)\<close>
  \<open>numeral (Num.Bit0 x) XOR numeral (Num.Bit1 y) = 1 + 2 * (numeral x XOR numeral y)\<close>
  \<open>numeral (Num.Bit0 x) XOR 1 = numeral (Num.Bit1 x)\<close>
  \<open>numeral (Num.Bit1 x) XOR numeral (Num.Bit0 y) = 1 + 2 * (numeral x XOR numeral y)\<close>
  \<open>numeral (Num.Bit1 x) XOR numeral (Num.Bit1 y) = 2 * (numeral x XOR numeral y)\<close>
  \<open>numeral (Num.Bit1 x) XOR 1 = numeral (Num.Bit0 x)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((1::'a) XOR numeral (num.Bit0 y) = numeral (num.Bit1 y) &&& (1::'a) XOR numeral (num.Bit1 y) = numeral (num.Bit0 y)) &&& numeral (num.Bit0 x) XOR numeral (num.Bit0 y) = (2::'a) * (numeral x XOR numeral y) &&& numeral (num.Bit0 x) XOR numeral (num.Bit1 y) = (1::'a) + (2::'a) * (numeral x XOR numeral y)) &&& (numeral (num.Bit0 x) XOR (1::'a) = numeral (num.Bit1 x) &&& numeral (num.Bit1 x) XOR numeral (num.Bit0 y) = (1::'a) + (2::'a) * (numeral x XOR numeral y)) &&& numeral (num.Bit1 x) XOR numeral (num.Bit1 y) = (2::'a) * (numeral x XOR numeral y) &&& numeral (num.Bit1 x) XOR (1::'a) = numeral (num.Bit0 x)
[PROOF STEP]
by (simp_all add: bit_eq_iff) (simp_all add: bit_0 bit_simps bit_Suc bit_numeral_rec split: nat.splits)


[STATEMENT]
lemma squanderFace_distr2: "inv g \<Longrightarrow> final g \<Longrightarrow> noExceptionals g (set V) \<Longrightarrow>
  separated g (set V) \<Longrightarrow> distinct V \<Longrightarrow> set V \<subseteq> set (vertices g) \<Longrightarrow>
     (\<Sum>\<^bsub>f \<in> [f\<leftarrow>faces g. \<exists>v \<in> set V. f \<in> set (facesAt g v)]\<^esub>
         \<d> |vertices f| )
   = (\<Sum>\<^bsub>v \<in> V\<^esub> ((tri g v) * \<d> 3
         + (quad g v) * \<d> 4))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; noExceptionals g (set V); separated g (set V); distinct V; set V \<subseteq> \<V> g\<rbrakk> \<Longrightarrow> (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; noExceptionals g (set V); separated g (set V); distinct V; set V \<subseteq> \<V> g\<rbrakk> \<Longrightarrow> (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
assume pl: "inv g"
[PROOF STATE]
proof (state)
this:
Invariants.inv g

goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; noExceptionals g (set V); separated g (set V); distinct V; set V \<subseteq> \<V> g\<rbrakk> \<Longrightarrow> (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
assume fin: "final g"
[PROOF STATE]
proof (state)
this:
final g

goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; noExceptionals g (set V); separated g (set V); distinct V; set V \<subseteq> \<V> g\<rbrakk> \<Longrightarrow> (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
assume ne: "noExceptionals g (set V)"
[PROOF STATE]
proof (state)
this:
noExceptionals g (set V)

goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; noExceptionals g (set V); separated g (set V); distinct V; set V \<subseteq> \<V> g\<rbrakk> \<Longrightarrow> (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
assume "separated g (set V)"  "distinct V" and V_subset: "set V \<subseteq> set (vertices g)"
[PROOF STATE]
proof (state)
this:
separated g (set V)
distinct V
set V \<subseteq> \<V> g

goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; noExceptionals g (set V); separated g (set V); distinct V; set V \<subseteq> \<V> g\<rbrakk> \<Longrightarrow> (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
with pl ne fin
[PROOF STATE]
proof (chain)
picking this:
Invariants.inv g
noExceptionals g (set V)
final g
separated g (set V)
distinct V
set V \<subseteq> \<V> g
[PROOF STEP]
have
    "(\<Sum>\<^bsub>f \<in> [f\<leftarrow>faces g. \<exists>v\<in>set V. f\<in>set (facesAt g v)]\<^esub> \<d> |vertices f| )
   = (\<Sum>\<^bsub>v \<in> V\<^esub> \<Sum>\<^bsub>f \<in> facesAt g v\<^esub> \<d> |vertices f| )"
[PROOF STATE]
proof (prove)
using this:
Invariants.inv g
noExceptionals g (set V)
final g
separated g (set V)
distinct V
set V \<subseteq> \<V> g

goal (1 subgoal):
 1. (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> \<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|)
[PROOF STEP]
by (simp add: separated_disj_Union2)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> \<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|)

goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; noExceptionals g (set V); separated g (set V); distinct V; set V \<subseteq> \<V> g\<rbrakk> \<Longrightarrow> (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> \<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|)

goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; noExceptionals g (set V); separated g (set V); distinct V; set V \<subseteq> \<V> g\<rbrakk> \<Longrightarrow> (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
have "\<And>v. v \<in> set V \<Longrightarrow>
    (\<Sum>\<^bsub>f \<in> facesAt g v\<^esub> \<d> |vertices f| )
  = (tri g v) * \<d> 3 + (quad g v) * \<d> 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
assume v1: "v \<in> set V"
[PROOF STATE]
proof (state)
this:
v \<in> set V

goal (1 subgoal):
 1. \<And>v. v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
with V_subset
[PROOF STATE]
proof (chain)
picking this:
set V \<subseteq> \<V> g
v \<in> set V
[PROOF STEP]
have v: "v \<in> set (vertices g)"
[PROOF STATE]
proof (prove)
using this:
set V \<subseteq> \<V> g
v \<in> set V

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

goal (1 subgoal):
 1. \<And>v. v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
with ne
[PROOF STATE]
proof (chain)
picking this:
noExceptionals g (set V)
v \<in> \<V> g
[PROOF STEP]
have d:
      "\<And>f. f \<in> set (facesAt g v) \<Longrightarrow>
      |vertices f| = 3 \<or> |vertices f| = 4"
[PROOF STATE]
proof (prove)
using this:
noExceptionals g (set V)
v \<in> \<V> g

goal (1 subgoal):
 1. \<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> set (facesAt g v); noExceptionals g (set V); v \<in> \<V> g\<rbrakk> \<Longrightarrow> triangle f \<or> |vertices f| = 4
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> set (facesAt g v); noExceptionals g (set V); v \<in> \<V> g\<rbrakk> \<Longrightarrow> triangle f \<or> |vertices f| = 4
[PROOF STEP]
assume f: "f \<in> set (facesAt g v)"
[PROOF STATE]
proof (state)
this:
f \<in> set (facesAt g v)

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> set (facesAt g v); noExceptionals g (set V); v \<in> \<V> g\<rbrakk> \<Longrightarrow> triangle f \<or> |vertices f| = 4
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> set (facesAt g v)
[PROOF STEP]
have ff: "f \<in> set (faces g)"
[PROOF STATE]
proof (prove)
using this:
f \<in> set (facesAt g v)

goal (1 subgoal):
 1. f \<in> \<F> g
[PROOF STEP]
by (rule minGraphProps5[OF inv_mgp[OF pl] v])
[PROOF STATE]
proof (state)
this:
f \<in> \<F> g

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> set (facesAt g v); noExceptionals g (set V); v \<in> \<V> g\<rbrakk> \<Longrightarrow> triangle f \<or> |vertices f| = 4
[PROOF STEP]
with ne f v1 pl fin v
[PROOF STATE]
proof (chain)
picking this:
noExceptionals g (set V)
f \<in> set (facesAt g v)
v \<in> set V
Invariants.inv g
final g
v \<in> \<V> g
f \<in> \<F> g
[PROOF STEP]
have "|vertices f| \<le> 4"
[PROOF STATE]
proof (prove)
using this:
noExceptionals g (set V)
f \<in> set (facesAt g v)
v \<in> set V
Invariants.inv g
final g
v \<in> \<V> g
f \<in> \<F> g

goal (1 subgoal):
 1. |vertices f| \<le> 4
[PROOF STEP]
by (auto simp add: noExceptionals_def not_exceptional)
[PROOF STATE]
proof (state)
this:
|vertices f| \<le> 4

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> set (facesAt g v); noExceptionals g (set V); v \<in> \<V> g\<rbrakk> \<Longrightarrow> triangle f \<or> |vertices f| = 4
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
|vertices f| \<le> 4

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> set (facesAt g v); noExceptionals g (set V); v \<in> \<V> g\<rbrakk> \<Longrightarrow> triangle f \<or> |vertices f| = 4
[PROOF STEP]
from pl ff
[PROOF STATE]
proof (chain)
picking this:
Invariants.inv g
f \<in> \<F> g
[PROOF STEP]
have "3 \<le> |vertices f|"
[PROOF STATE]
proof (prove)
using this:
Invariants.inv g
f \<in> \<F> g

goal (1 subgoal):
 1. 3 \<le> |vertices f|
[PROOF STEP]
by(rule planeN4)
[PROOF STATE]
proof (state)
this:
3 \<le> |vertices f|

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> set (facesAt g v); noExceptionals g (set V); v \<in> \<V> g\<rbrakk> \<Longrightarrow> triangle f \<or> |vertices f| = 4
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
|vertices f| \<le> 4
3 \<le> |vertices f|
[PROOF STEP]
show "?thesis f"
[PROOF STATE]
proof (prove)
using this:
|vertices f| \<le> 4
3 \<le> |vertices f|

goal (1 subgoal):
 1. triangle f \<or> |vertices f| = 4
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
triangle f \<or> |vertices f| = 4

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?f \<in> set (facesAt g v) \<Longrightarrow> triangle ?f \<or> |vertices ?f| = 4

goal (1 subgoal):
 1. \<And>v. v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
from d pl v
[PROOF STATE]
proof (chain)
picking this:
?f \<in> set (facesAt g v) \<Longrightarrow> triangle ?f \<or> |vertices ?f| = 4
Invariants.inv g
v \<in> \<V> g
[PROOF STEP]
have
      "(\<Sum>\<^bsub>f \<in> facesAt g v\<^esub> \<d> |vertices f| )
    = (\<Sum>\<^bsub>f\<in>[f \<leftarrow> facesAt g v. |vertices f| = 3]\<^esub> \<d> |vertices f| )
    + (\<Sum>\<^bsub>f\<in>[f \<leftarrow> facesAt g v. |vertices f| = 4]\<^esub> \<d> |vertices f| )"
[PROOF STATE]
proof (prove)
using this:
?f \<in> set (facesAt g v) \<Longrightarrow> triangle ?f \<or> |vertices ?f| = 4
Invariants.inv g
v \<in> \<V> g

goal (1 subgoal):
 1. (\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>f\<in>filter triangle (facesAt g v)\<^esub> \<d> |vertices f|) + (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. |vertices f| = 4) (facesAt g v)\<^esub> \<d> |vertices f|)
[PROOF STEP]
apply (rule_tac ListSum_disj_union)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> distinct (filter triangle (facesAt g v))
 2. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> distinct (filter (\<lambda>f. |vertices f| = 4) (facesAt g v))
 3. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> distinct (facesAt g v)
 4. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (facesAt g v) = set (filter triangle (facesAt g v)) \<union> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v))
 5. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (filter triangle (facesAt g v)) \<inter> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v)) = {}
[PROOF STEP]
apply (rule distinct_filter)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> distinct (facesAt g v)
 2. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> distinct (filter (\<lambda>f. |vertices f| = 4) (facesAt g v))
 3. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> distinct (facesAt g v)
 4. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (facesAt g v) = set (filter triangle (facesAt g v)) \<union> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v))
 5. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (filter triangle (facesAt g v)) \<inter> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v)) = {}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> distinct (filter (\<lambda>f. |vertices f| = 4) (facesAt g v))
 2. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> distinct (facesAt g v)
 3. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (facesAt g v) = set (filter triangle (facesAt g v)) \<union> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v))
 4. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (filter triangle (facesAt g v)) \<inter> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v)) = {}
[PROOF STEP]
apply (rule distinct_filter)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> distinct (facesAt g v)
 2. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> distinct (facesAt g v)
 3. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (facesAt g v) = set (filter triangle (facesAt g v)) \<union> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v))
 4. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (filter triangle (facesAt g v)) \<inter> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v)) = {}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> distinct (facesAt g v)
 2. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (facesAt g v) = set (filter triangle (facesAt g v)) \<union> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v))
 3. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (filter triangle (facesAt g v)) \<inter> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v)) = {}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (facesAt g v) = set (filter triangle (facesAt g v)) \<union> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v))
 2. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (filter triangle (facesAt g v)) \<inter> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v)) = {}
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>f. f \<in> set (facesAt g v) \<Longrightarrow> triangle f \<or> |vertices f| = 4; Invariants.inv g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (filter triangle (facesAt g v)) \<inter> set (filter (\<lambda>f. |vertices f| = 4) (facesAt g v)) = {}
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>f\<in>filter triangle (facesAt g v)\<^esub> \<d> |vertices f|) + (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. |vertices f| = 4) (facesAt g v)\<^esub> \<d> |vertices f|)

goal (1 subgoal):
 1. \<And>v. v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>f\<in>filter triangle (facesAt g v)\<^esub> \<d> |vertices f|) + (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. |vertices f| = 4) (facesAt g v)\<^esub> \<d> |vertices f|)

goal (1 subgoal):
 1. \<And>v. v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
have "\<dots> = tri g v * \<d> 3 + quad g v * \<d> 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^bsub>f\<in>filter triangle (facesAt g v)\<^esub> \<d> |vertices f|) + (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. |vertices f| = 4) (facesAt g v)\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>\<^bsub>f\<in>filter triangle (facesAt g v)\<^esub> \<d> |vertices f|) + (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. |vertices f| = 4) (facesAt g v)\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
from pl fin v
[PROOF STATE]
proof (chain)
picking this:
Invariants.inv g
final g
v \<in> \<V> g
[PROOF STEP]
have "\<And>A.[f \<leftarrow> facesAt g v. final f \<and> A f]
        = [f \<leftarrow> facesAt g v. A f]"
[PROOF STATE]
proof (prove)
using this:
Invariants.inv g
final g
v \<in> \<V> g

goal (1 subgoal):
 1. \<And>A. filter (\<lambda>f. final f \<and> A f) (facesAt g v) = filter A (facesAt g v)
[PROOF STEP]
by (rule_tac filter_eqI) (auto simp:plane_final_facesAt)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>f. final f \<and> ?A f) (facesAt g v) = filter ?A (facesAt g v)

goal (1 subgoal):
 1. (\<Sum>\<^bsub>f\<in>filter triangle (facesAt g v)\<^esub> \<d> |vertices f|) + (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. |vertices f| = 4) (facesAt g v)\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
with fin
[PROOF STATE]
proof (chain)
picking this:
final g
filter (\<lambda>f. final f \<and> ?A f) (facesAt g v) = filter ?A (facesAt g v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
final g
filter (\<lambda>f. final f \<and> ?A f) (facesAt g v) = filter ?A (facesAt g v)

goal (1 subgoal):
 1. (\<Sum>\<^bsub>f\<in>filter triangle (facesAt g v)\<^esub> \<d> |vertices f|) + (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. |vertices f| = 4) (facesAt g v)\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
by (auto simp add: tri_def quad_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^bsub>f\<in>filter triangle (facesAt g v)\<^esub> \<d> |vertices f|) + (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. |vertices f| = 4) (facesAt g v)\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^bsub>f\<in>filter triangle (facesAt g v)\<^esub> \<d> |vertices f|) + (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. |vertices f| = 4) (facesAt g v)\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4

goal (1 subgoal):
 1. \<And>v. v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
show "(\<Sum>\<^bsub>f \<in> facesAt g v\<^esub> \<d> |vertices f| ) = tri g v * \<d> 3 + quad g v * \<d> 4"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4

goal (1 subgoal):
 1. (\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = tri g v * \<d> 3 + quad g v * \<d> 4

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g ?v\<^esub> \<d> |vertices f|) = tri g ?v * \<d> 3 + quad g ?v * \<d> 4

goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; noExceptionals g (set V); separated g (set V); distinct V; set V \<subseteq> \<V> g\<rbrakk> \<Longrightarrow> (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g ?v\<^esub> \<d> |vertices f|) = tri g ?v * \<d> 3 + quad g ?v * \<d> 4
[PROOF STEP]
have "(\<Sum>\<^bsub>v \<in> V\<^esub> \<Sum>\<^bsub>f \<in> facesAt g v\<^esub> \<d> |vertices f| ) =
         (\<Sum>\<^bsub>v \<in> V\<^esub> (tri g v * \<d> 3 + quad g v * \<d> 4))"
[PROOF STATE]
proof (prove)
using this:
?v \<in> set V \<Longrightarrow> (\<Sum>\<^bsub>f\<in>facesAt g ?v\<^esub> \<d> |vertices f|) = tri g ?v * \<d> 3 + quad g ?v * \<d> 4

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> \<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
by (rule ListSum_eq)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^bsub>v\<in>V\<^esub> \<Sum>\<^bsub>f\<in>facesAt g v\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)

goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; noExceptionals g (set V); separated g (set V); distinct V; set V \<subseteq> \<V> g\<rbrakk> \<Longrightarrow> (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)

goal (1 subgoal):
 1. (\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^bsub>f\<in>filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v)) (faces g)\<^esub> \<d> |vertices f|) = (\<Sum>\<^bsub>v\<in>V\<^esub> tri g v * \<d> 3 + quad g v * \<d> 4)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_substitution_strong:
  fixes f :: "real \<Rightarrow> 'a::euclidean_space" and g :: "real \<Rightarrow> real"
  assumes s: "finite s" and le: "a \<le> b" "g a \<le> g b"
    and subset: "g ` {a..b} \<subseteq> {c..d}"
    and f [continuous_intros]: "continuous_on {c..d} f"
    and g [continuous_intros]: "continuous_on {a..b} g"
    and deriv [derivative_intros]:
    "\<And>x. x \<in> {a..b} - s \<Longrightarrow> (g has_field_derivative g' x) (at x within {a..b})"
  shows "((\<lambda>x. g' x *\<^sub>R f (g x)) has_integral (integral {g a..g b} f)) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. g' x *\<^sub>R f (g x)) has_integral integral {g a..g b} f) {a..b}
[PROOF STEP]
using has_integral_substitution_general[OF s le(1) subset f g deriv] le(2)
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> {a..b} - s \<Longrightarrow> x \<in> {a..b} - s) \<Longrightarrow> ((\<lambda>x. g' x *\<^sub>R f (g x)) has_integral integral {g a..g b} f - integral {g b..g a} f) {a..b}
g a \<le> g b

goal (1 subgoal):
 1. ((\<lambda>x. g' x *\<^sub>R f (g x)) has_integral integral {g a..g b} f) {a..b}
[PROOF STEP]
by (cases "g a = g b") auto