[STATEMENT]
lemma triangle_num_eq_0_iff [simp]: "triangle_num n = 0 \<longleftrightarrow> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (triangle_num n = 0) = (n = 0)
[PROOF STEP]
using triangle_num_ge[of n]
[PROOF STATE]
proof (prove)
using this:
n \<le> triangle_num n

goal (1 subgoal):
 1. (triangle_num n = 0) = (n = 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma floor_divide_of_nat_eq: "\<lfloor>of_nat m / of_nat n\<rfloor> = of_nat (m div n)"
  for m n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
 2. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
 2. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
have *: "\<lfloor>of_nat (m mod n) / of_nat n :: 'a\<rfloor> = 0"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. \<lfloor>of_nat (m mod n) / of_nat n\<rfloor> = 0
[PROOF STEP]
by (auto intro: floor_unique)
[PROOF STATE]
proof (state)
this:
\<lfloor>of_nat (m mod n) / of_nat n\<rfloor> = 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
have "(of_nat m :: 'a) = of_nat (m div n * n + m mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat m = of_nat (m div n * n + m mod n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_nat m = of_nat (m div n * n + m mod n)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat m = of_nat (m div n * n + m mod n)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
have "\<dots> = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (m div n * n + m mod n) = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. of_nat (m div n * n + m mod n) = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n
[PROOF STEP]
by (simp only: of_nat_add) (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
of_nat (m div n * n + m mod n) = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_nat m = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n
[PROOF STEP]
have "(of_nat m / of_nat n :: 'a) = \<dots> / of_nat n"
[PROOF STATE]
proof (prove)
using this:
of_nat m = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n

goal (1 subgoal):
 1. of_nat m / of_nat n = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n / of_nat n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_nat m / of_nat n = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n / of_nat n

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
of_nat m / of_nat n = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n / of_nat n
[PROOF STEP]
have "(of_nat m / of_nat n :: 'a) = of_nat (m div n) + of_nat (m mod n) / of_nat n"
[PROOF STATE]
proof (prove)
using this:
of_nat m / of_nat n = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n / of_nat n

goal (1 subgoal):
 1. of_nat m / of_nat n = of_nat (m div n) + of_nat (m mod n) / of_nat n
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
of_nat m / of_nat n = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n / of_nat n
n \<noteq> 0

goal (1 subgoal):
 1. of_nat m / of_nat n = of_nat (m div n) + of_nat (m mod n) / of_nat n
[PROOF STEP]
by (simp only:) simp
[PROOF STATE]
proof (state)
this:
of_nat m / of_nat n = of_nat (m div n) + of_nat (m mod n) / of_nat n

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
of_nat m / of_nat n = of_nat (m div n) + of_nat (m mod n) / of_nat n
[PROOF STEP]
have "\<lfloor>of_nat m / of_nat n :: 'a\<rfloor> = \<lfloor>of_nat (m div n) + of_nat (m mod n) / of_nat n :: 'a\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
of_nat m / of_nat n = of_nat (m div n) + of_nat (m mod n) / of_nat n

goal (1 subgoal):
 1. \<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m div n) + of_nat (m mod n) / of_nat n\<rfloor>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m div n) + of_nat (m mod n) / of_nat n\<rfloor>

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m div n) + of_nat (m mod n) / of_nat n\<rfloor>
[PROOF STEP]
have "\<lfloor>of_nat m / of_nat n :: 'a\<rfloor> = \<lfloor>of_nat (m mod n) / of_nat n + of_nat (m div n) :: 'a\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
\<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m div n) + of_nat (m mod n) / of_nat n\<rfloor>

goal (1 subgoal):
 1. \<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m mod n) / of_nat n + of_nat (m div n)\<rfloor>
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
\<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m mod n) / of_nat n + of_nat (m div n)\<rfloor>

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m mod n) / of_nat n + of_nat (m div n)\<rfloor>

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
have "(of_nat (m div n) :: 'a) = of_int (of_nat (m div n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (m div n) = of_int (int (m div n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_nat (m div n) = of_int (int (m div n))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m mod n) / of_nat n + of_nat (m div n)\<rfloor>
of_nat (m div n) = of_int (int (m div n))
[PROOF STEP]
have "\<lfloor>of_nat m / of_nat n :: 'a\<rfloor> =
      \<lfloor>of_nat (m mod n) / of_nat n :: 'a\<rfloor> + of_nat (m div n)"
[PROOF STATE]
proof (prove)
using this:
\<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m mod n) / of_nat n + of_nat (m div n)\<rfloor>
of_nat (m div n) = of_int (int (m div n))

goal (1 subgoal):
 1. \<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m mod n) / of_nat n\<rfloor> + int (m div n)
[PROOF STEP]
by (simp only: floor_add_int)
[PROOF STATE]
proof (state)
this:
\<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m mod n) / of_nat n\<rfloor> + int (m div n)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
\<lfloor>of_nat (m mod n) / of_nat n\<rfloor> = 0
\<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m mod n) / of_nat n\<rfloor> + int (m div n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lfloor>of_nat (m mod n) / of_nat n\<rfloor> = 0
\<lfloor>of_nat m / of_nat n\<rfloor> = \<lfloor>of_nat (m mod n) / of_nat n\<rfloor> + int (m div n)

goal (1 subgoal):
 1. \<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lfloor>of_nat m / of_nat n\<rfloor> = int (m div n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma F_inj_composition_permutation:
  assumes phi: "\<phi> permutes {0..<n}"
  and g: "g \<in> F_inj"
  shows "g \<circ> \<phi> \<in> F_inj"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<circ> \<phi> \<in> F_inj
[PROOF STEP]
proof (rule F_injI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. g \<circ> \<phi> \<in> {0..<n} \<rightarrow> {0..<m}
 2. \<forall>i. i \<notin> {0..<n} \<longrightarrow> (g \<circ> \<phi>) i = i
 3. inj_on (g \<circ> \<phi>) {0..<n}
[PROOF STEP]
show "g \<circ> \<phi> \<in> {0..<n} \<rightarrow> {0..<m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<circ> \<phi> \<in> {0..<n} \<rightarrow> {0..<m}
[PROOF STEP]
using g
[PROOF STATE]
proof (prove)
using this:
g \<in> F_inj

goal (1 subgoal):
 1. g \<circ> \<phi> \<in> {0..<n} \<rightarrow> {0..<m}
[PROOF STEP]
unfolding permutes_def F_inj_def
[PROOF STATE]
proof (prove)
using this:
g \<in> {f \<in> {0..<n} \<rightarrow> {0..<m}. (\<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i) \<and> inj_on f {0..<n}}

goal (1 subgoal):
 1. g \<circ> \<phi> \<in> {0..<n} \<rightarrow> {0..<m}
[PROOF STEP]
by (simp add: Pi_iff phi)
[PROOF STATE]
proof (state)
this:
g \<circ> \<phi> \<in> {0..<n} \<rightarrow> {0..<m}

goal (2 subgoals):
 1. \<forall>i. i \<notin> {0..<n} \<longrightarrow> (g \<circ> \<phi>) i = i
 2. inj_on (g \<circ> \<phi>) {0..<n}
[PROOF STEP]
show "\<forall>i. i \<notin> {0..<n} \<longrightarrow> (g \<circ> \<phi>) i = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. i \<notin> {0..<n} \<longrightarrow> (g \<circ> \<phi>) i = i
[PROOF STEP]
using g phi
[PROOF STATE]
proof (prove)
using this:
g \<in> F_inj
\<phi> permutes {0..<n}

goal (1 subgoal):
 1. \<forall>i. i \<notin> {0..<n} \<longrightarrow> (g \<circ> \<phi>) i = i
[PROOF STEP]
unfolding permutes_def F_inj_def
[PROOF STATE]
proof (prove)
using this:
g \<in> {f \<in> {0..<n} \<rightarrow> {0..<m}. (\<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i) \<and> inj_on f {0..<n}}
(\<forall>x. x \<notin> {0..<n} \<longrightarrow> \<phi> x = x) \<and> (\<forall>y. \<exists>!x. \<phi> x = y)

goal (1 subgoal):
 1. \<forall>i. i \<notin> {0..<n} \<longrightarrow> (g \<circ> \<phi>) i = i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>i. i \<notin> {0..<n} \<longrightarrow> (g \<circ> \<phi>) i = i

goal (1 subgoal):
 1. inj_on (g \<circ> \<phi>) {0..<n}
[PROOF STEP]
show "inj_on (g \<circ> \<phi>) {0..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (g \<circ> \<phi>) {0..<n}
[PROOF STEP]
by (rule comp_inj_on, insert g permutes_inj_on[OF phi] permutes_image[OF phi])
       (auto simp add: F_inj_def)
[PROOF STATE]
proof (state)
this:
inj_on (g \<circ> \<phi>) {0..<n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pairwise_disjoint_connected_components_of:
   "pairwise disjnt (connected_components_of X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjoint (connected_components_of X)
[PROOF STEP]
unfolding connected_components_of_def pairwise_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>connected_component_of_set X ` topspace X. \<forall>y\<in>connected_component_of_set X ` topspace X. x \<noteq> y \<longrightarrow> disjnt x y
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa y xb. \<lbrakk>xa \<in> topspace X; xb \<in> topspace X; connected_component_of_set X xa \<noteq> connected_component_of_set X xb\<rbrakk> \<Longrightarrow> disjnt (connected_component_of_set X xa) (connected_component_of_set X xb)
[PROOF STEP]
by (metis connected_component_of_disjoint connected_component_of_equiv)


[STATEMENT]
lemma subcocycle_avg_ereal_birkhoff:
  assumes "integrable M u"
  shows "subcocycle_avg_ereal (birkhoff_sum u) = (\<integral>x. u x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcocycle_avg_ereal (birkhoff_sum u) = ereal (integral\<^sup>L M u)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subcocycle_avg_ereal (birkhoff_sum u) = ereal (integral\<^sup>L M u)
[PROOF STEP]
have *: "ereal (\<integral>x. (birkhoff_sum u n x) / n \<partial>M) = (\<integral>x. u x \<partial>M)" if "n>0" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (LINT x|M. birkhoff_sum u n x / real n) = ereal (integral\<^sup>L M u)
[PROOF STEP]
using birkhoff_sum_integral(2)[OF assms] that
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>L M (birkhoff_sum u ?n) = real ?n *\<^sub>R integral\<^sup>L M u
0 < n

goal (1 subgoal):
 1. ereal (LINT x|M. birkhoff_sum u n x / real n) = ereal (integral\<^sup>L M u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < ?n3 \<Longrightarrow> ereal (LINT x|M. birkhoff_sum u ?n3 x / real ?n3) = ereal (integral\<^sup>L M u)

goal (1 subgoal):
 1. subcocycle_avg_ereal (birkhoff_sum u) = ereal (integral\<^sup>L M u)
[PROOF STEP]
have "(\<lambda>n. ereal (\<integral>x. (birkhoff_sum u n x) / n \<partial>M)) \<longlonglongrightarrow> (\<integral>x. u x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> ereal (integral\<^sup>L M u)
[PROOF STEP]
by (subst lim_explicit, metis * less_le_trans zero_less_one)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> ereal (integral\<^sup>L M u)

goal (1 subgoal):
 1. subcocycle_avg_ereal (birkhoff_sum u) = ereal (integral\<^sup>L M u)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> ereal (integral\<^sup>L M u)

goal (1 subgoal):
 1. subcocycle_avg_ereal (birkhoff_sum u) = ereal (integral\<^sup>L M u)
[PROOF STEP]
have "(\<lambda>n. ereal (\<integral>x. (birkhoff_sum u n x) / n \<partial>M)) \<longlonglongrightarrow> subcocycle_avg_ereal (birkhoff_sum u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> subcocycle_avg_ereal (birkhoff_sum u)
[PROOF STEP]
using subcocycle_int_tendsto_avg_ereal[OF subcocycle_birkhoff[OF assms]]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ereal (LINT xa|M. birkhoff_sum u x xa / real x)) \<longlonglongrightarrow> subcocycle_avg_ereal (birkhoff_sum u)

goal (1 subgoal):
 1. (\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> subcocycle_avg_ereal (birkhoff_sum u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> subcocycle_avg_ereal (birkhoff_sum u)

goal (1 subgoal):
 1. subcocycle_avg_ereal (birkhoff_sum u) = ereal (integral\<^sup>L M u)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> ereal (integral\<^sup>L M u)
(\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> subcocycle_avg_ereal (birkhoff_sum u)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> ereal (integral\<^sup>L M u)
(\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> subcocycle_avg_ereal (birkhoff_sum u)

goal (1 subgoal):
 1. subcocycle_avg_ereal (birkhoff_sum u) = ereal (integral\<^sup>L M u)
[PROOF STEP]
using LIMSEQ_unique
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> ereal (integral\<^sup>L M u)
(\<lambda>n. ereal (LINT x|M. birkhoff_sum u n x / real n)) \<longlonglongrightarrow> subcocycle_avg_ereal (birkhoff_sum u)
\<lbrakk>?X \<longlonglongrightarrow> ?a; ?X \<longlonglongrightarrow> ?b\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. subcocycle_avg_ereal (birkhoff_sum u) = ereal (integral\<^sup>L M u)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
subcocycle_avg_ereal (birkhoff_sum u) = ereal (integral\<^sup>L M u)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma b_least2_less_impl_eq: "b_least2 f x y < y \<Longrightarrow> (b_least2 f x y) = (Least (%z. (f x z) \<noteq> 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b_least2 f x y < y \<Longrightarrow> b_least2 f x y = (LEAST z. f x z \<noteq> 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b_least2 f x y < y \<Longrightarrow> b_least2 f x y = (LEAST z. f x z \<noteq> 0)
[PROOF STEP]
assume A1: "b_least2 f x y < y" (is "?b < _")
[PROOF STATE]
proof (state)
this:
b_least2 f x y < y

goal (1 subgoal):
 1. b_least2 f x y < y \<Longrightarrow> b_least2 f x y = (LEAST z. f x z \<noteq> 0)
[PROOF STEP]
let ?B = "(Least (%z. (f x z) \<noteq> 0))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b_least2 f x y < y \<Longrightarrow> b_least2 f x y = (LEAST z. f x z \<noteq> 0)
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
b_least2 f x y < y
[PROOF STEP]
have S1: "f x ?b \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
b_least2 f x y < y

goal (1 subgoal):
 1. f x (b_least2 f x y) \<noteq> 0
[PROOF STEP]
by (rule b_least2_less_impl_nz)
[PROOF STATE]
proof (state)
this:
f x (b_least2 f x y) \<noteq> 0

goal (1 subgoal):
 1. b_least2 f x y < y \<Longrightarrow> b_least2 f x y = (LEAST z. f x z \<noteq> 0)
[PROOF STEP]
from S1
[PROOF STATE]
proof (chain)
picking this:
f x (b_least2 f x y) \<noteq> 0
[PROOF STEP]
have S2: "?B  \<le> ?b"
[PROOF STATE]
proof (prove)
using this:
f x (b_least2 f x y) \<noteq> 0

goal (1 subgoal):
 1. (LEAST z. f x z \<noteq> 0) \<le> b_least2 f x y
[PROOF STEP]
by (rule Least_le)
[PROOF STATE]
proof (state)
this:
(LEAST z. f x z \<noteq> 0) \<le> b_least2 f x y

goal (1 subgoal):
 1. b_least2 f x y < y \<Longrightarrow> b_least2 f x y = (LEAST z. f x z \<noteq> 0)
[PROOF STEP]
from S1
[PROOF STATE]
proof (chain)
picking this:
f x (b_least2 f x y) \<noteq> 0
[PROOF STEP]
have S3: "f x ?B \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
f x (b_least2 f x y) \<noteq> 0

goal (1 subgoal):
 1. f x (LEAST z. f x z \<noteq> 0) \<noteq> 0
[PROOF STEP]
by (rule LeastI)
[PROOF STATE]
proof (state)
this:
f x (LEAST z. f x z \<noteq> 0) \<noteq> 0

goal (1 subgoal):
 1. b_least2 f x y < y \<Longrightarrow> b_least2 f x y = (LEAST z. f x z \<noteq> 0)
[PROOF STEP]
from S3
[PROOF STATE]
proof (chain)
picking this:
f x (LEAST z. f x z \<noteq> 0) \<noteq> 0
[PROOF STEP]
have S4: "?b \<le> ?B"
[PROOF STATE]
proof (prove)
using this:
f x (LEAST z. f x z \<noteq> 0) \<noteq> 0

goal (1 subgoal):
 1. b_least2 f x y \<le> (LEAST z. f x z \<noteq> 0)
[PROOF STEP]
by (rule nz_impl_b_least2_le)
[PROOF STATE]
proof (state)
this:
b_least2 f x y \<le> (LEAST z. f x z \<noteq> 0)

goal (1 subgoal):
 1. b_least2 f x y < y \<Longrightarrow> b_least2 f x y = (LEAST z. f x z \<noteq> 0)
[PROOF STEP]
from S2 S4
[PROOF STATE]
proof (chain)
picking this:
(LEAST z. f x z \<noteq> 0) \<le> b_least2 f x y
b_least2 f x y \<le> (LEAST z. f x z \<noteq> 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(LEAST z. f x z \<noteq> 0) \<le> b_least2 f x y
b_least2 f x y \<le> (LEAST z. f x z \<noteq> 0)

goal (1 subgoal):
 1. b_least2 f x y = (LEAST z. f x z \<noteq> 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b_least2 f x y = (LEAST z. f x z \<noteq> 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_le_linf_norm:
  fixes f :: "'a :: ring_1_abs_real_line poly"
  shows "\<bar>coeff f i\<bar> \<le> \<parallel>f\<parallel>\<^sub>\<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>coeff f i\<bar> \<le> \<parallel>f\<parallel>\<^sub>\<infinity>
[PROOF STEP]
using vec_index_le_linf_norm[of "degree f - i" "vec_of_poly f"]
[PROOF STATE]
proof (prove)
using this:
degree f - i < dim_vec (vec_of_poly f) \<Longrightarrow> \<bar>vec_of_poly f $ (degree f - i)\<bar> \<le> \<parallel>vec_of_poly f\<parallel>\<^sub>\<infinity>

goal (1 subgoal):
 1. \<bar>coeff f i\<bar> \<le> \<parallel>f\<parallel>\<^sub>\<infinity>
[PROOF STEP]
by (cases "i \<le> degree f", auto simp: coeff_eq_0)


[STATEMENT]
lemma signs_smash_property_set:
  fixes signs1 signs2 :: "'a list list"
  fixes a b:: "nat"
  shows "\<forall> (elem :: 'a list). (elem \<in> (set (signs_smash signs1 signs2)) \<longrightarrow>
    (\<exists> (elem1::'a list). \<exists> (elem2::'a list).
      (elem1 \<in> set(signs1) \<and> elem2 \<in> set(signs2) \<and> elem = (elem1@elem2))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>elem. elem \<in> set (signs_smash signs1 signs2) \<longrightarrow> (\<exists>elem1 elem2. elem1 \<in> set signs1 \<and> elem2 \<in> set signs2 \<and> elem = elem1 @ elem2)
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>elem. elem \<in> set (signs_smash signs1 signs2) \<Longrightarrow> \<exists>elem1. elem1 \<in> set signs1 \<and> (\<exists>elem2. elem2 \<in> set signs2 \<and> elem = elem1 @ elem2)
[PROOF STEP]
fix elem
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>elem. elem \<in> set (signs_smash signs1 signs2) \<Longrightarrow> \<exists>elem1. elem1 \<in> set signs1 \<and> (\<exists>elem2. elem2 \<in> set signs2 \<and> elem = elem1 @ elem2)
[PROOF STEP]
assume assum: "elem \<in> set (signs_smash signs1 signs2)"
[PROOF STATE]
proof (state)
this:
elem \<in> set (signs_smash signs1 signs2)

goal (1 subgoal):
 1. \<And>elem. elem \<in> set (signs_smash signs1 signs2) \<Longrightarrow> \<exists>elem1. elem1 \<in> set signs1 \<and> (\<exists>elem2. elem2 \<in> set signs2 \<and> elem = elem1 @ elem2)
[PROOF STEP]
show "\<exists>elem1. elem1 \<in> set signs1 \<and> (\<exists>elem2. elem2 \<in> set signs2 \<and> elem = elem1 @ elem2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>elem1. elem1 \<in> set signs1 \<and> (\<exists>elem2. elem2 \<in> set signs2 \<and> elem = elem1 @ elem2)
[PROOF STEP]
using assum
[PROOF STATE]
proof (prove)
using this:
elem \<in> set (signs_smash signs1 signs2)

goal (1 subgoal):
 1. \<exists>elem1. elem1 \<in> set signs1 \<and> (\<exists>elem2. elem2 \<in> set signs2 \<and> elem = elem1 @ elem2)
[PROOF STEP]
unfolding signs_smash_def
[PROOF STATE]
proof (prove)
using this:
elem \<in> set (concat (map (\<lambda>l1. map ((@) l1) signs2) signs1))

goal (1 subgoal):
 1. \<exists>elem1. elem1 \<in> set signs1 \<and> (\<exists>elem2. elem2 \<in> set signs2 \<and> elem = elem1 @ elem2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>elem1. elem1 \<in> set signs1 \<and> (\<exists>elem2. elem2 \<in> set signs2 \<and> elem = elem1 @ elem2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measure_of_eq:
  assumes closed: "A \<subseteq> Pow \<Omega>" and eq: "(\<And>a. a \<in> sigma_sets \<Omega> A \<Longrightarrow> \<mu> a = \<mu>' a)"
  shows "measure_of \<Omega> A \<mu> = measure_of \<Omega> A \<mu>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_of \<Omega> A \<mu> = measure_of \<Omega> A \<mu>'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. measure_of \<Omega> A \<mu> = measure_of \<Omega> A \<mu>'
[PROOF STEP]
have "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> Pow \<Omega>
?a \<in> sigma_sets \<Omega> A \<Longrightarrow> \<mu> ?a = \<mu>' ?a

goal (1 subgoal):
 1. measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>'
[PROOF STEP]
by (rule measure_space_eq)
[PROOF STATE]
proof (state)
this:
measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>'

goal (1 subgoal):
 1. measure_of \<Omega> A \<mu> = measure_of \<Omega> A \<mu>'
[PROOF STEP]
with eq
[PROOF STATE]
proof (chain)
picking this:
?a \<in> sigma_sets \<Omega> A \<Longrightarrow> \<mu> ?a = \<mu>' ?a
measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?a \<in> sigma_sets \<Omega> A \<Longrightarrow> \<mu> ?a = \<mu>' ?a
measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>'

goal (1 subgoal):
 1. measure_of \<Omega> A \<mu> = measure_of \<Omega> A \<mu>'
[PROOF STEP]
by (auto simp add: measure_of_def intro!: arg_cong[where f=Abs_measure])
[PROOF STATE]
proof (state)
this:
measure_of \<Omega> A \<mu> = measure_of \<Omega> A \<mu>'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_of_nat [simp]: "\<lceil>of_nat n\<rceil> = int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>of_nat n\<rceil> = int n
[PROOF STEP]
using ceiling_of_int [of "of_nat n"]
[PROOF STATE]
proof (prove)
using this:
\<lceil>of_int (int n)\<rceil> = int n

goal (1 subgoal):
 1. \<lceil>of_nat n\<rceil> = int n
[PROOF STEP]
by simp


[STATEMENT]
lemma is_weak_ranking_append:
  "is_weak_ranking (xs @ ys) \<longleftrightarrow>
      is_weak_ranking xs \<and> is_weak_ranking ys \<and>
      (set xs \<inter> set ys = {} \<and> \<Union>(set xs) \<inter> \<Union>(set ys) = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_weak_ranking (xs @ ys) = (is_weak_ranking xs \<and> is_weak_ranking ys \<and> set xs \<inter> set ys = {} \<and> \<Union> (set xs) \<inter> \<Union> (set ys) = {})
[PROOF STEP]
by (simp only: is_weak_ranking_iff)
     (auto dest: disjointD disjoint_unionD1 disjoint_unionD2 intro: disjoint_union)


[STATEMENT]
lemma nodes_empty_iff_empty[simp]:
  "nodes G = {} \<longleftrightarrow> G=graph {} {}"
  "{} = nodes G \<longleftrightarrow> G=graph_empty"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nodes G = {}) = (G = graph {} {}) &&& ({} = nodes G) = (G = graph_empty)
[PROOF STEP]
using edges_subset
[PROOF STATE]
proof (prove)
using this:
edges ?g \<subseteq> nodes ?g \<times> nodes ?g

goal (1 subgoal):
 1. (nodes G = {}) = (G = graph {} {}) &&& ({} = nodes G) = (G = graph_empty)
[PROOF STEP]
by (auto simp: graph_eq_iff)


[STATEMENT]
lemma emptyset_part_emptyset1:
  shows "{} partitions {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {} partitions {}
[PROOF STEP]
unfolding is_partition_of_def is_non_overlapping_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {} = {} \<and> (\<forall>X\<in>{}. \<forall>Y\<in>{}. (X \<inter> Y \<noteq> {}) = (X = Y))
[PROOF STEP]
by fast


[STATEMENT]
lemma padic_add_comm:
  assumes "prime p"
  shows " \<And>x y.
          x \<in> carrier (padic_int p) \<Longrightarrow>
          y \<in> carrier (padic_int p) \<Longrightarrow>
          x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
[PROOF STEP]
assume Ax: "x \<in> carrier (padic_int p)"
[PROOF STATE]
proof (state)
this:
x \<in> carrier (padic_int p)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
[PROOF STEP]
assume Ay:"y \<in> carrier (padic_int p)"
[PROOF STATE]
proof (state)
this:
y \<in> carrier (padic_int p)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (padic_int p); y \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
[PROOF STEP]
show "x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. (x \<oplus>\<^bsub>padic_int p\<^esub> y) xa = (y \<oplus>\<^bsub>padic_int p\<^esub> x) xa
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. (x \<oplus>\<^bsub>padic_int p\<^esub> y) xa = (y \<oplus>\<^bsub>padic_int p\<^esub> x) xa
[PROOF STEP]
show "(x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
proof(cases "n=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
 2. n \<noteq> 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
 2. n \<noteq> 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
by (metis Ax Ay assms padic_add_def padic_set_zero_res padic_int_simps(3,5))
[PROOF STATE]
proof (state)
this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
have LHS0: "(x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (x n) \<oplus>\<^bsub>residue_ring (p^n)\<^esub> (y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = x n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> y n
[PROOF STEP]
by (simp add:  padic_int_simps padic_add_res)
[PROOF STATE]
proof (state)
this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) n = x n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> y n

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
have RHS0: "(y \<oplus>\<^bsub>padic_int p\<^esub> x) n = (y n) \<oplus>\<^bsub>residue_ring (p^n)\<^esub> (x n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<oplus>\<^bsub>padic_int p\<^esub> x) n = y n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> x n
[PROOF STEP]
by (simp add:  padic_int_simps padic_add_res)
[PROOF STATE]
proof (state)
this:
(y \<oplus>\<^bsub>padic_int p\<^esub> x) n = y n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> x n

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
have Ex: "(x n) \<in> carrier (residue_ring (p^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x n \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
using Ax padic_set_res_closed  padic_int_simps
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (padic_int p)
?f \<in> padic_set ?p \<Longrightarrow> ?f ?m \<in> carrier (residue_ring (?p ^ ?m))
\<one>\<^bsub>padic_int ?p\<^esub> = padic_one ?p
\<zero>\<^bsub>padic_int ?p\<^esub> = padic_zero ?p
(\<oplus>\<^bsub>padic_int ?p\<^esub>) = padic_add ?p
(\<otimes>\<^bsub>padic_int ?p\<^esub>) = padic_mult ?p
carrier (padic_int ?p) = padic_set ?p

goal (1 subgoal):
 1. x n \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x n \<in> carrier (residue_ring (p ^ n))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
have Ey: "(y n) \<in> carrier (residue_ring (p^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y n \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
using Ay padic_set_res_closed  padic_int_simps
[PROOF STATE]
proof (prove)
using this:
y \<in> carrier (padic_int p)
?f \<in> padic_set ?p \<Longrightarrow> ?f ?m \<in> carrier (residue_ring (?p ^ ?m))
\<one>\<^bsub>padic_int ?p\<^esub> = padic_one ?p
\<zero>\<^bsub>padic_int ?p\<^esub> = padic_zero ?p
(\<oplus>\<^bsub>padic_int ?p\<^esub>) = padic_add ?p
(\<otimes>\<^bsub>padic_int ?p\<^esub>) = padic_mult ?p
carrier (padic_int ?p) = padic_set ?p

goal (1 subgoal):
 1. y n \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y n \<in> carrier (residue_ring (p ^ n))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
have LHS1: "(x \<oplus>\<^bsub>padic_int p\<^esub> y) n = ((x n) +(y n)) mod (p^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (x n + y n) mod p ^ n
[PROOF STEP]
using LHS0 residue_ring_def
[PROOF STATE]
proof (prove)
using this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) n = x n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> y n
residue_ring ?m = \<lparr>carrier = {0..?m - 1}, monoid.mult = \<lambda>x y. x * y mod ?m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod ?m\<rparr>

goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (x n + y n) mod p ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (x n + y n) mod p ^ n

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
have RHS1: "(y \<oplus>\<^bsub>padic_int p\<^esub> x) n = ((y n) +(x n)) mod (p^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<oplus>\<^bsub>padic_int p\<^esub> x) n = (y n + x n) mod p ^ n
[PROOF STEP]
using RHS0 residue_ring_def
[PROOF STATE]
proof (prove)
using this:
(y \<oplus>\<^bsub>padic_int p\<^esub> x) n = y n \<oplus>\<^bsub>residue_ring (p ^ n)\<^esub> x n
residue_ring ?m = \<lparr>carrier = {0..?m - 1}, monoid.mult = \<lambda>x y. x * y mod ?m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod ?m\<rparr>

goal (1 subgoal):
 1. (y \<oplus>\<^bsub>padic_int p\<^esub> x) n = (y n + x n) mod p ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(y \<oplus>\<^bsub>padic_int p\<^esub> x) n = (y n + x n) mod p ^ n

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(y \<oplus>\<^bsub>padic_int p\<^esub> x) n = (y n + x n) mod p ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(y \<oplus>\<^bsub>padic_int p\<^esub> x) n = (y n + x n) mod p ^ n

goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
using LHS1 RHS1
[PROOF STATE]
proof (prove)
using this:
(y \<oplus>\<^bsub>padic_int p\<^esub> x) n = (y n + x n) mod p ^ n
(x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (x n + y n) mod p ^ n
(y \<oplus>\<^bsub>padic_int p\<^esub> x) n = (y n + x n) mod p ^ n

goal (1 subgoal):
 1. (x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(x \<oplus>\<^bsub>padic_int p\<^esub> y) n = (y \<oplus>\<^bsub>padic_int p\<^esub> x) n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<oplus>\<^bsub>padic_int p\<^esub> y = y \<oplus>\<^bsub>padic_int p\<^esub> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subst_exi_num[simp]:
  assumes "\<phi> \<in> fmla" "x \<in> var" "y \<in> var" "n \<in> num"
  shows "x \<noteq> y \<Longrightarrow> subst (exi x \<phi>) n y = exi x (subst \<phi> n y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<Longrightarrow> subst (exi x \<phi>) n y = exi x (subst \<phi> n y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> fmla
x \<in> var
y \<in> var
n \<in> num

goal (1 subgoal):
 1. x \<noteq> y \<Longrightarrow> subst (exi x \<phi>) n y = exi x (subst \<phi> n y)
[PROOF STEP]
by simp


[STATEMENT]
lemma double_in_nonpos_Ints_imp:
  assumes "2 * (z :: 'a :: field_char_0) \<in> \<int>\<^sub>\<le>\<^sub>0"
  shows   "z \<in> \<int>\<^sub>\<le>\<^sub>0 \<or> z + 1/2 \<in> \<int>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> \<int>\<^sub>\<le>\<^sub>0 \<or> z + (1::'a) / (2::'a) \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<in> \<int>\<^sub>\<le>\<^sub>0 \<or> z + (1::'a) / (2::'a) \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
(2::'a) * z \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
obtain k where k: "2 * z = - of_nat k"
[PROOF STATE]
proof (prove)
using this:
(2::'a) * z \<in> \<int>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. (\<And>k. (2::'a) * z = - of_nat k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim nonpos_Ints_cases')
[PROOF STATE]
proof (state)
this:
(2::'a) * z = - of_nat k

goal (1 subgoal):
 1. z \<in> \<int>\<^sub>\<le>\<^sub>0 \<or> z + (1::'a) / (2::'a) \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(2::'a) * z = - of_nat k

goal (1 subgoal):
 1. z \<in> \<int>\<^sub>\<le>\<^sub>0 \<or> z + (1::'a) / (2::'a) \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (cases "even k") (auto elim!: evenE oddE simp: field_simps)
[PROOF STATE]
proof (state)
this:
z \<in> \<int>\<^sub>\<le>\<^sub>0 \<or> z + (1::'a) / (2::'a) \<in> \<int>\<^sub>\<le>\<^sub>0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_to_sch_4: "c_fst n mod 7 = 4 \<Longrightarrow> nat_to_sch n = Comp_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_fst n mod 7 = 4 \<Longrightarrow> nat_to_sch n = Comp_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_fst n mod 7 = 4 \<Longrightarrow> nat_to_sch n = Comp_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
assume A1: "c_fst n mod 7 = 4"
[PROOF STATE]
proof (state)
this:
c_fst n mod 7 = 4

goal (1 subgoal):
 1. c_fst n mod 7 = 4 \<Longrightarrow> nat_to_sch n = Comp_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c_fst n mod 7 = 4
[PROOF STEP]
have "nat_to_sch n = (let u=(c_fst n) mod 7; v=c_snd n; v1=c_fst v; v2 = c_snd v; sch1=nat_to_sch v1; sch2=nat_to_sch v2 in loc_f u sch1 sch2)"
[PROOF STATE]
proof (prove)
using this:
c_fst n mod 7 = 4

goal (1 subgoal):
 1. nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))
[PROOF STEP]
by (simp add: loc_lm_2)
[PROOF STATE]
proof (state)
this:
nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))

goal (1 subgoal):
 1. c_fst n mod 7 = 4 \<Longrightarrow> nat_to_sch n = Comp_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
with A1
[PROOF STATE]
proof (chain)
picking this:
c_fst n mod 7 = 4
nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))
[PROOF STEP]
show "nat_to_sch n = Comp_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))"
[PROOF STATE]
proof (prove)
using this:
c_fst n mod 7 = 4
nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))

goal (1 subgoal):
 1. nat_to_sch n = Comp_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
by (simp add: Let_def loc_f_def)
[PROOF STATE]
proof (state)
this:
nat_to_sch n = Comp_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hcomplex_hcnj_diff: "\<And>w z. hcnj (w - z) = hcnj w - hcnj z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w z. hcnj (w - z) = hcnj w - hcnj z
[PROOF STEP]
by transfer (rule complex_cnj_diff)


[STATEMENT]
lemma greaterThanLessThan_empty[simp]:
  assumes "l \<le>\<^sub>a k"
  shows "{k<\<^sub>a..<\<^sub>al} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {k<\<^sub>a..<\<^sub>al} = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l \<le>\<^sub>a k

goal (1 subgoal):
 1. {k<\<^sub>a..<\<^sub>al} = {}
[PROOF STEP]
by auto (blast intro: le_less_trans asym equals0I)


[STATEMENT]
lemma eval_poly_monom: "eval_poly hom (monom a n) x = hom a * x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly hom (monom a n) x = hom a * x ^ n
[PROOF STEP]
unfolding eval_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (map_poly hom (monom a n)) x = hom a * x ^ n
[PROOF STEP]
unfolding map_poly_monom[of hom, OF hom_zero]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (monom (hom a) n) x = hom a * x ^ n
[PROOF STEP]
using poly_monom
[PROOF STATE]
proof (prove)
using this:
poly (monom ?a ?n) ?x = ?a * ?x ^ ?n

goal (1 subgoal):
 1. poly (monom (hom a) n) x = hom a * x ^ n
[PROOF STEP]
.


[STATEMENT]
lemma RRR_closure:
  shows "closure RRR = {0..2} \<union> {3} \<union> {5..7}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure RRR = {0..2} \<union> {3} \<union> {5..7}
[PROOF STEP]
unfolding RRR_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure ({0<..<1} \<union> {1<..<2} \<union> {3} \<union> {5<..<7} \<inter> \<rat>) = {0..2} \<union> {3} \<union> {5..7}
[PROOF STEP]
by (force simp: closure_insert Rat_interval_closure)


[STATEMENT]
lemma max_ball_interior:
  assumes "U \<subseteq> carrier Q\<^sub>p"
  assumes "is_max_ball_of (interior U) B"
  shows "is_max_ball_of U B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_max_ball_of U B
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> is_max_ball_of U B \<Longrightarrow> False
[PROOF STEP]
assume C: " \<not> is_max_ball_of U B"
[PROOF STATE]
proof (state)
this:
\<not> is_max_ball_of U B

goal (1 subgoal):
 1. \<not> is_max_ball_of U B \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> is_max_ball_of U B
[PROOF STEP]
obtain B' where B'_def: "is_ball B' \<and> B' \<subseteq> U \<and> B \<subseteq> B' \<and> B \<noteq> B'"
[PROOF STATE]
proof (prove)
using this:
\<not> is_max_ball_of U B

goal (1 subgoal):
 1. (\<And>B'. is_ball B' \<and> B' \<subseteq> U \<and> B \<subseteq> B' \<and> B \<noteq> B' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (no_types, lifting) assms(1) assms(2) dual_order.trans
        interior_subset is_max_ball_of_def )
[PROOF STATE]
proof (state)
this:
is_ball B' \<and> B' \<subseteq> U \<and> B \<subseteq> B' \<and> B \<noteq> B'

goal (1 subgoal):
 1. \<not> is_max_ball_of U B \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_ball B' \<and> B' \<subseteq> U \<and> B \<subseteq> B' \<and> B \<noteq> B'
[PROOF STEP]
have "B' \<subseteq> interior U"
[PROOF STATE]
proof (prove)
using this:
is_ball B' \<and> B' \<subseteq> U \<and> B \<subseteq> B' \<and> B \<noteq> B'

goal (1 subgoal):
 1. B' \<subseteq> interior U
[PROOF STEP]
using interior_def padic_integers_axioms ball_is_open
[PROOF STATE]
proof (prove)
using this:
is_ball B' \<and> B' \<subseteq> U \<and> B \<subseteq> B' \<and> B \<noteq> B'
interior ?U = {a. \<exists>B. is_open B \<and> B \<subseteq> ?U \<and> a \<in> B}
padic_integers p
is_ball ?B \<Longrightarrow> is_open ?B

goal (1 subgoal):
 1. B' \<subseteq> interior U
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B' \<subseteq> interior U

goal (1 subgoal):
 1. \<not> is_max_ball_of U B \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B' \<subseteq> interior U
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
B' \<subseteq> interior U

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms B'_def is_max_ball_of_def[of "interior U" "B"]
[PROOF STATE]
proof (prove)
using this:
B' \<subseteq> interior U
U \<subseteq> carrier Q\<^sub>p
is_max_ball_of (interior U) B
is_ball B' \<and> B' \<subseteq> U \<and> B \<subseteq> B' \<and> B \<noteq> B'
is_max_ball_of (interior U) B \<equiv> is_ball B \<and> B \<subseteq> interior U \<and> (\<forall>B'. is_ball B' \<and> B' \<subseteq> interior U \<and> B \<subseteq> B' \<longrightarrow> B' \<subseteq> B)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma row_elems_ss01:"i < dim_row M \<Longrightarrow> vec_set (row M i) \<subseteq> {0, 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < dim_row M \<Longrightarrow> set\<^sub>v (row M i) \<subseteq> {0::'b, 1::'b}
[PROOF STEP]
using row_elems_subset_mat elems01
[PROOF STATE]
proof (prove)
using this:
?i < dim_row ?N \<Longrightarrow> set\<^sub>v (row ?N ?i) \<subseteq> elements_mat ?N
elements_mat M \<subseteq> {0::'b, 1::'b}

goal (1 subgoal):
 1. i < dim_row M \<Longrightarrow> set\<^sub>v (row M i) \<subseteq> {0::'b, 1::'b}
[PROOF STEP]
by blast


[STATEMENT]
lemma "(32::nat) - 14 = 18"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 32 - 14 = 18
[PROOF STEP]
by simp


[STATEMENT]
lemma dgrad_sig_set_closed_mult_scalar:
  "dickson_grading d \<Longrightarrow> p \<in> punit_dgrad_max_set d \<Longrightarrow> r \<in> dgrad_sig_set' j d \<Longrightarrow> p \<odot> r \<in> dgrad_sig_set' j d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dickson_grading d; p \<in> punit_dgrad_max_set d; r \<in> dgrad_sig_set' j d\<rbrakk> \<Longrightarrow> p \<odot> r \<in> dgrad_sig_set' j d
[PROOF STEP]
unfolding dgrad_sig_set'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dickson_grading d; p \<in> punit_dgrad_max_set d; r \<in> dgrad_max_set d \<inter> sig_inv_set' j\<rbrakk> \<Longrightarrow> p \<odot> r \<in> dgrad_max_set d \<inter> sig_inv_set' j
[PROOF STEP]
by (auto intro: dgrad_p_set_closed_mult_scalar sig_inv_set_closed_mult_scalar)


[STATEMENT]
lemma mset_ran_combine1: "\<lbrakk>finite r\<^sub>1; finite r\<^sub>2; r\<^sub>1\<inter>r\<^sub>2={}\<rbrakk> \<Longrightarrow> mset_ran a r\<^sub>1 + mset_ran a r\<^sub>2 = mset_ran a (r\<^sub>1\<union>r\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite r\<^sub>1; finite r\<^sub>2; r\<^sub>1 \<inter> r\<^sub>2 = {}\<rbrakk> \<Longrightarrow> mset_ran a r\<^sub>1 + mset_ran a r\<^sub>2 = mset_ran a (r\<^sub>1 \<union> r\<^sub>2)
[PROOF STEP]
by (auto simp: mset_ran_by_sum sum.union_disjoint[symmetric])


[STATEMENT]
lemma nat_exists_least_iff': "(\<exists>(n::nat). P n) \<longleftrightarrow> P (Least P) \<and> (\<forall>m < (Least P). \<not> P m)"
  (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>n. P n) = (P (Least P) \<and> (\<forall>m<Least P. \<not> P m))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>n. P n \<Longrightarrow> P (Least P) \<and> (\<forall>m<Least P. \<not> P m)
 2. P (Least P) \<and> (\<forall>m<Least P. \<not> P m) \<Longrightarrow> \<exists>n. P n
[PROOF STEP]
show ?lhs if ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. P n
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
P (Least P) \<and> (\<forall>m<Least P. \<not> P m)

goal (1 subgoal):
 1. \<exists>n. P n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
P (Least P) \<and> (\<forall>m<Least P. \<not> P m) \<Longrightarrow> \<exists>n. P n

goal (1 subgoal):
 1. \<exists>n. P n \<Longrightarrow> P (Least P) \<and> (\<forall>m<Least P. \<not> P m)
[PROOF STEP]
show ?rhs if ?lhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (Least P) \<and> (\<forall>m<Least P. \<not> P m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P (Least P) \<and> (\<forall>m<Least P. \<not> P m)
[PROOF STEP]
from \<open>?lhs\<close>
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. P n
[PROOF STEP]
obtain n where n: "P n"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. P n

goal (1 subgoal):
 1. (\<And>n. P n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
P n

goal (1 subgoal):
 1. P (Least P) \<and> (\<forall>m<Least P. \<not> P m)
[PROOF STEP]
let ?x = "Least P"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P (Least P) \<and> (\<forall>m<Least P. \<not> P m)
[PROOF STEP]
have "\<not> P m" if "m < ?x" for m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> P m
[PROOF STEP]
by (rule not_less_Least[OF that])
[PROOF STATE]
proof (state)
this:
?m < Least P \<Longrightarrow> \<not> P ?m

goal (1 subgoal):
 1. P (Least P) \<and> (\<forall>m<Least P. \<not> P m)
[PROOF STEP]
with LeastI_ex[OF \<open>?lhs\<close>]
[PROOF STATE]
proof (chain)
picking this:
P (LEAST n. P n)
?m < Least P \<Longrightarrow> \<not> P ?m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P (LEAST n. P n)
?m < Least P \<Longrightarrow> \<not> P ?m

goal (1 subgoal):
 1. P (Least P) \<and> (\<forall>m<Least P. \<not> P m)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
P (Least P) \<and> (\<forall>m<Least P. \<not> P m)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>n. P n \<Longrightarrow> P (Least P) \<and> (\<forall>m<Least P. \<not> P m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_inv_limit_0_right_gen:
  "((\<lambda>(t::real). exp(-inverse t) / t ^ k) \<longlongrightarrow> 0) (at_right 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. exp (- inverse t) / t ^ k) \<longlongrightarrow> 0) (at_right 0)
[PROOF STEP]
using exp_inv_limit_0_right_gen'[of k]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. inverse (t ^ k) / exp (inverse t)) \<longlongrightarrow> 0) (at_right 0)

goal (1 subgoal):
 1. ((\<lambda>t. exp (- inverse t) / t ^ k) \<longlongrightarrow> 0) (at_right 0)
[PROOF STEP]
by (metis (no_types, lifting) Groups.mult_ac(2) Lim_cong_within divide_inverse exp_minus)


[STATEMENT]
lemma (in Order) Pre_element:"\<lbrakk>a \<in> carrier D; ExPre D a\<rbrakk> \<Longrightarrow>
      Pre D a \<in> carrier D \<and> (Pre D a) \<prec> a \<and>
            \<not> (\<exists>y\<in>carrier D. ((Pre D a) \<prec> y \<and> y \<prec> a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier D; ExPre D a\<rbrakk> \<Longrightarrow> Pre D a \<in> carrier D \<and> Pre D a \<prec> a \<and> \<not> (\<exists>y\<in>carrier D. Pre D a \<prec> y \<and> y \<prec> a)
[PROOF STEP]
apply (simp add:ExPre_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier D; \<exists>x. x \<in> carrier D \<and> x \<prec> a \<and> (\<forall>y\<in>carrier D. x \<prec> y \<longrightarrow> \<not> y \<prec> a)\<rbrakk> \<Longrightarrow> Pre D a \<in> carrier D \<and> Pre D a \<prec> a \<and> (\<forall>y\<in>carrier D. Pre D a \<prec> y \<longrightarrow> \<not> y \<prec> a)
[PROOF STEP]
apply (subst Pre_def)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier D; \<exists>x. x \<in> carrier D \<and> x \<prec> a \<and> (\<forall>y\<in>carrier D. x \<prec> y \<longrightarrow> \<not> y \<prec> a)\<rbrakk> \<Longrightarrow> (SOME x. x \<in> carrier D \<and> x \<prec> a \<and> \<not> (\<exists>y\<in>carrier D. x \<prec> y \<and> y \<prec> a)) \<in> carrier D \<and> (SOME x. x \<in> carrier D \<and> x \<prec> a \<and> \<not> (\<exists>y\<in>carrier D. x \<prec> y \<and> y \<prec> a)) \<prec> a \<and> (\<forall>y\<in>carrier D. (SOME x. x \<in> carrier D \<and> x \<prec> a \<and> \<not> (\<exists>y\<in>carrier D. x \<prec> y \<and> y \<prec> a)) \<prec> y \<longrightarrow> \<not> y \<prec> a)
[PROOF STEP]
apply (rule someI2_ex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier D; \<exists>x. x \<in> carrier D \<and> x \<prec> a \<and> (\<forall>y\<in>carrier D. x \<prec> y \<longrightarrow> \<not> y \<prec> a)\<rbrakk> \<Longrightarrow> \<exists>aa. aa \<in> carrier D \<and> aa \<prec> a \<and> \<not> (\<exists>y\<in>carrier D. aa \<prec> y \<and> y \<prec> a)
 2. \<And>x. \<lbrakk>a \<in> carrier D; \<exists>x. x \<in> carrier D \<and> x \<prec> a \<and> (\<forall>y\<in>carrier D. x \<prec> y \<longrightarrow> \<not> y \<prec> a); x \<in> carrier D \<and> x \<prec> a \<and> \<not> (\<exists>y\<in>carrier D. x \<prec> y \<and> y \<prec> a)\<rbrakk> \<Longrightarrow> x \<in> carrier D \<and> x \<prec> a \<and> (\<forall>y\<in>carrier D. x \<prec> y \<longrightarrow> \<not> y \<prec> a)
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma euclid_ext_poly_mod_main: assumes cop: "coprime_m f g"
  and f: "Mp f = f" and g: "Mp g = g"
  and res: "euclid_ext_poly_mod_main m ff_ops f g = (a,b)"
shows "f * a + g * b =m 1"
  "Mp a = a" "Mp b = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * a + g * b =m 1 &&& Mp a = a &&& Mp b = b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f * a + g * b =m 1
 2. Mp a = a
 3. Mp b = b
[PROOF STEP]
obtain a' b' where res': "bezout_coefficients_i ff_ops (of_int_poly_i ff_ops f)
    (of_int_poly_i ff_ops g) = (a', b')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a' b'. bezout_coefficients_i ff_ops (of_int_poly_i ff_ops f) (of_int_poly_i ff_ops g) = (a', b') \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
bezout_coefficients_i ff_ops (of_int_poly_i ff_ops f) (of_int_poly_i ff_ops g) = (a', b')

goal (3 subgoals):
 1. f * a + g * b =m 1
 2. Mp a = a
 3. Mp b = b
[PROOF STEP]
show "f * a + g * b =m 1"
  "Mp a = a" "Mp b = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * a + g * b =m 1 &&& Mp a = a &&& Mp b = b
[PROOF STEP]
by (insert bezout_coefficients_i_sound[OF refl f refl g cop res']
    res [unfolded euclid_ext_poly_mod_main_def res'], auto)
[PROOF STATE]
proof (state)
this:
f * a + g * b =m 1
Mp a = a
Mp b = b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bigo_const_mult4:
"(c::'a::linordered_field) \<noteq> 0 \<Longrightarrow> O(f) \<le> O(\<lambda>x. c * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> O(f) \<subseteq> O(\<lambda>x. c * f x)
[PROOF STEP]
by (metis bigo_elt_subset bigo_const_mult3)


[STATEMENT]
theorem find_set_path_compression_1:
  "VARS p t w y
  [ find_set_precondition p x \<and> p0 = p ]
  y := find_set p x;
  w := x;
  WHILE y \<noteq> p[[w]]
    INV { path_compression_invariant p x y p0 w }
    VAR { (p\<^sup>T\<^sup>\<star> * w)\<down> }
     DO t := w;
        w := p[[w]];
        p[t] := y
     OD
  [ path_compression_postcondition p x y p0 ]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [find_set_precondition p x \<and> p0 = p]
y := find_set p x; w := x; WHILE y \<noteq> p[[w]] INV {path_compression_invariant p x y p0 w}  VAR {(p\<^sup>T\<^sup>\<star> * w)\<down>}
DO t := w; w := p[[w]]; p := (p[t\<longmapsto>y]) OD
[path_compression_postcondition p x y p0]
[PROOF STEP]
apply vcg_tc_simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. find_set_precondition p0 x \<Longrightarrow> path_compression_invariant p0 x (find_set p0 x) p0 x
 2. \<And>p w y. path_compression_invariant p x y p0 w \<and> y \<noteq> p[[w]] \<Longrightarrow> path_compression_invariant (p[w\<longmapsto>y]) x y p0 (p[[w]]) \<and> ((p[w\<longmapsto>y])\<^sup>T\<^sup>\<star> * (p[[w]]))\<down> < (p\<^sup>T\<^sup>\<star> * w)\<down>
 3. \<And>p w. path_compression_invariant p x (p[[w]]) p0 w \<Longrightarrow> path_compression_postcondition p x (p[[w]]) p0
[PROOF STEP]
using find_set_function find_set_postcondition_def find_set_precondition_def path_compression_1 path_compression_precondition_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>find_set_precondition ?p ?x; ?y = find_set ?p ?x\<rbrakk> \<Longrightarrow> find_set_postcondition ?p ?x ?y
find_set_postcondition ?p ?x ?y \<equiv> point ?y \<and> ?y = root ?p ?x
find_set_precondition ?p ?x \<equiv> ((coreflexive (?p[[?p]]) \<and> times_top_class.total ?p) \<and> pd_kleene_allegory_class.acyclic (?p - (1::'a))) \<and> point ?x
path_compression_precondition ?p ?x ?y \<Longrightarrow> path_compression_invariant ?p ?x ?y ?p ?x
path_compression_precondition ?p ?x ?y \<equiv> ((coreflexive (?p[[?p]]) \<and> times_top_class.total ?p) \<and> pd_kleene_allegory_class.acyclic (?p - (1::'a))) \<and> point ?x \<and> point ?y \<and> ?y = root ?p ?x

goal (3 subgoals):
 1. find_set_precondition p0 x \<Longrightarrow> path_compression_invariant p0 x (find_set p0 x) p0 x
 2. \<And>p w y. path_compression_invariant p x y p0 w \<and> y \<noteq> p[[w]] \<Longrightarrow> path_compression_invariant (p[w\<longmapsto>y]) x y p0 (p[[w]]) \<and> ((p[w\<longmapsto>y])\<^sup>T\<^sup>\<star> * (p[[w]]))\<down> < (p\<^sup>T\<^sup>\<star> * w)\<down>
 3. \<And>p w. path_compression_invariant p x (p[[w]]) p0 w \<Longrightarrow> path_compression_postcondition p x (p[[w]]) p0
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>p w y. path_compression_invariant p x y p0 w \<and> y \<noteq> p[[w]] \<Longrightarrow> path_compression_invariant (p[w\<longmapsto>y]) x y p0 (p[[w]]) \<and> ((p[w\<longmapsto>y])\<^sup>T\<^sup>\<star> * (p[[w]]))\<down> < (p\<^sup>T\<^sup>\<star> * w)\<down>
 2. \<And>p w. path_compression_invariant p x (p[[w]]) p0 w \<Longrightarrow> path_compression_postcondition p x (p[[w]]) p0
[PROOF STEP]
apply (fact path_compression_2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p w. path_compression_invariant p x (p[[w]]) p0 w \<Longrightarrow> path_compression_postcondition p x (p[[w]]) p0
[PROOF STEP]
by (fact path_compression_3)


[STATEMENT]
lemma supp_of_multisets:
  fixes M::"('a::fs multiset)"
  shows "(supp M) = (\<Union>{supp x | x. x \<in># M})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp M = \<Union> {supp x |x. x \<in># M}
[PROOF STEP]
apply(rule subset_antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. supp M \<subseteq> \<Union> {supp x |x. x \<in># M}
 2. \<Union> {supp x |x. x \<in># M} \<subseteq> supp M
[PROOF STEP]
apply(rule supp_is_subset)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<Union> {supp x |x. x \<in># M} supports M
 2. finite (\<Union> {supp x |x. x \<in># M})
 3. \<Union> {supp x |x. x \<in># M} \<subseteq> supp M
[PROOF STEP]
apply(rule Union_supports_multiset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite (\<Union> {supp x |x. x \<in># M})
 2. \<Union> {supp x |x. x \<in># M} \<subseteq> supp M
[PROOF STEP]
apply(rule Union_finite_multiset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {supp x |x. x \<in># M} \<subseteq> supp M
[PROOF STEP]
apply(rule Union_included_multiset)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma oLog_omega_less: "\<lbrakk>0 < x; x < \<epsilon>\<^sub>0\<rbrakk> \<Longrightarrow> oLog \<omega> x < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x < \<epsilon>\<^sub>0\<rbrakk> \<Longrightarrow> oLog \<omega> x < x
[PROOF STEP]
apply (erule ordinal_oLog_less)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x < \<epsilon>\<^sub>0 \<Longrightarrow> oSuc 0 < \<omega>
 2. x < \<epsilon>\<^sub>0 \<Longrightarrow> x < \<omega> ** x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < \<epsilon>\<^sub>0 \<Longrightarrow> x < \<omega> ** x
[PROOF STEP]
apply (erule less_omega_exp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma path_connected_space_iff_path_component:
   "path_connected_space X \<longleftrightarrow> (\<forall>x \<in> topspace X. \<forall>y \<in> topspace X. path_component_of X x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected_space X = (\<forall>x\<in>topspace X. \<forall>y\<in>topspace X. path_component_of X x y)
[PROOF STEP]
by (simp add: path_component_of path_connected_space_subconnected)


[STATEMENT]
lemma polynomial_function_add [intro]:
    "\<lbrakk>polynomial_function f; polynomial_function g\<rbrakk> \<Longrightarrow> polynomial_function (\<lambda>x. f x + g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>polynomial_function f; polynomial_function g\<rbrakk> \<Longrightarrow> polynomial_function (\<lambda>x. f x + g x)
[PROOF STEP]
by (auto simp: polynomial_function_def bounded_linear_def linear_add real_polynomial_function.add o_def)


[STATEMENT]
lemma divmultassoc: "a div (b*c) * (b*c) = ((a div (b * c)) * b)*(c::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a div (b * c) * (b * c) = a div (b * c) * b * c
[PROOF STEP]
by (rule mult.assoc [symmetric])


[STATEMENT]
lemma two_dvd_exp: "0<x \<Longrightarrow> (2::nat) dvd 2^x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> even (2 ^ x)
[PROOF STEP]
by (induct x) auto


[STATEMENT]
lemma chain_boundary_simplicial_cone_of:
  assumes "simplicial_simplex p S f"
  shows "chain_boundary (Suc p) (simplicial_cone p v (frag_of f)) =
         frag_of f
         - (if p = 0 then frag_of (\<lambda>u\<in>standard_simplex p. v)
            else simplicial_cone (p -1) v (chain_boundary p (frag_of f)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain_boundary (Suc p) (simplicial_cone p v (frag_of f)) = frag_of f - (if p = 0 then frag_of (\<lambda>u\<in>standard_simplex p. v) else simplicial_cone (p - 1) v (chain_boundary p (frag_of f)))
[PROOF STEP]
using chain_boundary_simplicial_cone_of' assms
[PROOF STATE]
proof (prove)
using this:
?f = oriented_simplex ?p ?l \<Longrightarrow> chain_boundary (Suc ?p) (simplicial_cone ?p ?v (frag_of ?f)) = frag_of ?f - (if ?p = 0 then frag_of (\<lambda>u\<in>standard_simplex ?p. ?v) else simplicial_cone (?p - 1) ?v (chain_boundary ?p (frag_of ?f)))
simplicial_simplex p S f

goal (1 subgoal):
 1. chain_boundary (Suc p) (simplicial_cone p v (frag_of f)) = frag_of f - (if p = 0 then frag_of (\<lambda>u\<in>standard_simplex p. v) else simplicial_cone (p - 1) v (chain_boundary p (frag_of f)))
[PROOF STEP]
unfolding simplicial_simplex_def
[PROOF STATE]
proof (prove)
using this:
?f = oriented_simplex ?p ?l \<Longrightarrow> chain_boundary (Suc ?p) (simplicial_cone ?p ?v (frag_of ?f)) = frag_of ?f - (if ?p = 0 then frag_of (\<lambda>u\<in>standard_simplex ?p. ?v) else simplicial_cone (?p - 1) ?v (chain_boundary ?p (frag_of ?f)))
singular_simplex p (subtopology (powertop_real UNIV) S) f \<and> (\<exists>l. f = oriented_simplex p l)

goal (1 subgoal):
 1. chain_boundary (Suc p) (simplicial_cone p v (frag_of f)) = frag_of f - (if p = 0 then frag_of (\<lambda>u\<in>standard_simplex p. v) else simplicial_cone (p - 1) v (chain_boundary p (frag_of f)))
[PROOF STEP]
by blast


[STATEMENT]
lemma Gauss_Jordan_not_0:
fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
assumes "A \<noteq> 0"
shows "Gauss_Jordan A \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan A \<noteq> 0
[PROOF STEP]
by (metis assms less_not_refl3 rank_0 rank_Gauss_Jordan rank_greater_zero)


[STATEMENT]
lemma has_sum_adj:
  assumes \<open>has_sum f I x\<close>
  shows \<open>has_sum (\<lambda>x. adj (f x)) I (adj x)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum (\<lambda>x. f x*) I (x*)
[PROOF STEP]
apply (rule has_sum_comm_additive[where f=adj, unfolded o_def])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. additive adj
 2. adj \<midarrow>x\<rightarrow> x*
 3. has_sum f I x
[PROOF STEP]
apply (simp add: antilinear.axioms(1))
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. adj \<midarrow>x\<rightarrow> x*
 2. has_sum f I x
[PROOF STEP]
apply (metis (no_types, lifting) LIM_eq adj_plus adj_uminus norm_adj uminus_add_conv_diff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum f I x
[PROOF STEP]
by (simp add: assms)


[STATEMENT]
lemma deterministic_alt_def_h :
  "deterministic M = (\<forall> q1 x yq yq' . (yq \<in> h M (q1,x) \<and> yq' \<in> h M (q1,x)) \<longrightarrow> yq = yq')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deterministic M = (\<forall>q1 x yq yq'. yq \<in> FSM.h M (q1, x) \<and> yq' \<in> FSM.h M (q1, x) \<longrightarrow> yq = yq')
[PROOF STEP]
by auto


[STATEMENT]
lemma entail_unions: "(\<forall>i \<in> I. N \<Turnstile> Ni i) \<longleftrightarrow> N \<Turnstile> \<Union> (Ni ` I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>I. N \<Turnstile> Ni i) = (N \<Turnstile> \<Union> (Ni ` I))
[PROOF STEP]
using entail_set_all_formulas[of N "\<Union> (Ni ` I)"] entail_set_all_formulas[of N]
    Complete_Lattices.UN_ball_bex_simps(2)[of Ni I "\<lambda>C. N \<Turnstile> {C}", symmetric]
[PROOF STATE]
proof (prove)
using this:
(N \<Turnstile> \<Union> (Ni ` I)) = (\<forall>C\<in>\<Union> (Ni ` I). N \<Turnstile> {C})
(N \<Turnstile> ?N2.0) = (\<forall>C\<in>?N2.0. N \<Turnstile> {C})
(\<forall>a\<in>I. \<forall>x\<in>Ni a. N \<Turnstile> {x}) = (\<forall>x\<in>\<Union> (Ni ` I). N \<Turnstile> {x})

goal (1 subgoal):
 1. (\<forall>i\<in>I. N \<Turnstile> Ni i) = (N \<Turnstile> \<Union> (Ni ` I))
[PROOF STEP]
by meson


[STATEMENT]
lemma deformation_retract_relative_homology_group_isomorphisms:
   "\<lbrakk>retraction_maps X Y r id; V \<subseteq> U; r ` U \<subseteq> V; homotopic_with (\<lambda>h. h ` U \<subseteq> U) X X r id\<rbrakk>
        \<Longrightarrow> group_isomorphisms (relative_homology_group p X U) (relative_homology_group p Y V)
             (hom_induced p X U Y V r) (hom_induced p Y V X U id)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>retraction_maps X Y r id; V \<subseteq> U; r ` U \<subseteq> V; homotopic_with (\<lambda>h. h ` U \<subseteq> U) X X r id\<rbrakk> \<Longrightarrow> group_isomorphisms (relative_homology_group p X U) (relative_homology_group p Y V) (hom_induced p X U Y V r) (hom_induced p Y V X U id)
[PROOF STEP]
by (simp add: deformation_retraction_relative_homology_group_isomorphisms)


[STATEMENT]
lemma E_inf_r_unfold:
  "step.E_inf s (r f) = (\<Sqinter>D\<in>step s. \<integral>\<^sup>+ t. (if fst t = Skip then f (snd t) else step.E_inf t (r f)) \<partial>measure_pmf D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. step.E_inf s (r f) = (\<Sqinter>D\<in>step s. \<integral>\<^sup>+ t. (if fst t = Skip then f (snd t) else step.E_inf t (r f)) \<partial>measure_pmf D)
[PROOF STEP]
unfolding E_inf_r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp (\<lambda>F s. \<Sqinter>D\<in>step s. \<integral>\<^sup>+ t. (if fst t = Skip then f (snd t) else F t) \<partial>measure_pmf D) s = (\<Sqinter>D\<in>step s. \<integral>\<^sup>+ t. (if fst t = Skip then f (snd t) else lfp (\<lambda>F s. \<Sqinter>D\<in>step s. \<integral>\<^sup>+ t. (if fst t = Skip then f (snd t) else F t) \<partial>measure_pmf D) t) \<partial>measure_pmf D)
[PROOF STEP]
by (simp add: lfp_unfold[OF mono_r'])


[STATEMENT]
theorem frp_pref_dfs:
  "wa_precise_refine (frp_algo T1 T2)
     (dfs_algo (ta_initial T1 \<times> ta_initial T2)
               (f_succ (\<delta>_prod (ta_rules T1) (ta_rules T2))))
     frp_\<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wa_precise_refine (frp_algo T1 T2) (dfs_algo (ta_initial T1 \<times> ta_initial T2) (f_succ (\<delta>_prod (ta_rules T1) (ta_rules T2)))) frp_\<alpha>
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>s. \<lbrakk>s \<in> wa_invar (frp_algo T1 T2); s \<in> wa_cond (frp_algo T1 T2)\<rbrakk> \<Longrightarrow> frp_\<alpha> s \<in> wa_cond (dfs_algo (ta_initial T1 \<times> ta_initial T2) (f_succ (\<delta>_prod (ta_rules T1) (ta_rules T2))))
 2. \<And>s s'. \<lbrakk>s \<in> wa_invar (frp_algo T1 T2); s \<in> wa_cond (frp_algo T1 T2); (s, s') \<in> wa_step (frp_algo T1 T2)\<rbrakk> \<Longrightarrow> (frp_\<alpha> s, frp_\<alpha> s') \<in> wa_step (dfs_algo (ta_initial T1 \<times> ta_initial T2) (f_succ (\<delta>_prod (ta_rules T1) (ta_rules T2))))
 3. frp_\<alpha> ` wa_initial (frp_algo T1 T2) \<subseteq> wa_initial (dfs_algo (ta_initial T1 \<times> ta_initial T2) (f_succ (\<delta>_prod (ta_rules T1) (ta_rules T2))))
 4. frp_\<alpha> ` wa_invar (frp_algo T1 T2) \<subseteq> wa_invar (dfs_algo (ta_initial T1 \<times> ta_initial T2) (f_succ (\<delta>_prod (ta_rules T1) (ta_rules T2))))
 5. \<forall>s. s \<in> wa_invar (frp_algo T1 T2) \<and> frp_\<alpha> s \<in> wa_cond (dfs_algo (ta_initial T1 \<times> ta_initial T2) (f_succ (\<delta>_prod (ta_rules T1) (ta_rules T2)))) \<longrightarrow> s \<in> wa_cond (frp_algo T1 T2)
[PROOF STEP]
apply (auto simp add: frp_algo_def frp_\<alpha>_def frp_cond_def dfs_algo_def
                        dfs_cond_def frp_invar_def
    elim!: frp_step.cases frp_initial.cases
    intro: dfs_step.intros dfs_initial.intros
  )
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lm01: assumes "trivial (A \<times> B)"
              shows   "(finite (A\<times>B) & card A * (card B) \<le> 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (A \<times> B) \<and> card A * card B \<le> 1
[PROOF STEP]
using trivial_def assms One_nat_def card_cartesian_product card.empty card_insert_disjoint
            empty_iff finite.emptyI le0 trivial_implies_finite order_refl subset_singletonD
[PROOF STATE]
proof (prove)
using this:
trivial ?x = (?x \<subseteq> {the_elem ?x})
trivial (A \<times> B)
1 = Suc 0
card (?A \<times> ?B) = card ?A * card ?B
card {} = 0
\<lbrakk>finite ?A; ?x \<notin> ?A\<rbrakk> \<Longrightarrow> card (insert ?x ?A) = Suc (card ?A)
(?c \<in> {}) = False
finite {}
0 \<le> ?n
trivial ?X \<Longrightarrow> finite ?X
?x \<le> ?x
?A \<subseteq> {?x} \<Longrightarrow> ?A = {} \<or> ?A = {?x}

goal (1 subgoal):
 1. finite (A \<times> B) \<and> card A * card B \<le> 1
[PROOF STEP]
by (metis(no_types))


[STATEMENT]
lemma "10000055 mod 32 = (23::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 10000055 mod 32 = 23
[PROOF STEP]
by simp


[STATEMENT]
lemma of_int_floor_le [simp]: "of_int \<lfloor>x\<rfloor> \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int \<lfloor>x\<rfloor> \<le> x
[PROOF STEP]
using floor_correct
[PROOF STATE]
proof (prove)
using this:
of_int \<lfloor>?x\<rfloor> \<le> ?x \<and> ?x < of_int (\<lfloor>?x\<rfloor> + 1)

goal (1 subgoal):
 1. of_int \<lfloor>x\<rfloor> \<le> x
[PROOF STEP]
..


[STATEMENT]
lemma dim_col_space_iarray[code_unfold]:
  fixes A::"'a::{field}^'columns::{mod_type}^'rows::{mod_type}"
  shows "vec.dim (col_space A) = rank_iarray (matrix_to_iarray A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (col_space A) = rank_iarray (matrix_to_iarray A)
[PROOF STEP]
unfolding rank_eq_dim_col_space[of A, symmetric]  matrix_to_iarray_rank
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank_iarray (matrix_to_iarray A) = rank_iarray (matrix_to_iarray A)
[PROOF STEP]
..


[STATEMENT]
lemma maximally_connected_impl_connected:
    assumes "maximally_connected H G"
    assumes subgraph: "subgraph H G"
    shows "connected_graph H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_graph H
[PROOF STEP]
using assms connected_graph_axioms valid_subgraph[OF subgraph]
[PROOF STATE]
proof (prove)
using this:
maximally_connected H G
subgraph H G
connected_graph G
valid_graph H

goal (1 subgoal):
 1. connected_graph H
[PROOF STEP]
unfolding connected_graph_def connected_graph_axioms_def maximally_connected_def
      subgraph_def
[PROOF STATE]
proof (prove)
using this:
\<forall>v\<in>V. \<forall>v'\<in>V. nodes_connected G v v' \<longrightarrow> nodes_connected H v v'
nodes H = V \<and> edges H \<subseteq> E
valid_graph G \<and> (\<forall>v\<in>V. \<forall>v'\<in>V. nodes_connected G v v')
valid_graph H

goal (1 subgoal):
 1. valid_graph H \<and> (\<forall>v\<in>nodes H. \<forall>v'\<in>nodes H. nodes_connected H v v')
[PROOF STEP]
by auto


[STATEMENT]
lemma cf_rcomp_ObjMap_vdomain[cat_cs_simps]:
  assumes "category \<alpha> \<BB>" and "\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
  shows "\<D>\<^sub>\<circ> (cf_rcomp \<BB> \<SS> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_rcomp \<BB> \<SS> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Obj\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<BB>
\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_rcomp \<BB> \<SS> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding cf_rcomp_def
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<BB>
\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_bcomp \<SS> (dghm_id \<BB>) \<GG>\<lparr>ObjMap\<rparr>) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Obj\<rparr>
[PROOF STEP]
by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros)


[STATEMENT]
lemma maxim_mono: "\<lbrakk>X \<subseteq> Y; finite Y; X \<noteq> {}; Y \<subseteq> Field r\<rbrakk> \<Longrightarrow> (maxim X, maxim Y) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> Y; finite Y; X \<noteq> {}; Y \<subseteq> Field r\<rbrakk> \<Longrightarrow> (maxim X, maxim Y) \<in> r
[PROOF STEP]
using maxim_in[OF finite_subset, of X Y]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>X \<subseteq> Y; finite Y; X \<noteq> {}; X \<subseteq> Field r\<rbrakk> \<Longrightarrow> maxim X \<in> X

goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> Y; finite Y; X \<noteq> {}; Y \<subseteq> Field r\<rbrakk> \<Longrightarrow> (maxim X, maxim Y) \<in> r
[PROOF STEP]
by (auto intro: maxim_greatest)


[STATEMENT]
lemma compose_Id: "g \<in> A \<rightarrow> B \<Longrightarrow> g \<in> extensional A \<Longrightarrow> compose A g (\<lambda>x\<in>A. x) = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g \<in> A \<rightarrow> B; g \<in> extensional A\<rbrakk> \<Longrightarrow> compose A g (\<lambda>x\<in>A. x) = g
[PROOF STEP]
by (auto simp add: fun_eq_iff compose_def extensional_def Pi_def)


[STATEMENT]
lemma path_map_target : "target (f4 q) (map (\<lambda> t . (f1 (t_source t), f2 (t_input t), f3 (t_output t), f4 (t_target t))) p) = f4 (target q p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. target (f4 q) (map (\<lambda>t. (f1 (t_source t), f2 (t_input t), f3 (t_output t), f4 (t_target t))) p) = f4 (target q p)
[PROOF STEP]
by (induction p; auto)


[STATEMENT]
lemma Lcm_no_multiple: "(\<forall>m. m \<noteq> 0 \<longrightarrow> (\<exists>a\<in>A. \<not> a dvd m)) \<Longrightarrow> Lcm A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m. m \<noteq> (0::'a) \<longrightarrow> (\<exists>a\<in>A. \<not> a dvd m) \<Longrightarrow> Lcm A = (0::'a)
[PROOF STEP]
by (auto simp: Lcm_0_iff')


[STATEMENT]
lemma ev_eq_lfp: "ev P = lfp (\<lambda>F \<omega>. P \<omega> \<or> (\<not> P \<omega> \<and> F (stl \<omega>)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ev P = lfp (\<lambda>F \<omega>. P \<omega> \<or> \<not> P \<omega> \<and> F (stl \<omega>))
[PROOF STEP]
unfolding ev_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp (\<lambda>p x. (\<exists>xs. x = xs \<and> P xs) \<or> (\<exists>xs. x = xs \<and> p (stl xs))) = lfp (\<lambda>F \<omega>. P \<omega> \<or> \<not> P \<omega> \<and> F (stl \<omega>))
[PROOF STEP]
by (intro antisym lfp_mono) blast+


[STATEMENT]
lemma qbs_morphism_Pair2':
  assumes "y \<in> qbs_space Y"
      and "f \<in> X \<Otimes>\<^sub>Q Y \<rightarrow>\<^sub>Q Z"
    shows "(\<lambda>x. f (x,y)) \<in> X \<rightarrow>\<^sub>Q Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (x, y)) \<in> X \<rightarrow>\<^sub>Q Z
[PROOF STEP]
using qbs_morphism_comp[OF qbs_morphism_Pair2[OF assms(1)] assms(2)]
[PROOF STATE]
proof (prove)
using this:
f \<circ> (\<lambda>x. (x, y)) \<in> X \<rightarrow>\<^sub>Q Z

goal (1 subgoal):
 1. (\<lambda>x. f (x, y)) \<in> X \<rightarrow>\<^sub>Q Z
[PROOF STEP]
by(simp add: comp_def)


[STATEMENT]
lemma coeff_eq_0:
  assumes "degree p < n"
  shows "coeff p n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff p n = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coeff p n = (0::'a)
[PROOF STEP]
have "\<exists>n. \<forall>i>n. coeff p i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. \<forall>i>n. coeff p i = (0::'a)
[PROOF STEP]
using MOST_coeff_eq_0
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>\<infinity>n. coeff ?p n = (0::?'a)

goal (1 subgoal):
 1. \<exists>n. \<forall>i>n. coeff p i = (0::'a)
[PROOF STEP]
by (simp add: MOST_nat)
[PROOF STATE]
proof (state)
this:
\<exists>n. \<forall>i>n. coeff p i = (0::'a)

goal (1 subgoal):
 1. coeff p n = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. \<forall>i>n. coeff p i = (0::'a)
[PROOF STEP]
have "\<forall>i>degree p. coeff p i = 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. \<forall>i>n. coeff p i = (0::'a)

goal (1 subgoal):
 1. \<forall>i>degree p. coeff p i = (0::'a)
[PROOF STEP]
unfolding degree_def
[PROOF STATE]
proof (prove)
using this:
\<exists>n. \<forall>i>n. coeff p i = (0::'a)

goal (1 subgoal):
 1. \<forall>i>LEAST n. \<forall>i>n. coeff p i = (0::'a). coeff p i = (0::'a)
[PROOF STEP]
by (rule LeastI_ex)
[PROOF STATE]
proof (state)
this:
\<forall>i>degree p. coeff p i = (0::'a)

goal (1 subgoal):
 1. coeff p n = (0::'a)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
degree p < n
\<forall>i>degree p. coeff p i = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree p < n
\<forall>i>degree p. coeff p i = (0::'a)

goal (1 subgoal):
 1. coeff p n = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coeff p n = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_closed'[simp]: "\<forall>x\<in>U\<^sub>M. \<forall>y\<in>U\<^sub>M. x -\<^sub>M y \<in> U\<^sub>M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>U\<^sub>M. \<forall>y\<in>U\<^sub>M. x -\<^sub>M y \<in> U\<^sub>M
[PROOF STEP]
by (simp add: ab_diff_conv_add_uminus add_closed' uminus_closed)


[STATEMENT]
lemma join_idem [simp]: "x \<in> carrier L \<Longrightarrow> x \<squnion> x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier L \<Longrightarrow> x \<squnion> x = x
[PROOF STEP]
using le_iff_meet
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier L; ?y \<in> carrier L\<rbrakk> \<Longrightarrow> (?x \<sqsubseteq> ?y) = (?x \<squnion> ?y = ?y)

goal (1 subgoal):
 1. x \<in> carrier L \<Longrightarrow> x \<squnion> x = x
[PROOF STEP]
by blast


[STATEMENT]
theorem Knaster_Tarski_idem_inf_eq:
  assumes "weak_complete_lattice L" "isotone L L f" "idempotent L f" "f \<in> carrier L \<rightarrow> carrier L"
          "A \<subseteq> fps L f"
  shows "\<Sqinter>\<^bsub>fpl L f\<^esub> A .=\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A .=\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A .=\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
interpret L: weak_complete_lattice "L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_complete_lattice L
[PROOF STEP]
by (simp_all add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A .=\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
interpret L': weak_complete_lattice "fpl L f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_complete_lattice (fpl L f)
[PROOF STEP]
by (rule Knaster_Tarski, simp_all add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A .=\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
have FA: "fps L f \<subseteq> carrier L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps L f \<subseteq> carrier L
[PROOF STEP]
by (auto simp add: fps_def)
[PROOF STATE]
proof (state)
this:
fps L f \<subseteq> carrier L

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A .=\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
have A: "A \<subseteq> carrier L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> carrier L
[PROOF STEP]
using FA assms(5)
[PROOF STATE]
proof (prove)
using this:
fps L f \<subseteq> carrier L
A \<subseteq> fps L f

goal (1 subgoal):
 1. A \<subseteq> carrier L
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<subseteq> carrier L

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A .=\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
have fA: "f (\<Sqinter>\<^bsub>L\<^esub>A) \<in> fps L f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (\<Sqinter>\<^bsub>L\<^esub>A) \<in> fps L f
[PROOF STEP]
by (metis (no_types, lifting) A L.idempotent L.inf_closed PiE assms(3) assms(4) fps_def mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
f (\<Sqinter>\<^bsub>L\<^esub>A) \<in> fps L f

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A .=\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
have infA: "\<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> fps L f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> fps L f
[PROOF STEP]
by (rule L'.inf_closed[simplified], simp add: assms)
[PROOF STATE]
proof (state)
this:
\<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> fps L f

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A .=\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A .=\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
proof (rule L.weak_le_antisym)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
 2. f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A
 3. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> carrier L
 4. f (\<Sqinter>\<^bsub>L\<^esub>A) \<in> carrier L
[PROOF STEP]
show ic: "\<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> carrier L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> carrier L
[PROOF STEP]
using FA infA
[PROOF STATE]
proof (prove)
using this:
fps L f \<subseteq> carrier L
\<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> fps L f

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> carrier L
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> carrier L

goal (3 subgoals):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
 2. f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A
 3. f (\<Sqinter>\<^bsub>L\<^esub>A) \<in> carrier L
[PROOF STEP]
show fc: "f (\<Sqinter>\<^bsub>L\<^esub>A) \<in> carrier L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (\<Sqinter>\<^bsub>L\<^esub>A) \<in> carrier L
[PROOF STEP]
using FA fA
[PROOF STATE]
proof (prove)
using this:
fps L f \<subseteq> carrier L
f (\<Sqinter>\<^bsub>L\<^esub>A) \<in> fps L f

goal (1 subgoal):
 1. f (\<Sqinter>\<^bsub>L\<^esub>A) \<in> carrier L
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f (\<Sqinter>\<^bsub>L\<^esub>A) \<in> carrier L

goal (2 subgoals):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
 2. f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A
[PROOF STEP]
show "f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A
[PROOF STEP]
have "\<And>x. x \<in> A \<Longrightarrow> f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> x
[PROOF STEP]
by (meson A FA L.inf_closed L.inf_lower L.le_trans L.weak_sup_post_fixed_point assms(2) assms(4) assms(5) fA subsetCE)
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Longrightarrow> f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> ?x

goal (1 subgoal):
 1. f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A
[PROOF STEP]
hence "f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>fpl L f\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A"
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> ?x

goal (1 subgoal):
 1. f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>fpl L f\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A
[PROOF STEP]
by (rule_tac L'.inf_greatest, simp_all add: fA assms(3,5))
[PROOF STATE]
proof (state)
this:
f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>fpl L f\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A

goal (1 subgoal):
 1. f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>fpl L f\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A

goal (1 subgoal):
 1. f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (\<Sqinter>\<^bsub>L\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>fpl L f\<^esub>A

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
show "\<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
have *: "\<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> carrier L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> carrier L
[PROOF STEP]
using FA infA
[PROOF STATE]
proof (prove)
using this:
fps L f \<subseteq> carrier L
\<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> fps L f

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> carrier L
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> carrier L

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
have "\<And>x. x \<in> A \<Longrightarrow> \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>fpl L f\<^esub> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>fpl L f\<^esub> x
[PROOF STEP]
by (rule L'.inf_lower, simp_all add: assms)
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Longrightarrow> \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>fpl L f\<^esub> ?x

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
hence "\<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> (\<Sqinter>\<^bsub>L\<^esub>A)"
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>fpl L f\<^esub> ?x

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>L\<^esub>A
[PROOF STEP]
by (rule_tac L.inf_greatest, simp_all add: A *)
[PROOF STATE]
proof (state)
this:
\<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>L\<^esub>A

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
hence 1:"f(\<Sqinter>\<^bsub>fpl L f\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> f(\<Sqinter>\<^bsub>L\<^esub>A)"
[PROOF STATE]
proof (prove)
using this:
\<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> \<Sqinter>\<^bsub>L\<^esub>A

goal (1 subgoal):
 1. f (\<Sqinter>\<^bsub>fpl L f\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
by (metis (no_types, lifting) A FA L.inf_closed assms(2) infA subsetCE use_iso1)
[PROOF STATE]
proof (state)
this:
f (\<Sqinter>\<^bsub>fpl L f\<^esub>A) \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
have 2:"\<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>fpl L f\<^esub>A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>fpl L f\<^esub>A)
[PROOF STEP]
by (metis (no_types, lifting) FA L.sym L.use_fps L.weak_complete_lattice_axioms PiE assms(4) infA subsetCE weak_complete_lattice_def weak_partial_order.weak_refl)
[PROOF STATE]
proof (state)
this:
\<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>fpl L f\<^esub>A)

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
using FA fA infA
[PROOF STATE]
proof (prove)
using this:
fps L f \<subseteq> carrier L
f (\<Sqinter>\<^bsub>L\<^esub>A) \<in> fps L f
\<Sqinter>\<^bsub>fpl L f\<^esub>A \<in> fps L f

goal (1 subgoal):
 1. \<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)
[PROOF STEP]
by (auto intro!: L.le_trans[OF 2 1] ic fc, metis FA PiE assms(4) subsetCE)
[PROOF STATE]
proof (state)
this:
\<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Sqinter>\<^bsub>fpl L f\<^esub>A \<sqsubseteq>\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Sqinter>\<^bsub>fpl L f\<^esub>A .=\<^bsub>L\<^esub> f (\<Sqinter>\<^bsub>L\<^esub>A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zmset_subset_eqI: "(\<And>a. zcount A a \<le> zcount B a) \<Longrightarrow> A \<subseteq>#\<^sub>z B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. zcount A a \<le> zcount B a) \<Longrightarrow> A \<subseteq>#\<^sub>z B
[PROOF STEP]
by (simp add: subseteq_zmset_def)


[STATEMENT]
lemma prod_list_abs(*[simp]?*):
  fixes xs:: "int list"
  shows "prod_list (map abs xs) = abs (prod_list xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map abs xs) = \<bar>prod_list xs\<bar>
[PROOF STEP]
by (induct xs, auto simp add: abs_mult)


[STATEMENT]
lemma bounded_by_mono:
  "\<lbrakk> bounded_by a P; a \<le> b \<rbrakk> \<Longrightarrow> bounded_by b P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bounded_by a P; a \<le> b\<rbrakk> \<Longrightarrow> bounded_by b P
[PROOF STEP]
unfolding bounded_by_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. P x \<le> a; a \<le> b\<rbrakk> \<Longrightarrow> \<forall>x. P x \<le> b
[PROOF STEP]
by(blast intro:order_trans)


[STATEMENT]
lemma length_mirror1: "length ps = length (mirror1 ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ps = length (mirror1 ps)
[PROOF STEP]
unfolding mirror1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ps = length (mirror1_aux (max1 ps + min1 ps) ps)
[PROOF STEP]
using length_mirror1_aux
[PROOF STATE]
proof (prove)
using this:
length ?ps = length (mirror1_aux ?n ?ps)

goal (1 subgoal):
 1. length ps = length (mirror1_aux (max1 ps + min1 ps) ps)
[PROOF STEP]
by auto


[STATEMENT]
lemma standard_maintains_identity_rules:
  assumes "standard' C G" "x\<in>identity_rules L"
  shows "maintained x G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maintained x G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. maintained x G
[PROOF STEP]
consider "x = reflexivity_rule S_Idt" | "x = transitive_rule S_Idt" | "x = symmetry_rule S_Idt"
    |  "\<exists> l. x = congruence_rule S_Idt l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x = reflexivity_rule S_Idt \<Longrightarrow> thesis; x = transitive_rule S_Idt \<Longrightarrow> thesis; x = symmetry_rule S_Idt \<Longrightarrow> thesis; \<exists>l. x = congruence_rule S_Idt l \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
standard' C G
x \<in> identity_rules L

goal (1 subgoal):
 1. \<lbrakk>x = reflexivity_rule S_Idt \<Longrightarrow> thesis; x = transitive_rule S_Idt \<Longrightarrow> thesis; x = symmetry_rule S_Idt \<Longrightarrow> thesis; \<exists>l. x = congruence_rule S_Idt l \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
unfolding identity_rules_def Un_iff
[PROOF STATE]
proof (prove)
using this:
standard' C G
x \<in> {reflexivity_rule S_Idt, transitive_rule S_Idt, symmetry_rule S_Idt} \<or> x \<in> congruence_rules S_Idt L

goal (1 subgoal):
 1. \<lbrakk>x = reflexivity_rule S_Idt \<Longrightarrow> thesis; x = transitive_rule S_Idt \<Longrightarrow> thesis; x = symmetry_rule S_Idt \<Longrightarrow> thesis; \<exists>l. x = congruence_rule S_Idt l \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>x = reflexivity_rule S_Idt \<Longrightarrow> ?thesis; x = transitive_rule S_Idt \<Longrightarrow> ?thesis; x = symmetry_rule S_Idt \<Longrightarrow> ?thesis; \<exists>l. x = congruence_rule S_Idt l \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. maintained x G
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = reflexivity_rule S_Idt \<Longrightarrow> ?thesis; x = transitive_rule S_Idt \<Longrightarrow> ?thesis; x = symmetry_rule S_Idt \<Longrightarrow> ?thesis; \<exists>l. x = congruence_rule S_Idt l \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. maintained x G
[PROOF STEP]
using standard_identity_rules[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = reflexivity_rule S_Idt \<Longrightarrow> ?thesis; x = transitive_rule S_Idt \<Longrightarrow> ?thesis; x = symmetry_rule S_Idt \<Longrightarrow> ?thesis; \<exists>l. x = congruence_rule S_Idt l \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
maintained (reflexivity_rule S_Idt) G
maintained (transitive_rule S_Idt) G
maintained (symmetry_rule S_Idt) G
maintained (congruence_rule S_Idt ?l) G

goal (1 subgoal):
 1. maintained x G
[PROOF STEP]
by(cases,auto)
[PROOF STATE]
proof (state)
this:
maintained x G

goal:
No subgoals!
[PROOF STEP]
qed