[STATEMENT]
lemma zmult_div_abs_ge: "
  \<lbrakk> (0::int) \<le> b; b \<le> b'; 0 \<le> a; 0 < c\<rbrakk> \<Longrightarrow>
  \<bar>a * b div c\<bar> \<le> \<bar>a * b' div c\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> b; b \<le> b'; 0 \<le> a; 0 < c\<rbrakk> \<Longrightarrow> \<bar>a * b div c\<bar> \<le> \<bar>a * b' div c\<bar>
[PROOF STEP]
apply (insert zmult_div_ge_0[of b a c] zmult_div_ge_0[of "b'" a c], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> b; b \<le> b'; 0 \<le> a; 0 < c; 0 \<le> a * b div c; 0 \<le> a * b' div c\<rbrakk> \<Longrightarrow> a * b div c \<le> a * b' div c
[PROOF STEP]
by (metis zmult_div_leq_mono)


[STATEMENT]
lemma roots_of_complex_poly: assumes p: "p \<noteq> 0"
  shows "set (roots_of_complex_poly p) = {x. poly p x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (roots_of_complex_poly p) = {x. poly p x = 0}
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. set (roots_of_complex_poly p) = {x. poly p x = 0}
[PROOF STEP]
unfolding roots_of_complex_poly_def
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. set (if p = 0 then [] else roots_of_complex_rf_polys (yun_polys p)) = {x. poly p x = 0}
[PROOF STEP]
by (simp add: roots_of_complex_rf_polys yun_polys[OF p])


[STATEMENT]
lemma distinct_map_scaleRI:
  fixes xs::"'a::real_vector list"
  shows "distinct xs \<Longrightarrow> c \<noteq> 0 \<Longrightarrow> distinct (map ((*\<^sub>R) c) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; c \<noteq> 0\<rbrakk> \<Longrightarrow> distinct (map ((*\<^sub>R) c) xs)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma sign_changes_filter:
  fixes xs :: "'a :: linordered_idom list"
  shows "sign_changes (filter (\<lambda>x. x \<noteq> 0) xs) = sign_changes xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_changes (filter (\<lambda>x. x \<noteq> (0::'a)) xs) = sign_changes xs
[PROOF STEP]
by (simp add: sign_changes_def filter_map o_def sgn_0_0)


[STATEMENT]
lemma Qp_int_pow_pow:
  fixes n::int
  fixes m::int
  assumes "a \<in> nonzero Q\<^sub>p"
  shows "(a[^](n*m)) = ((a[^]n)[^]m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] (n * m) = (a [^] n) [^] m
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a [^] (n * m) = (a [^] n) [^] m
[PROOF STEP]
have 0: "a \<in> carrier (units_of Q\<^sub>p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier (units_of Q\<^sub>p)
[PROOF STEP]
by (simp add: Units_eq_nonzero assms units_of_carrier)
[PROOF STATE]
proof (state)
this:
a \<in> carrier (units_of Q\<^sub>p)

goal (1 subgoal):
 1. a [^] (n * m) = (a [^] n) [^] m
[PROOF STEP]
have "group (units_of Q\<^sub>p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (units_of Q\<^sub>p)
[PROOF STEP]
using  monoid.units_group Qp.units_group
[PROOF STATE]
proof (prove)
using this:
Group.monoid ?G \<Longrightarrow> Group.group (units_of ?G)
Group.group (units_of Q\<^sub>p)

goal (1 subgoal):
 1. Group.group (units_of Q\<^sub>p)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Group.group (units_of Q\<^sub>p)

goal (1 subgoal):
 1. a [^] (n * m) = (a [^] n) [^] m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Group.group (units_of Q\<^sub>p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Group.group (units_of Q\<^sub>p)

goal (1 subgoal):
 1. a [^] (n * m) = (a [^] n) [^] m
[PROOF STEP]
using 0 group.int_pow_pow[of "units_of Q\<^sub>p"] Qp_int_pow_nonzero Qp_units_int_pow assms
[PROOF STATE]
proof (prove)
using this:
Group.group (units_of Q\<^sub>p)
a \<in> carrier (units_of Q\<^sub>p)
\<lbrakk>Group.group (units_of Q\<^sub>p); ?x \<in> carrier (units_of Q\<^sub>p)\<rbrakk> \<Longrightarrow> (?x [^]\<^bsub>units_of Q\<^sub>p\<^esub> ?n) [^]\<^bsub>units_of Q\<^sub>p\<^esub> ?m = ?x [^]\<^bsub>units_of Q\<^sub>p\<^esub> (?n * ?m)
?x \<in> nonzero Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> nonzero Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a [^] ?n = ?a [^]\<^bsub>units_of Q\<^sub>p\<^esub> ?n
a \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. a [^] (n * m) = (a [^] n) [^] m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a [^] (n * m) = (a [^] n) [^] m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cmult_le_mono: "\<lbrakk>\<kappa>' \<le> \<kappa>; \<mu>' \<le> \<mu>\<rbrakk> \<Longrightarrow> \<kappa>' \<otimes> \<mu>' \<le> \<kappa> \<otimes> \<mu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<kappa>' \<le> \<kappa>; \<mu>' \<le> \<mu>\<rbrakk> \<Longrightarrow> \<kappa>' \<otimes> \<mu>' \<le> \<kappa> \<otimes> \<mu>
[PROOF STEP]
unfolding cmult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<kappa>' \<le> \<kappa>; \<mu>' \<le> \<mu>\<rbrakk> \<Longrightarrow> vcard (vtimes \<kappa>' \<mu>') \<le> vcard (vtimes \<kappa> \<mu>)
[PROOF STEP]
by (auto simp: elts_VSigma intro!: lepoll_imp_Card_le times_lepoll_mono subset_imp_lepoll)


[STATEMENT]
lemma ring_mat_simps:
  "mult (ring_mat ty n b) = (*)"
  "add (ring_mat ty n b) = (+)"
  "one (ring_mat ty n b) = 1\<^sub>m n"
  "zero (ring_mat ty n b) = 0\<^sub>m n n"
  "carrier (ring_mat ty n b) = carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<otimes>\<^bsub>ring_mat ty n b\<^esub>) = (*) &&& (\<oplus>\<^bsub>ring_mat ty n b\<^esub>) = (+)) &&& \<one>\<^bsub>ring_mat ty n b\<^esub> = 1\<^sub>m n &&& \<zero>\<^bsub>ring_mat ty n b\<^esub> = 0\<^sub>m n n &&& carrier (ring_mat ty n b) = carrier_mat n n
[PROOF STEP]
unfolding ring_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<otimes>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub>) = (*) &&& (\<oplus>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub>) = (+)) &&& \<one>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> = 1\<^sub>m n &&& \<zero>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> = 0\<^sub>m n n &&& carrier \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr> = carrier_mat n n
[PROOF STEP]
by auto


[STATEMENT]
lemma is_tetrahedral_group: "group tetrahedral_group"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group tetrahedral_group
[PROOF STEP]
proof(rule groupI)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<one>\<^bsub>tetrahedral_group\<^esub> \<in> carrier tetrahedral_group
 3. \<And>x y z. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group; z \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z = x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)
 4. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<one>\<^bsub>tetrahedral_group\<^esub> \<otimes>\<^bsub>tetrahedral_group\<^esub> x = x
 5. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
show "\<one>\<^bsub>tetrahedral_group\<^esub> \<in> carrier tetrahedral_group"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>tetrahedral_group\<^esub> \<in> carrier tetrahedral_group
[PROOF STEP]
by (simp add: complex_rotations.intros(1) simple_rotations_def tetrahedral_group_def)
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>tetrahedral_group\<^esub> \<in> carrier tetrahedral_group

goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x y z. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group; z \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z = x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)
 3. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<one>\<^bsub>tetrahedral_group\<^esub> \<otimes>\<^bsub>tetrahedral_group\<^esub> x = x
 4. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x y z. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group; z \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z = x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)
 3. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<one>\<^bsub>tetrahedral_group\<^esub> \<otimes>\<^bsub>tetrahedral_group\<^esub> x = x
 4. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x y z. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group; z \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z = x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)
 3. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<one>\<^bsub>tetrahedral_group\<^esub> \<otimes>\<^bsub>tetrahedral_group\<^esub> x = x
 4. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
assume "x \<in> carrier tetrahedral_group"
[PROOF STATE]
proof (state)
this:
x \<in> carrier tetrahedral_group

goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x y z. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group; z \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z = x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)
 3. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<one>\<^bsub>tetrahedral_group\<^esub> \<otimes>\<^bsub>tetrahedral_group\<^esub> x = x
 4. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
show "\<one>\<^bsub>tetrahedral_group\<^esub> \<otimes>\<^bsub>tetrahedral_group\<^esub> x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>tetrahedral_group\<^esub> \<otimes>\<^bsub>tetrahedral_group\<^esub> x = x
[PROOF STEP]
unfolding id_comp tetrahedral_group_def monoid.select_convs(1) monoid.select_convs(2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>tetrahedral_group\<^esub> \<otimes>\<^bsub>tetrahedral_group\<^esub> x = x

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x y z. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group; z \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z = x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)
 3. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x y z. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group; z \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z = x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)
 3. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
fix x y z
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x y z. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group; z \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z = x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)
 3. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
assume "x \<in> carrier tetrahedral_group" and
    "y \<in> carrier tetrahedral_group" and
    "z \<in> carrier tetrahedral_group"
[PROOF STATE]
proof (state)
this:
x \<in> carrier tetrahedral_group
y \<in> carrier tetrahedral_group
z \<in> carrier tetrahedral_group

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x y z. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group; z \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z = x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)
 3. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier tetrahedral_group
y \<in> carrier tetrahedral_group
z \<in> carrier tetrahedral_group
[PROOF STEP]
show "x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z =
             x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier tetrahedral_group
y \<in> carrier tetrahedral_group
z \<in> carrier tetrahedral_group

goal (1 subgoal):
 1. x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z = x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)
[PROOF STEP]
unfolding tetrahedral_group_def monoid.select_convs(1)
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier \<lparr>carrier = complex_rotations, mult = (\<circ>), one = id\<rparr>
y \<in> carrier \<lparr>carrier = complex_rotations, mult = (\<circ>), one = id\<rparr>
z \<in> carrier \<lparr>carrier = complex_rotations, mult = (\<circ>), one = id\<rparr>

goal (1 subgoal):
 1. x \<circ> y \<circ> z = x \<circ> (y \<circ> z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<otimes>\<^bsub>tetrahedral_group\<^esub> z = x \<otimes>\<^bsub>tetrahedral_group\<^esub> (y \<otimes>\<^bsub>tetrahedral_group\<^esub> z)

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
assume "x \<in> carrier tetrahedral_group" and
    "y \<in> carrier tetrahedral_group"
[PROOF STATE]
proof (state)
this:
x \<in> carrier tetrahedral_group
y \<in> carrier tetrahedral_group

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier tetrahedral_group; y \<in> carrier tetrahedral_group\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
 2. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier tetrahedral_group
y \<in> carrier tetrahedral_group
[PROOF STEP]
show "x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier tetrahedral_group
y \<in> carrier tetrahedral_group

goal (1 subgoal):
 1. x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group
[PROOF STEP]
by (simp add: complex_rotations.intros(2) tetrahedral_group_def complex_rotations_comp)
[PROOF STATE]
proof (state)
this:
x \<otimes>\<^bsub>tetrahedral_group\<^esub> y \<in> carrier tetrahedral_group

goal (1 subgoal):
 1. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
assume "x \<in> carrier tetrahedral_group"
[PROOF STATE]
proof (state)
this:
x \<in> carrier tetrahedral_group

goal (1 subgoal):
 1. \<And>x. x \<in> carrier tetrahedral_group \<Longrightarrow> \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier tetrahedral_group
[PROOF STEP]
show "\<exists>y\<in>carrier tetrahedral_group.
            y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier tetrahedral_group

goal (1 subgoal):
 1. \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
using complex_rotations_inverses
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier tetrahedral_group
?r \<in> complex_rotations \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> ?r = id

goal (1 subgoal):
 1. \<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>
[PROOF STEP]
by (simp add: tetrahedral_group_def)
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>carrier tetrahedral_group. y \<otimes>\<^bsub>tetrahedral_group\<^esub> x = \<one>\<^bsub>tetrahedral_group\<^esub>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prob_sum:
  "s \<in> S \<Longrightarrow> Measurable.pred R.S P \<Longrightarrow> \<P>(\<omega> in T s. P \<omega>) = (\<Sum>t\<in>S. \<tau> s t * \<P>(\<omega> in T t. P (t ## \<omega>)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<in> S; Measurable.pred (stream_space (count_space UNIV)) P\<rbrakk> \<Longrightarrow> prob s P = (\<Sum>t\<in>S. \<tau> s t * prob t (\<lambda>\<omega>. P (t ## \<omega>)))
[PROOF STEP]
unfolding prob_T
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<in> S; Measurable.pred (stream_space (count_space UNIV)) P\<rbrakk> \<Longrightarrow> measure_pmf.expectation (K s) (\<lambda>t. prob t (\<lambda>\<omega>. P (t ## \<omega>))) = (\<Sum>t\<in>S. \<tau> s t * prob t (\<lambda>\<omega>. P (t ## \<omega>)))
[PROOF STEP]
using E_closed
[PROOF STATE]
proof (prove)
using this:
\<Union> (E ` S) \<subseteq> S

goal (1 subgoal):
 1. \<lbrakk>s \<in> S; Measurable.pred (stream_space (count_space UNIV)) P\<rbrakk> \<Longrightarrow> measure_pmf.expectation (K s) (\<lambda>t. prob t (\<lambda>\<omega>. P (t ## \<omega>))) = (\<Sum>t\<in>S. \<tau> s t * prob t (\<lambda>\<omega>. P (t ## \<omega>)))
[PROOF STEP]
by (subst integral_measure_pmf[OF finite_S]) (auto simp: mult.commute)


[STATEMENT]
lemma R_bb_assign: "g < (0::real) \<Longrightarrow> 0 \<le> h \<Longrightarrow>
  2 ::= (\<lambda>s. - s$2) \<le> Ref
    \<lceil>\<lambda>s. s$1 = 0 \<and> 0 \<le> s$1 \<and> 2 \<cdot> g \<cdot> s$1 = 2 \<cdot> g \<cdot> h + s$2 \<cdot> s$2\<rceil>
    \<lceil>\<lambda>s. 0 \<le> s$1 \<and> 2 \<cdot> g \<cdot> s$1 = 2 \<cdot> g \<cdot> h + s$2 \<cdot> s$2\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g < 0; 0 \<le> h\<rbrakk> \<Longrightarrow> (2::'a) ::= (\<lambda>s. - s $ (2::'a)) \<le> Ref \<lceil>\<lambda>s. s $ (1::'a) = 0 \<and> 0 \<le> s $ (1::'a) \<and> 2 \<cdot> g \<cdot> s $ (1::'a) = 2 \<cdot> g \<cdot> h + s $ (2::'a) \<cdot> s $ (2::'a)\<rceil> \<lceil>\<lambda>s. 0 \<le> s $ (1::'a) \<and> 2 \<cdot> g \<cdot> s $ (1::'a) = 2 \<cdot> g \<cdot> h + s $ (2::'a) \<cdot> s $ (2::'a)\<rceil>
[PROOF STEP]
by (rule R_assign_law, auto)


[STATEMENT]
lemma "x < 1 \<and> ((=) = (=)) \<Longrightarrow> ((=) = (=)) \<and> x < (2::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < 1 \<and> (=) = (=) \<Longrightarrow> (=) = (=) \<and> x < 2
[PROOF STEP]
by (metis nat_1_add_1 trans_less_add2)


[STATEMENT]
lemma disjnt_sym_asym_factor[simp]: "disjnt (sym_factor r) (asym_factor r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjnt (sym_factor r) (asym_factor r)
[PROOF STEP]
unfolding disjnt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym_factor r \<inter> asym_factor r = {}
[PROOF STEP]
unfolding sym_factor_def asym_factor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y). (x, y) \<in> r \<and> (y, x) \<in> r} \<inter> {(x, y). (x, y) \<in> r \<and> (y, x) \<notin> r} = {}
[PROOF STEP]
by blast


[STATEMENT]
lemma lst_at_delta:
  fixes f :: "'a::metric_space \<Rightarrow> ereal"
  shows "lsc_at x0 f \<longleftrightarrow> (\<forall>C<f(x0). \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y)"
    (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lsc_at x0 f = (\<forall>C<f x0. \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lsc_at x0 f = (\<forall>C<f x0. \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y)
[PROOF STEP]
have "?rhs \<longleftrightarrow> (\<forall>C<f(x0). \<exists>d>0. \<forall>y \<in> (ball x0 d). C < f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>C<f x0. \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y) = (\<forall>C<f x0. \<exists>d>0. \<forall>y\<in>ball x0 d. C < f y)
[PROOF STEP]
unfolding ball_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>C<f x0. \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y) = (\<forall>C<f x0. \<exists>d>0. \<forall>y\<in>{y. dist x0 y < d}. C < f y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<forall>C<f x0. \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y) = (\<forall>C<f x0. \<exists>d>0. \<forall>y\<in>ball x0 d. C < f y)

goal (1 subgoal):
 1. lsc_at x0 f = (\<forall>C<f x0. \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<forall>C<f x0. \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y) = (\<forall>C<f x0. \<exists>d>0. \<forall>y\<in>ball x0 d. C < f y)

goal (1 subgoal):
 1. lsc_at x0 f = (\<forall>C<f x0. \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y)
[PROOF STEP]
using lst_at_ball[of x0 f]
[PROOF STATE]
proof (prove)
using this:
(\<forall>C<f x0. \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y) = (\<forall>C<f x0. \<exists>d>0. \<forall>y\<in>ball x0 d. C < f y)
lsc_at x0 f = (\<forall>C<f x0. \<exists>d>0. \<forall>y\<in>ball x0 d. C < f y)

goal (1 subgoal):
 1. lsc_at x0 f = (\<forall>C<f x0. \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lsc_at x0 f = (\<forall>C<f x0. \<exists>d>0. \<forall>y. dist x0 y < d \<longrightarrow> C < f y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Finite_Graph) adjacent_nodes_finite[simp, intro!]: "finite (adjacent_nodes u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (adjacent_nodes u)
[PROOF STEP]
unfolding adjacent_nodes_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (E `` {u} \<union> E\<inverse> `` {u})
[PROOF STEP]
by (auto intro: finite_Image)


[STATEMENT]
lemma fps_middle_coeffs:
  assumes "prime p"
          "n \<noteq> 0 \<and> n \<noteq> p"
  shows "((1 + fps_X :: int fps) ^p) $ n mod p = 0 mod p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + fps_X) ^ p $ n mod int p = int (0 mod p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 + fps_X) ^ p $ n mod int p = int (0 mod p)
[PROOF STEP]
let ?f = "(1 + fps_X :: int fps)^p"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 + fps_X) ^ p $ n mod int p = int (0 mod p)
[PROOF STEP]
have "\<forall> n. n > 0 \<and> n < p \<longrightarrow> (p choose n) mod p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. 0 < n \<and> n < p \<longrightarrow> (p choose n) mod p = 0
[PROOF STEP]
using pn_choose_k_modp_0
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime ?p; 1 \<le> ?k \<and> ?k \<le> ?p ^ ?n - 1; 0 < ?n\<rbrakk> \<Longrightarrow> (?p ^ ?n choose ?k) mod ?p = 0

goal (1 subgoal):
 1. \<forall>n. 0 < n \<and> n < p \<longrightarrow> (p choose n) mod p = 0
[PROOF STEP]
by (metis (no_types, lifting) add_le_imp_le_diff assms(1) diff_diff_cancel diff_is_0_eq'
        discrete le_add_diff_inverse le_numeral_extra(4) power_one_right zero_le_one zero_less_one)
[PROOF STATE]
proof (state)
this:
\<forall>n. 0 < n \<and> n < p \<longrightarrow> (p choose n) mod p = 0

goal (1 subgoal):
 1. (1 + fps_X) ^ p $ n mod int p = int (0 mod p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. 0 < n \<and> n < p \<longrightarrow> (p choose n) mod p = 0
[PROOF STEP]
have middle_0: "\<forall> n. n > 0 \<and> n < p \<longrightarrow> (?f $ n) mod p = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 0 < n \<and> n < p \<longrightarrow> (p choose n) mod p = 0

goal (1 subgoal):
 1. \<forall>n. 0 < n \<and> n < p \<longrightarrow> (1 + fps_X) ^ p $ n mod int p = 0
[PROOF STEP]
using binomial_coeffs_induct
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 0 < n \<and> n < p \<longrightarrow> (p choose n) mod p = 0
(1 + fps_X) ^ ?n $ ?k = of_nat (?n choose ?k)

goal (1 subgoal):
 1. \<forall>n. 0 < n \<and> n < p \<longrightarrow> (1 + fps_X) ^ p $ n mod int p = 0
[PROOF STEP]
by (metis of_nat_0 zmod_int)
[PROOF STATE]
proof (state)
this:
\<forall>n. 0 < n \<and> n < p \<longrightarrow> (1 + fps_X) ^ p $ n mod int p = 0

goal (1 subgoal):
 1. (1 + fps_X) ^ p $ n mod int p = int (0 mod p)
[PROOF STEP]
have "\<forall> n. n > p \<longrightarrow> ?f $ n mod p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n>p. (1 + fps_X) ^ p $ n mod int p = 0
[PROOF STEP]
using binomial_eq_0_iff binomial_coeffs_induct mod_0
[PROOF STATE]
proof (prove)
using this:
(?n choose ?k = 0) = (?n < ?k)
(1 + fps_X) ^ ?n $ ?k = of_nat (?n choose ?k)
(0::?'a) mod ?a = (0::?'a)

goal (1 subgoal):
 1. \<forall>n>p. (1 + fps_X) ^ p $ n mod int p = 0
[PROOF STEP]
by (metis of_nat_eq_0_iff)
[PROOF STATE]
proof (state)
this:
\<forall>n>p. (1 + fps_X) ^ p $ n mod int p = 0

goal (1 subgoal):
 1. (1 + fps_X) ^ p $ n mod int p = int (0 mod p)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>n>p. (1 + fps_X) ^ p $ n mod int p = 0

goal (1 subgoal):
 1. (1 + fps_X) ^ p $ n mod int p = int (0 mod p)
[PROOF STEP]
using middle_0 assms(2) nat_neq_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>n>p. (1 + fps_X) ^ p $ n mod int p = 0
\<forall>n. 0 < n \<and> n < p \<longrightarrow> (1 + fps_X) ^ p $ n mod int p = 0
n \<noteq> 0 \<and> n \<noteq> p
(?m \<noteq> ?n) = (?m < ?n \<or> ?n < ?m)

goal (1 subgoal):
 1. (1 + fps_X) ^ p $ n mod int p = int (0 mod p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1 + fps_X) ^ p $ n mod int p = int (0 mod p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma temp_dyn_down_real_arith:
  assumes "a > 0" and Thyps: "0 < Tmin" "Tmin \<le> T" "T \<le> Tmax"
    and thyps: "0 \<le> (t::real)" "\<forall>\<tau>\<in>{0..t}. \<tau> \<le> - (ln (Tmin / T) / a) "
  shows "Tmin \<le> exp (-a * t) * T" and "exp (-a * t) * T \<le> Tmax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tmin \<le> exp (- a \<cdot> t) \<cdot> T &&& exp (- a \<cdot> t) \<cdot> T \<le> Tmax
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> t) \<cdot> T
 2. exp (- a \<cdot> t) \<cdot> T \<le> Tmax
[PROOF STEP]
have "0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)
[PROOF STEP]
using thyps
[PROOF STATE]
proof (prove)
using this:
0 \<le> t
\<forall>\<tau>\<in>{0..t}. \<tau> \<le> - (ln (Tmin / T) / a)

goal (1 subgoal):
 1. 0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)

goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> t) \<cdot> T
 2. exp (- a \<cdot> t) \<cdot> T \<le> Tmax
[PROOF STEP]
hence "ln (Tmin / T) \<le> - a * t \<and> - a * t \<le> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)

goal (1 subgoal):
 1. ln (Tmin / T) \<le> - a \<cdot> t \<and> - a \<cdot> t \<le> 0
[PROOF STEP]
using assms(1) divide_le_cancel
[PROOF STATE]
proof (prove)
using this:
0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)
0 < a
(?a / ?c \<le> ?b / ?c) = (((0::?'a) < ?c \<longrightarrow> ?a \<le> ?b) \<and> (?c < (0::?'a) \<longrightarrow> ?b \<le> ?a))

goal (1 subgoal):
 1. ln (Tmin / T) \<le> - a \<cdot> t \<and> - a \<cdot> t \<le> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
ln (Tmin / T) \<le> - a \<cdot> t \<and> - a \<cdot> t \<le> 0

goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> t) \<cdot> T
 2. exp (- a \<cdot> t) \<cdot> T \<le> Tmax
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (Tmin / T) \<le> - a \<cdot> t \<and> - a \<cdot> t \<le> 0

goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> t) \<cdot> T
 2. exp (- a \<cdot> t) \<cdot> T \<le> Tmax
[PROOF STEP]
have "Tmin / T > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Tmin / T
[PROOF STEP]
using Thyps
[PROOF STATE]
proof (prove)
using this:
0 < Tmin
Tmin \<le> T
T \<le> Tmax

goal (1 subgoal):
 1. 0 < Tmin / T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < Tmin / T

goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> t) \<cdot> T
 2. exp (- a \<cdot> t) \<cdot> T \<le> Tmax
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ln (Tmin / T) \<le> - a \<cdot> t \<and> - a \<cdot> t \<le> 0
0 < Tmin / T
[PROOF STEP]
have obs: "Tmin / T \<le> exp (-a * t)" "exp (-a * t) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
ln (Tmin / T) \<le> - a \<cdot> t \<and> - a \<cdot> t \<le> 0
0 < Tmin / T

goal (1 subgoal):
 1. Tmin / T \<le> exp (- a \<cdot> t) &&& exp (- a \<cdot> t) \<le> 1
[PROOF STEP]
using exp_ln exp_le_one_iff
[PROOF STATE]
proof (prove)
using this:
ln (Tmin / T) \<le> - a \<cdot> t \<and> - a \<cdot> t \<le> 0
0 < Tmin / T
0 < ?x \<Longrightarrow> exp (ln ?x) = ?x
(exp ?x \<le> 1) = (?x \<le> 0)

goal (1 subgoal):
 1. Tmin / T \<le> exp (- a \<cdot> t) &&& exp (- a \<cdot> t) \<le> 1
[PROOF STEP]
by (metis exp_less_cancel_iff not_less, simp)
[PROOF STATE]
proof (state)
this:
Tmin / T \<le> exp (- a \<cdot> t)
exp (- a \<cdot> t) \<le> 1

goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> t) \<cdot> T
 2. exp (- a \<cdot> t) \<cdot> T \<le> Tmax
[PROOF STEP]
thus "Tmin \<le> exp (-a * t) * T"
[PROOF STATE]
proof (prove)
using this:
Tmin / T \<le> exp (- a \<cdot> t)
exp (- a \<cdot> t) \<le> 1

goal (1 subgoal):
 1. Tmin \<le> exp (- a \<cdot> t) \<cdot> T
[PROOF STEP]
using Thyps
[PROOF STATE]
proof (prove)
using this:
Tmin / T \<le> exp (- a \<cdot> t)
exp (- a \<cdot> t) \<le> 1
0 < Tmin
Tmin \<le> T
T \<le> Tmax

goal (1 subgoal):
 1. Tmin \<le> exp (- a \<cdot> t) \<cdot> T
[PROOF STEP]
by (simp add: pos_divide_le_eq)
[PROOF STATE]
proof (state)
this:
Tmin \<le> exp (- a \<cdot> t) \<cdot> T

goal (1 subgoal):
 1. exp (- a \<cdot> t) \<cdot> T \<le> Tmax
[PROOF STEP]
show "exp (-a * t) * T \<le> Tmax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- a \<cdot> t) \<cdot> T \<le> Tmax
[PROOF STEP]
using Thyps mult_left_le_one_le[OF _ exp_ge_zero obs(2), of T]
      less_eq_real_def order_trans_rules(23)
[PROOF STATE]
proof (prove)
using this:
0 < Tmin
Tmin \<le> T
T \<le> Tmax
0 \<le> T \<Longrightarrow> exp (- a \<cdot> t) \<cdot> T \<le> T
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. exp (- a \<cdot> t) \<cdot> T \<le> Tmax
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
exp (- a \<cdot> t) \<cdot> T \<le> Tmax

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subgraph_antisym: "subgraph G G' \<Longrightarrow> subgraph G' G \<Longrightarrow> G = G'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>subgraph G G'; subgraph G' G\<rbrakk> \<Longrightarrow> G = G'
[PROOF STEP]
unfolding subgraph_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>uverts G \<subseteq> uverts G' \<and> uedges G \<subseteq> uedges G'; uverts G' \<subseteq> uverts G \<and> uedges G' \<subseteq> uedges G\<rbrakk> \<Longrightarrow> G = G'
[PROOF STEP]
by (auto simp add: Product_Type.prod_eqI)


[STATEMENT]
lemma hyp_minus_divide_eq_eq [divide_simps]:
  fixes a b c :: "('a :: {inverse, comm_ring_1, division_ring}) hyperdual"
  shows "- (b / c) = a \<longleftrightarrow> (if Base c \<noteq> 0 then - b = a * c else a = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (b / c) = a) = (if Base c \<noteq> (0::'a) then - b = a * c else a = 0)
[PROOF STEP]
by (metis hyp_divide_minus_left hyp_eq_divide_eq)


[STATEMENT]
lemma prime_square_sum_nat_decomp_eqI:
  assumes "prime p" "x ^ 2 + y ^ 2 = p" "x \<le> y"
  shows   "prime_square_sum_nat_decomp p = (x, y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
have "[gauss_int_norm (of_nat x + \<i>\<^sub>\<int> * of_nat y) \<noteq> 3] (mod 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [gauss_int_norm (of_nat x + \<i>\<^sub>\<int> * of_nat y) \<noteq> 3] (mod 4)
[PROOF STEP]
by (rule gauss_int_norm_not_3_mod_4)
[PROOF STATE]
proof (state)
this:
[gauss_int_norm (of_nat x + \<i>\<^sub>\<int> * of_nat y) \<noteq> 3] (mod 4)

goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[gauss_int_norm (of_nat x + \<i>\<^sub>\<int> * of_nat y) \<noteq> 3] (mod 4)

goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
have "gauss_int_norm (of_nat x + \<i>\<^sub>\<int> * of_nat y) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gauss_int_norm (of_nat x + \<i>\<^sub>\<int> * of_nat y) = p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p
x\<^sup>2 + y\<^sup>2 = p
x \<le> y

goal (1 subgoal):
 1. gauss_int_norm (of_nat x + \<i>\<^sub>\<int> * of_nat y) = p
[PROOF STEP]
by (auto simp: gauss_int_norm_def nat_add_distrib nat_power_eq)
[PROOF STATE]
proof (state)
this:
gauss_int_norm (of_nat x + \<i>\<^sub>\<int> * of_nat y) = p

goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
[p \<noteq> 3] (mod 4)
[PROOF STEP]
have "[p \<noteq> 3] (mod 4)"
[PROOF STATE]
proof (prove)
using this:
[p \<noteq> 3] (mod 4)

goal (1 subgoal):
 1. [p \<noteq> 3] (mod 4)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
[p \<noteq> 3] (mod 4)

goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
with prime_mod_4_cases[of p] assms
[PROOF STATE]
proof (chain)
picking this:
prime p \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
prime p
x\<^sup>2 + y\<^sup>2 = p
x \<le> y
[p \<noteq> 3] (mod 4)
[PROOF STEP]
have *: "p = 2 \<or> [p = 1] (mod 4)"
[PROOF STATE]
proof (prove)
using this:
prime p \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
prime p
x\<^sup>2 + y\<^sup>2 = p
x \<le> y
[p \<noteq> 3] (mod 4)

goal (1 subgoal):
 1. p = 2 \<or> [p = 1] (mod 4)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = 2 \<or> [p = 1] (mod 4)

goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
have "prime_square_sum_nat_decomp p = (THE (x,y). x \<le> y \<and> x ^ 2 + y ^ 2 = p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (THE (x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p)
[PROOF STEP]
using * \<open>prime p\<close>
[PROOF STATE]
proof (prove)
using this:
p = 2 \<or> [p = 1] (mod 4)
prime p

goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (THE (x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p)
[PROOF STEP]
by (simp add: prime_square_sum_nat_decomp_def)
[PROOF STATE]
proof (state)
this:
prime_square_sum_nat_decomp p = (THE (x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p)

goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prime_square_sum_nat_decomp p = (THE (x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p)

goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
have "\<dots> = (x, y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (THE (x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p) = (x, y)
[PROOF STEP]
proof (rule the1_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>!x. case x of (x, y) \<Rightarrow> x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
 2. case (x, y) of (x, y) \<Rightarrow> x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
show "\<exists>!(x,y). x \<le> y \<and> x ^ 2 + y ^ 2 = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
using \<open>prime p\<close> *
[PROOF STATE]
proof (prove)
using this:
prime p
p = 2 \<or> [p = 1] (mod 4)

goal (1 subgoal):
 1. \<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
by (rule prime_sum_of_squares_unique)
[PROOF STATE]
proof (state)
this:
\<exists>!(x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p

goal (1 subgoal):
 1. case (x, y) of (x, y) \<Rightarrow> x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p
[PROOF STEP]
qed (use assms in auto)
[PROOF STATE]
proof (state)
this:
(THE (x, y). x \<le> y \<and> x\<^sup>2 + y\<^sup>2 = p) = (x, y)

goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prime_square_sum_nat_decomp p = (x, y)

goal (1 subgoal):
 1. prime_square_sum_nat_decomp p = (x, y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
prime_square_sum_nat_decomp p = (x, y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma log2_lm1: "u > 0 \<Longrightarrow> u div 2 ^ (log2 u) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
assume A: "u > 0"
[PROOF STATE]
proof (state)
this:
0 < u

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < u
[PROOF STEP]
have S1: "2^(log2 u) \<le> u"
[PROOF STATE]
proof (prove)
using this:
0 < u

goal (1 subgoal):
 1. 2 ^ log2 u \<le> u
[PROOF STEP]
by (rule log2_le)
[PROOF STATE]
proof (state)
this:
2 ^ log2 u \<le> u

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
have S2: "u < 2^(log2 u+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u < 2 ^ (log2 u + 1)
[PROOF STEP]
by (rule log2_gt)
[PROOF STATE]
proof (state)
this:
u < 2 ^ (log2 u + 1)

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u < 2 ^ (log2 u + 1)
[PROOF STEP]
have S3: "u < (2^log2 u)*2"
[PROOF STATE]
proof (prove)
using this:
u < 2 ^ (log2 u + 1)

goal (1 subgoal):
 1. u < 2 ^ log2 u * 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u < 2 ^ log2 u * 2

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
have "(2::nat) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 2

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < 2
[PROOF STEP]
have "(2::nat)^log2 u > 0"
[PROOF STATE]
proof (prove)
using this:
0 < 2

goal (1 subgoal):
 1. 0 < 2 ^ log2 u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 2 ^ log2 u

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < 2 ^ log2 u
[PROOF STEP]
have S4: "(2::nat)^log2 u div 2^log2 u = 1"
[PROOF STATE]
proof (prove)
using this:
0 < 2 ^ log2 u

goal (1 subgoal):
 1. 2 ^ log2 u div 2 ^ log2 u = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ log2 u div 2 ^ log2 u = 1

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
from S1
[PROOF STATE]
proof (chain)
picking this:
2 ^ log2 u \<le> u
[PROOF STEP]
have S5: "(2::nat)^log2 u div 2^log2 u  \<le> u div 2^log2 u"
[PROOF STATE]
proof (prove)
using this:
2 ^ log2 u \<le> u

goal (1 subgoal):
 1. 2 ^ log2 u div 2 ^ log2 u \<le> u div 2 ^ log2 u
[PROOF STEP]
by (rule div_le_mono)
[PROOF STATE]
proof (state)
this:
2 ^ log2 u div 2 ^ log2 u \<le> u div 2 ^ log2 u

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
with S4
[PROOF STATE]
proof (chain)
picking this:
2 ^ log2 u div 2 ^ log2 u = 1
2 ^ log2 u div 2 ^ log2 u \<le> u div 2 ^ log2 u
[PROOF STEP]
have S6: "1 \<le> u div 2^log2 u"
[PROOF STATE]
proof (prove)
using this:
2 ^ log2 u div 2 ^ log2 u = 1
2 ^ log2 u div 2 ^ log2 u \<le> u div 2 ^ log2 u

goal (1 subgoal):
 1. 1 \<le> u div 2 ^ log2 u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> u div 2 ^ log2 u

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
from S3
[PROOF STATE]
proof (chain)
picking this:
u < 2 ^ log2 u * 2
[PROOF STEP]
have S7: "u div 2^log2 u < 2"
[PROOF STATE]
proof (prove)
using this:
u < 2 ^ log2 u * 2

goal (1 subgoal):
 1. u div 2 ^ log2 u < 2
[PROOF STEP]
by (rule div_lt)
[PROOF STATE]
proof (state)
this:
u div 2 ^ log2 u < 2

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u div 2 ^ log2 u = 1
[PROOF STEP]
from S6 S7
[PROOF STATE]
proof (chain)
picking this:
1 \<le> u div 2 ^ log2 u
u div 2 ^ log2 u < 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 \<le> u div 2 ^ log2 u
u div 2 ^ log2 u < 2

goal (1 subgoal):
 1. u div 2 ^ log2 u = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u div 2 ^ log2 u = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dlverts_eq_dverts_union': "dlverts t = (\<Union>x\<in> dverts t. set x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dlverts t = \<Union> (set ` dverts t)
[PROOF STEP]
using dlverts_eq_dverts_union
[PROOF STATE]
proof (prove)
using this:
dlverts ?t = \<Union> (set ` dverts ?t)

goal (1 subgoal):
 1. dlverts t = \<Union> (set ` dverts t)
[PROOF STEP]
by simp


[STATEMENT]
lemma le_imp_Ej_subset:
  assumes "u \<le>\<^sub>v x"
  shows "Ej j u \<subseteq> Ej j x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ej j u \<subseteq> Ej j x
[PROOF STEP]
using assms and le_trans
[PROOF STATE]
proof (prove)
using this:
u \<le>\<^sub>v x
\<lbrakk>?i \<le> ?j; ?j \<le> ?k\<rbrakk> \<Longrightarrow> ?i \<le> ?k

goal (1 subgoal):
 1. Ej j u \<subseteq> Ej j x
[PROOF STEP]
by (force simp: Ej_def less_eq_def dij_def eij_def)


[STATEMENT]
lemma finite_Label: "finite (UNIV :: (Label set))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite UNIV
[PROOF STEP]
by (simp add: Univ_abs_label finite_Label_set)


[STATEMENT]
lemma tendsto_power_int [tendsto_intros]:
  fixes a :: "'a::real_normed_div_algebra"
  assumes f: "(f \<longlongrightarrow> a) F"
    and a: "a \<noteq> 0"
  shows "((\<lambda>x. power_int (f x) n) \<longlongrightarrow> power_int a n) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x powi n) \<longlongrightarrow> a powi n) F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> a) F
a \<noteq> (0::'a)

goal (1 subgoal):
 1. ((\<lambda>x. f x powi n) \<longlongrightarrow> a powi n) F
[PROOF STEP]
by (cases n rule: int_cases4) (auto intro!: tendsto_intros simp: power_int_minus)


[STATEMENT]
lemma cong_solve_nat:
  fixes a :: nat
  shows "\<exists>x. [a * x = gcd a n] (mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. [a * x = gcd a n] (mod n)
[PROOF STEP]
proof (cases "a = 0 \<or> n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<or> n = 0 \<Longrightarrow> \<exists>x. [a * x = gcd a n] (mod n)
 2. \<not> (a = 0 \<or> n = 0) \<Longrightarrow> \<exists>x. [a * x = gcd a n] (mod n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = 0 \<or> n = 0

goal (2 subgoals):
 1. a = 0 \<or> n = 0 \<Longrightarrow> \<exists>x. [a * x = gcd a n] (mod n)
 2. \<not> (a = 0 \<or> n = 0) \<Longrightarrow> \<exists>x. [a * x = gcd a n] (mod n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = 0 \<or> n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = 0 \<or> n = 0

goal (1 subgoal):
 1. \<exists>x. [a * x = gcd a n] (mod n)
[PROOF STEP]
by (force simp add: cong_0_iff cong_sym)
[PROOF STATE]
proof (state)
this:
\<exists>x. [a * x = gcd a n] (mod n)

goal (1 subgoal):
 1. \<not> (a = 0 \<or> n = 0) \<Longrightarrow> \<exists>x. [a * x = gcd a n] (mod n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (a = 0 \<or> n = 0) \<Longrightarrow> \<exists>x. [a * x = gcd a n] (mod n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (a = 0 \<or> n = 0)

goal (1 subgoal):
 1. \<not> (a = 0 \<or> n = 0) \<Longrightarrow> \<exists>x. [a * x = gcd a n] (mod n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (a = 0 \<or> n = 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (a = 0 \<or> n = 0)

goal (1 subgoal):
 1. \<exists>x. [a * x = gcd a n] (mod n)
[PROOF STEP]
using bezout_nat [of a n]
[PROOF STATE]
proof (prove)
using this:
\<not> (a = 0 \<or> n = 0)
a \<noteq> 0 \<Longrightarrow> \<exists>x y. a * x = n * y + gcd a n

goal (1 subgoal):
 1. \<exists>x. [a * x = gcd a n] (mod n)
[PROOF STEP]
by auto (metis cong_add_rcancel_0_nat cong_mult_self_left)
[PROOF STATE]
proof (state)
this:
\<exists>x. [a * x = gcd a n] (mod n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_inverse [tendsto_intros]:
  fixes a :: "'a::real_normed_div_algebra"
  assumes f: "(f \<longlongrightarrow> a) F"
    and a: "a \<noteq> 0"
  shows "((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse a) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse a) F
[PROOF STEP]
from a
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
[PROOF STEP]
have "0 < norm a"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. 0 < norm a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < norm a

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse a) F
[PROOF STEP]
with f
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> a) F
0 < norm a
[PROOF STEP]
have "eventually (\<lambda>x. dist (f x) a < norm a) F"
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> a) F
0 < norm a

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. dist (f x) a < norm a
[PROOF STEP]
by (rule tendstoD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. dist (f x) a < norm a

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse a) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. dist (f x) a < norm a
[PROOF STEP]
have "eventually (\<lambda>x. f x \<noteq> 0) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. dist (f x) a < norm a

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x \<noteq> (0::'a)
[PROOF STEP]
unfolding dist_norm
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (f x - a) < norm a

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x \<noteq> (0::'a)
[PROOF STEP]
by (auto elim!: eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x \<noteq> (0::'a)

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse a) F
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
\<forall>\<^sub>F x in F. f x \<noteq> (0::'a)
[PROOF STEP]
have "eventually (\<lambda>x. inverse (f x) - inverse a =
    - (inverse (f x) * (f x - a) * inverse a)) F"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)
\<forall>\<^sub>F x in F. f x \<noteq> (0::'a)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. inverse (f x) - inverse a = - (inverse (f x) * (f x - a) * inverse a)
[PROOF STEP]
by (auto elim!: eventually_mono simp: inverse_diff_inverse)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. inverse (f x) - inverse a = - (inverse (f x) * (f x - a) * inverse a)

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse a) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. inverse (f x) - inverse a = - (inverse (f x) * (f x - a) * inverse a)

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse a) F
[PROOF STEP]
have "Zfun (\<lambda>x. - (inverse (f x) * (f x - a) * inverse a)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Zfun (\<lambda>x. - (inverse (f x) * (f x - a) * inverse a)) F
[PROOF STEP]
by (intro Zfun_minus Zfun_mult_left
      bounded_bilinear.Bfun_prod_Zfun [OF bounded_bilinear_mult]
      Bfun_inverse [OF f a] f [unfolded tendsto_Zfun_iff])
[PROOF STATE]
proof (state)
this:
Zfun (\<lambda>x. - (inverse (f x) * (f x - a) * inverse a)) F

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse a) F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. inverse (f x) - inverse a = - (inverse (f x) * (f x - a) * inverse a)
Zfun (\<lambda>x. - (inverse (f x) * (f x - a) * inverse a)) F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. inverse (f x) - inverse a = - (inverse (f x) * (f x - a) * inverse a)
Zfun (\<lambda>x. - (inverse (f x) * (f x - a) * inverse a)) F

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse a) F
[PROOF STEP]
unfolding tendsto_Zfun_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. inverse (f x) - inverse a = - (inverse (f x) * (f x - a) * inverse a)
Zfun (\<lambda>x. - (inverse (f x) * (f x - a) * inverse a)) F

goal (1 subgoal):
 1. Zfun (\<lambda>x. inverse (f x) - inverse a) F
[PROOF STEP]
by (rule Zfun_ssubst)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. inverse (f x)) \<longlongrightarrow> inverse a) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trivial_limit_at_right_real [simp]: "\<not> trivial_limit (at_right x)"
  for x :: "'a::{no_top,dense_order,linorder_topology}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_right x \<noteq> bot
[PROOF STEP]
using gt_ex[of x]
[PROOF STATE]
proof (prove)
using this:
\<exists>y. x < y

goal (1 subgoal):
 1. at_right x \<noteq> bot
[PROOF STEP]
by safe (auto simp add: trivial_limit_def eventually_at_right dest: dense)


[STATEMENT]
lemma hull_induct: "\<lbrakk>a \<in> Q hull S; \<And>x. x\<in> S \<Longrightarrow> P x; Q {x. P x}\<rbrakk> \<Longrightarrow> P a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> Q hull S; \<And>x. x \<in> S \<Longrightarrow> P x; Q {x. P x}\<rbrakk> \<Longrightarrow> P a
[PROOF STEP]
using hull_minimal[of S "{x. P x}" Q]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>S \<subseteq> {x. P x}; Q {x. P x}\<rbrakk> \<Longrightarrow> Q hull S \<subseteq> {x. P x}

goal (1 subgoal):
 1. \<lbrakk>a \<in> Q hull S; \<And>x. x \<in> S \<Longrightarrow> P x; Q {x. P x}\<rbrakk> \<Longrightarrow> P a
[PROOF STEP]
by (auto simp add: subset_eq)


[STATEMENT]
lemma piecewise_C1_differentiable_on_subset:
    "f piecewise_C1_differentiable_on S \<Longrightarrow> T \<le> S \<Longrightarrow> f piecewise_C1_differentiable_on T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f piecewise_C1_differentiable_on S; T \<subseteq> S\<rbrakk> \<Longrightarrow> f piecewise_C1_differentiable_on T
[PROOF STEP]
by (auto simp: piecewise_C1_differentiable_on_def elim!: continuous_on_subset C1_differentiable_on_subset)


[STATEMENT]
lemma rep_number_point_group_one:
  assumes "x \<in> \<V>"
  shows  "card {g \<in> \<G> . x \<in> g} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {g \<in> \<G>. x \<in> g} = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {g \<in> \<G>. x \<in> g} = 1
[PROOF STEP]
obtain g' where "g' \<in> \<G>" and "x \<in> g'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>g' \<in> \<G>; x \<in> g'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms point_has_unique_group
[PROOF STATE]
proof (prove)
using this:
x \<in> \<V>
?x \<in> \<V> \<Longrightarrow> \<exists>!G. ?x \<in> G \<and> G \<in> \<G>

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

goal (1 subgoal):
 1. card {g \<in> \<G>. x \<in> g} = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g' \<in> \<G>
x \<in> g'
[PROOF STEP]
have "{g \<in> \<G> . x \<in> g} = {g'}"
[PROOF STATE]
proof (prove)
using this:
g' \<in> \<G>
x \<in> g'

goal (1 subgoal):
 1. {g \<in> \<G>. x \<in> g} = {g'}
[PROOF STEP]
using  group_partitions partition_onD4
[PROOF STATE]
proof (prove)
using this:
g' \<in> \<G>
x \<in> g'
partition_on \<V> \<G>
\<lbrakk>partition_on ?A ?P; ?p \<in> ?P; ?q \<in> ?P; ?x \<in> ?p; ?x \<in> ?q\<rbrakk> \<Longrightarrow> ?p = ?q

goal (1 subgoal):
 1. {g \<in> \<G>. x \<in> g} = {g'}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{g \<in> \<G>. x \<in> g} = {g'}

goal (1 subgoal):
 1. card {g \<in> \<G>. x \<in> g} = 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{g \<in> \<G>. x \<in> g} = {g'}

goal (1 subgoal):
 1. card {g \<in> \<G>. x \<in> g} = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {g \<in> \<G>. x \<in> g} = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map2_sym: "(\<And>x y . f x y = f y x) \<Longrightarrow> map2 f xs ys = map2 f ys xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. f x y = f y x) \<Longrightarrow> map2 f xs ys = map2 f ys xs
[PROOF STEP]
proof (induction xs arbitrary: ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys. (\<And>x y. f x y = f y x) \<Longrightarrow> map2 f [] ys = map2 f ys []
 2. \<And>a xs ys. \<lbrakk>\<And>ys. (\<And>x y. f x y = f y x) \<Longrightarrow> map2 f xs ys = map2 f ys xs; \<And>x y. f x y = f y x\<rbrakk> \<Longrightarrow> map2 f (a # xs) ys = map2 f ys (a # xs)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
f ?x ?y = f ?y ?x

goal (2 subgoals):
 1. \<And>ys. (\<And>x y. f x y = f y x) \<Longrightarrow> map2 f [] ys = map2 f ys []
 2. \<And>a xs ys. \<lbrakk>\<And>ys. (\<And>x y. f x y = f y x) \<Longrightarrow> map2 f xs ys = map2 f ys xs; \<And>x y. f x y = f y x\<rbrakk> \<Longrightarrow> map2 f (a # xs) ys = map2 f ys (a # xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ?x ?y = f ?y ?x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f ?x ?y = f ?y ?x

goal (1 subgoal):
 1. map2 f [] ys = map2 f ys []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map2 f [] ys = map2 f ys []

goal (1 subgoal):
 1. \<And>a xs ys. \<lbrakk>\<And>ys. (\<And>x y. f x y = f y x) \<Longrightarrow> map2 f xs ys = map2 f ys xs; \<And>x y. f x y = f y x\<rbrakk> \<Longrightarrow> map2 f (a # xs) ys = map2 f ys (a # xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs ys. \<lbrakk>\<And>ys. (\<And>x y. f x y = f y x) \<Longrightarrow> map2 f xs ys = map2 f ys xs; \<And>x y. f x y = f y x\<rbrakk> \<Longrightarrow> map2 f (a # xs) ys = map2 f ys (a # xs)
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
(\<And>x y. f x y = f y x) \<Longrightarrow> map2 f xs ?ys = map2 f ?ys xs
f ?x ?y = f ?y ?x

goal (1 subgoal):
 1. \<And>a xs ys. \<lbrakk>\<And>ys. (\<And>x y. f x y = f y x) \<Longrightarrow> map2 f xs ys = map2 f ys xs; \<And>x y. f x y = f y x\<rbrakk> \<Longrightarrow> map2 f (a # xs) ys = map2 f ys (a # xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. f x y = f y x) \<Longrightarrow> map2 f xs ?ys = map2 f ?ys xs
f ?x ?y = f ?y ?x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. f x y = f y x) \<Longrightarrow> map2 f xs ?ys = map2 f ?ys xs
f ?x ?y = f ?y ?x

goal (1 subgoal):
 1. map2 f (a # xs) ys = map2 f ys (a # xs)
[PROOF STEP]
by (induction ys) auto
[PROOF STATE]
proof (state)
this:
map2 f (a # xs) ys = map2 f ys (a # xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cartesian_product_memI':
  assumes "A \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  assumes "B \<subseteq> carrier (R\<^bsup>m\<^esup>)"
  assumes "a \<in> A"
  assumes "b \<in> B"
  shows "a@b \<in> cartesian_product A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a @ b \<in> cartesian_product A B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier (R\<^bsup>n\<^esup>)
B \<subseteq> carrier (R\<^bsup>m\<^esup>)
a \<in> A
b \<in> B

goal (1 subgoal):
 1. a @ b \<in> cartesian_product A B
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier (R\<^bsup>n\<^esup>)
B \<subseteq> carrier (R\<^bsup>m\<^esup>)
a \<in> A
b \<in> B

goal (1 subgoal):
 1. a @ b \<in> {xs. \<exists>as\<in>A. \<exists>bs\<in>B. xs = as @ bs}
[PROOF STEP]
by blast


[STATEMENT]
lemma unique_identity1: "g\<in>G \<Longrightarrow> \<forall>x\<in>G. binop g x = x \<Longrightarrow> g = e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g \<in> G; \<forall>x\<in>G. binop g x = x\<rbrakk> \<Longrightarrow> g = e
[PROOF STEP]
using identity(1,2)
[PROOF STATE]
proof (prove)
using this:
e \<in> G
?g \<in> G \<Longrightarrow> binop ?g e = ?g

goal (1 subgoal):
 1. \<lbrakk>g \<in> G; \<forall>x\<in>G. binop g x = x\<rbrakk> \<Longrightarrow> g = e
[PROOF STEP]
by auto


[STATEMENT]
lemma Arg2pi_cnj_eq_inverse: "z\<noteq>0 \<Longrightarrow> Arg2pi (cnj z) = Arg2pi (inverse z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> Arg2pi (cnj z) = Arg2pi (inverse z)
[PROOF STEP]
apply (simp add: Arg2pi_eq_iff field_split_simps complex_norm_square [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> \<exists>x>0. (complex_of_real (cmod z))\<^sup>2 = complex_of_real x
[PROOF STEP]
by (metis of_real_power zero_less_norm_iff zero_less_power)


[STATEMENT]
lemma involut_comm_comp: assumes "f o f \<equiv> id" and "g o g \<equiv> id" and "f o g \<equiv> g o f"
  shows "(f \<circ> g) \<circ> (f \<circ> g) \<equiv> id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> g \<circ> (f \<circ> g) \<equiv> id
[PROOF STEP]
by (simp add: comp_assoc comp_assoc[symmetric] assms)


[STATEMENT]
lemma Sum_any_closed [intro]: "(\<And>x. f x \<in> A) \<Longrightarrow> Sum_any f \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. f x \<in> A) \<Longrightarrow> Sum_any f \<in> A
[PROOF STEP]
unfolding Sum_any.expand_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. f x \<in> A) \<Longrightarrow> sum f {a. f a \<noteq> (0::'a)} \<in> A
[PROOF STEP]
by (rule sum_closed)


[STATEMENT]
lemma p2r_eq_prop [simp]: "\<lceil>P\<rceil> = \<lceil>Q\<rceil> \<longleftrightarrow> (\<forall>s. P s \<longleftrightarrow>  Q s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>P\<rceil> = \<lceil>Q\<rceil>) = (\<forall>s. P s = Q s)
[PROOF STEP]
by (auto simp: p2r_def)


[STATEMENT]
lemma Ex_omega_sum: "\<gamma> \<in> elts (\<omega>\<up>n) \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<gamma> \<in> elts (\<omega> \<up> ord_of_nat n) \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = n
[PROOF STEP]
proof (induction n arbitrary: \<gamma>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<gamma>. \<gamma> \<in> elts (\<omega> \<up> ord_of_nat 0) \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = 0
 2. \<And>n \<gamma>. \<lbrakk>\<And>\<gamma>. \<gamma> \<in> elts (\<omega> \<up> ord_of_nat n) \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = n; \<gamma> \<in> elts (\<omega> \<up> ord_of_nat (Suc n))\<rbrakk> \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
\<gamma> \<in> elts (\<omega> \<up> ord_of_nat 0)

goal (2 subgoals):
 1. \<And>\<gamma>. \<gamma> \<in> elts (\<omega> \<up> ord_of_nat 0) \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = 0
 2. \<And>n \<gamma>. \<lbrakk>\<And>\<gamma>. \<gamma> \<in> elts (\<omega> \<up> ord_of_nat n) \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = n; \<gamma> \<in> elts (\<omega> \<up> ord_of_nat (Suc n))\<rbrakk> \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<gamma> \<in> elts (\<omega> \<up> ord_of_nat 0)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<gamma> \<in> elts (\<omega> \<up> ord_of_nat 0)

goal (1 subgoal):
 1. \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = 0
[PROOF STEP]
by (rule_tac x="[]" in exI) auto
[PROOF STATE]
proof (state)
this:
\<exists>ns. \<gamma> = omega_sum ns \<and> length ns = 0

goal (1 subgoal):
 1. \<And>n \<gamma>. \<lbrakk>\<And>\<gamma>. \<gamma> \<in> elts (\<omega> \<up> ord_of_nat n) \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = n; \<gamma> \<in> elts (\<omega> \<up> ord_of_nat (Suc n))\<rbrakk> \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n \<gamma>. \<lbrakk>\<And>\<gamma>. \<gamma> \<in> elts (\<omega> \<up> ord_of_nat n) \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = n; \<gamma> \<in> elts (\<omega> \<up> ord_of_nat (Suc n))\<rbrakk> \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
?\<gamma> \<in> elts (\<omega> \<up> ord_of_nat n) \<Longrightarrow> \<exists>ns. ?\<gamma> = omega_sum ns \<and> length ns = n
\<gamma> \<in> elts (\<omega> \<up> ord_of_nat (Suc n))

goal (1 subgoal):
 1. \<And>n \<gamma>. \<lbrakk>\<And>\<gamma>. \<gamma> \<in> elts (\<omega> \<up> ord_of_nat n) \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = n; \<gamma> \<in> elts (\<omega> \<up> ord_of_nat (Suc n))\<rbrakk> \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?\<gamma> \<in> elts (\<omega> \<up> ord_of_nat n) \<Longrightarrow> \<exists>ns. ?\<gamma> = omega_sum ns \<and> length ns = n
\<gamma> \<in> elts (\<omega> \<up> ord_of_nat (Suc n))
[PROOF STEP]
obtain k::nat where k: "\<gamma> \<in> elts (\<omega> \<up> n * k)"
       and kmin: "\<And>k'. k'<k \<Longrightarrow> \<gamma> \<notin> elts (\<omega> \<up> n * k')"
[PROOF STATE]
proof (prove)
using this:
?\<gamma> \<in> elts (\<omega> \<up> ord_of_nat n) \<Longrightarrow> \<exists>ns. ?\<gamma> = omega_sum ns \<and> length ns = n
\<gamma> \<in> elts (\<omega> \<up> ord_of_nat (Suc n))

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>\<gamma> \<in> elts (\<omega> \<up> ord_of_nat n * ord_of_nat k); \<And>k'. k' < k \<Longrightarrow> \<gamma> \<notin> elts (\<omega> \<up> ord_of_nat n * ord_of_nat k')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Ord_ord_of_nat elts_mult_\<omega>E oexp_succ ord_of_nat.simps(2))
[PROOF STATE]
proof (state)
this:
\<gamma> \<in> elts (\<omega> \<up> ord_of_nat n * ord_of_nat k)
?k' < k \<Longrightarrow> \<gamma> \<notin> elts (\<omega> \<up> ord_of_nat n * ord_of_nat ?k')

goal (1 subgoal):
 1. \<And>n \<gamma>. \<lbrakk>\<And>\<gamma>. \<gamma> \<in> elts (\<omega> \<up> ord_of_nat n) \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = n; \<gamma> \<in> elts (\<omega> \<up> ord_of_nat (Suc n))\<rbrakk> \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
proof (cases k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
 2. \<And>nat. k = Suc nat \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
case (Suc k')
[PROOF STATE]
proof (state)
this:
k = Suc k'

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
 2. \<And>nat. k = Suc nat \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = Suc k'
[PROOF STEP]
obtain \<delta> where \<delta>: "\<gamma> = (\<omega> \<up> n * k') + \<delta>"
[PROOF STATE]
proof (prove)
using this:
k = Suc k'

goal (1 subgoal):
 1. (\<And>\<delta>. \<gamma> = \<omega> \<up> ord_of_nat n * ord_of_nat k' + \<delta> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis lessI mult_succ ord_of_nat.simps(2) k kmin mem_plus_V_E)
[PROOF STATE]
proof (state)
this:
\<gamma> = \<omega> \<up> ord_of_nat n * ord_of_nat k' + \<delta>

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
 2. \<And>nat. k = Suc nat \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<gamma> = \<omega> \<up> ord_of_nat n * ord_of_nat k' + \<delta>
[PROOF STEP]
have \<delta>in: "\<delta> \<in> elts (\<omega> \<up> n)"
[PROOF STATE]
proof (prove)
using this:
\<gamma> = \<omega> \<up> ord_of_nat n * ord_of_nat k' + \<delta>

goal (1 subgoal):
 1. \<delta> \<in> elts (\<omega> \<up> ord_of_nat n)
[PROOF STEP]
using Suc k mult_succ
[PROOF STATE]
proof (prove)
using this:
\<gamma> = \<omega> \<up> ord_of_nat n * ord_of_nat k' + \<delta>
k = Suc k'
\<gamma> \<in> elts (\<omega> \<up> ord_of_nat n * ord_of_nat k)
?x * ZFC_in_HOL.succ ?y = ?x * ?y + ?x

goal (1 subgoal):
 1. \<delta> \<in> elts (\<omega> \<up> ord_of_nat n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<delta> \<in> elts (\<omega> \<up> ord_of_nat n)

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
 2. \<And>nat. k = Suc nat \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<delta> \<in> elts (\<omega> \<up> ord_of_nat n)
[PROOF STEP]
obtain ns where ns: "\<delta> = omega_sum ns" and len: "length ns = n"
[PROOF STATE]
proof (prove)
using this:
\<delta> \<in> elts (\<omega> \<up> ord_of_nat n)

goal (1 subgoal):
 1. (\<And>ns. \<lbrakk>\<delta> = omega_sum ns; length ns = n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Suc.IH
[PROOF STATE]
proof (prove)
using this:
\<delta> \<in> elts (\<omega> \<up> ord_of_nat n)
?\<gamma> \<in> elts (\<omega> \<up> ord_of_nat n) \<Longrightarrow> \<exists>ns. ?\<gamma> = omega_sum ns \<and> length ns = n

goal (1 subgoal):
 1. (\<And>ns. \<lbrakk>\<delta> = omega_sum ns; length ns = n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<delta> = omega_sum ns
length ns = n

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
 2. \<And>nat. k = Suc nat \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<delta> = omega_sum ns
length ns = n

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
 2. \<And>nat. k = Suc nat \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
have "omega_sum ns < \<omega>\<up>n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. omega_sum ns < \<omega> \<up> ord_of_nat n
[PROOF STEP]
using OrdmemD ns \<delta>in
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Ord ?k; ?j \<in> elts ?k\<rbrakk> \<Longrightarrow> ?j < ?k
\<delta> = omega_sum ns
\<delta> \<in> elts (\<omega> \<up> ord_of_nat n)

goal (1 subgoal):
 1. omega_sum ns < \<omega> \<up> ord_of_nat n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
omega_sum ns < \<omega> \<up> ord_of_nat n

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
 2. \<And>nat. k = Suc nat \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<delta> = omega_sum ns
length ns = n
omega_sum ns < \<omega> \<up> ord_of_nat n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<delta> = omega_sum ns
length ns = n
omega_sum ns < \<omega> \<up> ord_of_nat n

goal (1 subgoal):
 1. \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
by (rule_tac x="k'#ns" in exI) (simp add: \<delta>)
[PROOF STATE]
proof (state)
this:
\<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n

goal (1 subgoal):
 1. k = 0 \<Longrightarrow> \<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n
[PROOF STEP]
qed (use k in auto)
[PROOF STATE]
proof (state)
this:
\<exists>ns. \<gamma> = omega_sum ns \<and> length ns = Suc n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_eq_take_le_eq:
  "\<lbrakk> take n xs = take n ys; m \<le> n \<rbrakk> \<Longrightarrow> take m xs = take m ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>take n xs = take n ys; m \<le> n\<rbrakk> \<Longrightarrow> take m xs = take m ys
[PROOF STEP]
by(metis min.absorb_iff1 take_take)


[STATEMENT]
lemma dghm_cn_comp_ObjMap_vrange:
  assumes "\<GG> : \<BB> \<^sub>D\<^sub>G\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<^sub>D\<^sub>G\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "\<R>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<GG> : op_dg \<BB> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<CC>
\<FF> : op_dg \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<GG> \<^sub>D\<^sub>G\<^sub>H\<^sub>M\<circ> \<FF>)\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
by
    (
      cs_concl cs_shallow
        cs_simp: dghm_cn_comp_components
        cs_intro: is_dghm.dghm_ObjMap_vrange V_cs_intros
    )


[STATEMENT]
lemma derivation_shift_append:
  "derivation_shift (A@B) left right =
    (derivation_shift A left right) @ (derivation_shift B left right)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. derivation_shift (A @ B) left right = derivation_shift A left right @ derivation_shift B left right
[PROOF STEP]
by (induct A, simp+)


[STATEMENT]
lemma cartesian_product_closed:
  assumes "A \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  assumes "B \<subseteq> carrier (R\<^bsup>m\<^esup>)"
  shows "cartesian_product A B \<subseteq> carrier (R\<^bsup>n + m\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A B \<subseteq> carrier (R\<^bsup>n + m\<^esup>)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A B \<Longrightarrow> x \<in> carrier (R\<^bsup>n + m\<^esup>)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A B \<Longrightarrow> x \<in> carrier (R\<^bsup>n + m\<^esup>)
[PROOF STEP]
assume A: "x \<in> cartesian_product A B "
[PROOF STATE]
proof (state)
this:
x \<in> cartesian_product A B

goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A B \<Longrightarrow> x \<in> carrier (R\<^bsup>n + m\<^esup>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> cartesian_product A B
[PROOF STEP]
obtain as bs where as_bs_def: "x = as@bs \<and> as \<in> A \<and> bs \<in> B"
[PROOF STATE]
proof (prove)
using this:
x \<in> cartesian_product A B

goal (1 subgoal):
 1. (\<And>as bs. x = as @ bs \<and> as \<in> A \<and> bs \<in> B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {xs. \<exists>as\<in>A. \<exists>bs\<in>B. xs = as @ bs}

goal (1 subgoal):
 1. (\<And>as bs. x = as @ bs \<and> as \<in> A \<and> bs \<in> B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = as @ bs \<and> as \<in> A \<and> bs \<in> B

goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A B \<Longrightarrow> x \<in> carrier (R\<^bsup>n + m\<^esup>)
[PROOF STEP]
show "x \<in> carrier (R\<^bsup>n + m\<^esup>) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier (R\<^bsup>n + m\<^esup>)
[PROOF STEP]
apply(rule cartesian_power_car_memI')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length x = n + m
 2. \<And>i. i < n + m \<Longrightarrow> x ! i \<in> carrier R
[PROOF STEP]
apply (metis as_bs_def assms cartesian_power_car_memE length_append subsetD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < n + m \<Longrightarrow> x ! i \<in> carrier R
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
x \<in> cartesian_product A B

goal (1 subgoal):
 1. \<And>i. i < n + m \<Longrightarrow> x ! i \<in> carrier R
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {xs. \<exists>as\<in>A. \<exists>bs\<in>B. xs = as @ bs}

goal (1 subgoal):
 1. \<And>i. i < n + m \<Longrightarrow> x ! i \<in> carrier R
[PROOF STEP]
by (metis (no_types, lifting) add_diff_inverse_nat as_bs_def assms(1)
        assms(2) cartesian_power_car_memE cartesian_power_car_memE'
        nat_add_left_cancel_less nth_append subsetD)
[PROOF STATE]
proof (state)
this:
x \<in> carrier (R\<^bsup>n + m\<^esup>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma winding_number_cong:
   "(\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> p t = q t) \<Longrightarrow> winding_number p z = winding_number q z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> p t = q t) \<Longrightarrow> winding_number p z = winding_number q z
[PROOF STEP]
by (simp add: winding_number_def winding_number_prop_def pathstart_def pathfinish_def)


[STATEMENT]
theorem quot_function:
  assumes "\<And>X Y. f X Y \<equiv> g (pick X) (pick Y)"
    and "\<And>x x' y y'. \<lfloor>x\<rfloor> = \<lfloor>x'\<rfloor> \<Longrightarrow> \<lfloor>y\<rfloor> = \<lfloor>y'\<rfloor> \<Longrightarrow> g x y = g x' y'"
  shows "f \<lfloor>a\<rfloor> \<lfloor>b\<rfloor> = g a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<lfloor>a\<rfloor> \<lfloor>b\<rfloor> = g a b
[PROOF STEP]
using assms and TrueI
[PROOF STATE]
proof (prove)
using this:
f ?X ?Y \<equiv> g (pick ?X) (pick ?Y)
\<lbrakk>\<lfloor>?x\<rfloor> = \<lfloor>?x'\<rfloor>; \<lfloor>?y\<rfloor> = \<lfloor>?y'\<rfloor>\<rbrakk> \<Longrightarrow> g ?x ?y = g ?x' ?y'
True

goal (1 subgoal):
 1. f \<lfloor>a\<rfloor> \<lfloor>b\<rfloor> = g a b
[PROOF STEP]
by (rule quot_cond_function)


[STATEMENT]
lemma add_mono_comm:
  fixes a :: 'a
  shows "c \<le> d \<Longrightarrow> c + a \<le> d + a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<le> d \<Longrightarrow> c + a \<le> d + a
[PROOF STEP]
by (auto simp: add.commute add_mono)


[STATEMENT]
lemma skip_im_Tr4:"\<lbrakk>x \<le> Suc n; 0 < x\<rbrakk> \<Longrightarrow> x - Suc 0 \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> Suc n; 0 < x\<rbrakk> \<Longrightarrow> x - Suc 0 \<le> n
[PROOF STEP]
apply (simp add:Suc_le_mono [of "x - Suc 0" "n", THEN sym])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma normalize_quot_id: "x \<in> normalized_fracts \<Longrightarrow> normalize_quot x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> normalized_fracts \<Longrightarrow> normalize_quot x = x
[PROOF STEP]
by (auto simp: normalized_fracts_def normalize_quot_def case_prod_unfold)


[STATEMENT]
lemma wf_less_multiset: "wf {(M :: 'a multiset, N). M < N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(M, N). M < N}
[PROOF STEP]
unfolding less_multiset_def multp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(M, N). (M, N) \<in> mult {(x, y). x < y}}
[PROOF STEP]
by (auto intro: wf_mult wf)


[STATEMENT]
lemma if_unfold_left: "((if a then b else c) = d) = ((a\<longrightarrow> b = d) \<and> (\<not> a \<longrightarrow> c = d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if a then b else c) = d) = ((a \<longrightarrow> b = d) \<and> (\<not> a \<longrightarrow> c = d))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma util_def_conf: "x \<in> carrier \<Longrightarrow> y \<in> carrier \<Longrightarrow> u x \<ge> u y \<longleftrightarrow> x \<succeq>[relation] y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> (u y \<le> u x) = x \<succeq>[relation] y
[PROOF STEP]
using util_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier; ?y \<in> carrier\<rbrakk> \<Longrightarrow> ?x \<succeq>[relation] ?y = (u ?y \<le> u ?x)

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> (u y \<le> u x) = x \<succeq>[relation] y
[PROOF STEP]
by blast


[STATEMENT]
theorem for_rec2_eq:
  "for_rec2 f a n n n =
     nfoldli [0..<n + 1] (\<lambda>x. True)
           (\<lambda>i. nfoldli [0..<n + 1] (\<lambda>x. True) (\<lambda>j a. f a i j)) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. for_rec2 f a n n n = nfoldli [0..<n + 1] (\<lambda>x. True) (\<lambda>i. nfoldli [0..<n + 1] (\<lambda>x. True) (\<lambda>j a. f a i j)) a
[PROOF STEP]
using
  for_rec2'_for_rec[
    unfolded for_rec2_for_rec2'[symmetric], unfolded for_comb_for_rec[symmetric] for_comb_def
  ]
[PROOF STATE]
proof (prove)
using this:
for_rec2 ?f ?a ?n ?n ?n = nfoldli [0..<?n + 1] (\<lambda>x. True) (\<lambda>k. nfoldli [0..<?n + 1] (\<lambda>x. True) (\<lambda>ka a. ?f a k ka)) ?a

goal (1 subgoal):
 1. for_rec2 f a n n n = nfoldli [0..<n + 1] (\<lambda>x. True) (\<lambda>i. nfoldli [0..<n + 1] (\<lambda>x. True) (\<lambda>j a. f a i j)) a
[PROOF STEP]
.


[STATEMENT]
lemma in_JF2rel:
  "JF2rel R x y \<longleftrightarrow> (\<exists> z. z \<in> JF2in (Collect (case_prod R)) \<and> JF2map fst z = x \<and> JF2map snd z = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. JF2rel R x y = (\<exists>z. z \<in> JF2in {(x, y). R x y} \<and> JF2map fst z = x \<and> JF2map snd z = y)
[PROOF STEP]
by (rule predicate2_eqD[OF trans[OF JF2rel_def OO_Grp_alt]])


[STATEMENT]
lemma mat_inv_r:
  assumes "mat_det A \<noteq> 0"
  shows "A *\<^sub>m\<^sub>m (mat_inv A) = eye"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>m\<^sub>m mat_inv A = eye
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat_det A \<noteq> 0

goal (1 subgoal):
 1. A *\<^sub>m\<^sub>m mat_inv A = eye
[PROOF STEP]
proof (cases A, auto simp add: field_simps)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix a b c d :: complex
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))"
[PROOF STATE]
proof (state)
this:
a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))

goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "(a*d - b*c)*(a*d - b*c) = 0"
[PROOF STATE]
proof (prove)
using this:
a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))

goal (1 subgoal):
 1. (a * d - b * c) * (a * d - b * c) = 0
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(a * d - b * c) * (a * d - b * c) = 0

goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence *: "a*d - b*c = 0"
[PROOF STATE]
proof (prove)
using this:
(a * d - b * c) * (a * d - b * c) = 0

goal (1 subgoal):
 1. a * d - b * c = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * d - b * c = 0

goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "a*d \<noteq> b*c"
[PROOF STATE]
proof (state)
this:
a * d \<noteq> b * c

goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
a * d - b * c = 0
a * d \<noteq> b * c
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
a * d - b * c = 0
a * d \<noteq> b * c

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma maxim_Int: "\<lbrakk>finite A; A \<noteq> {}; A \<subseteq> Field r; maxim A \<in> B\<rbrakk> \<Longrightarrow> maxim (A \<inter> B) = maxim A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}; A \<subseteq> Field r; maxim A \<in> B\<rbrakk> \<Longrightarrow> maxim (A \<inter> B) = maxim A
[PROOF STEP]
by (rule maxim_equality) (auto simp: isMaxim_def intro: maxim_in maxim_greatest)


[STATEMENT]
lemma DERIV_chain_s:
  assumes "(\<And>x. x \<in> s \<Longrightarrow> DERIV g x :> g'(x))"
    and "DERIV f x :> f'"
    and "f x \<in> s"
  shows "DERIV (\<lambda>x. g(f x)) x :> f' * g'(f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. g (f x)) has_field_derivative f' * g' (f x)) (at x)
[PROOF STEP]
by (metis (full_types) DERIV_chain' mult.commute assms)


[STATEMENT]
lemma prime_sum_upto_eq_0:
  assumes "x < 2"
  shows   "prime_sum_upto f x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_sum_upto f x = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prime_sum_upto f x = (0::'a)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x < 2
[PROOF STEP]
have "nat \<lfloor>x\<rfloor> = 0 \<or> nat \<lfloor>x\<rfloor> = 1"
[PROOF STATE]
proof (prove)
using this:
x < 2

goal (1 subgoal):
 1. nat \<lfloor>x\<rfloor> = 0 \<or> nat \<lfloor>x\<rfloor> = 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
nat \<lfloor>x\<rfloor> = 0 \<or> nat \<lfloor>x\<rfloor> = 1

goal (1 subgoal):
 1. prime_sum_upto f x = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
nat \<lfloor>x\<rfloor> = 0 \<or> nat \<lfloor>x\<rfloor> = 1

goal (1 subgoal):
 1. prime_sum_upto f x = (0::'a)
[PROOF STEP]
by (auto simp: eval_prime_sum_upto)
[PROOF STATE]
proof (state)
this:
prime_sum_upto f x = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_vebt_minNull: "invar_vebt t n \<Longrightarrow> minNull t \<longleftrightarrow> set_vebt t = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt t n \<Longrightarrow> minNull t = (set_vebt t = {})
[PROOF STEP]
by (metis VEBT_internal.minNullmin VEBT_internal.minminNull VEBT_internal.mint_corr_help_empty VEBT_internal.set_vebt_set_vebt'_valid vebt_inst.set_vebt_mint'')


[STATEMENT]
lemma deg_monom [simp]:
  "[| a \<noteq> \<zero>; a \<in> carrier R |] ==> deg R (monom P a n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<noteq> \<zero>; a \<in> carrier R\<rbrakk> \<Longrightarrow> deg R (monom P a n) = n
[PROOF STEP]
by (fastforce intro: le_antisym deg_aboveI deg_belowI)


[STATEMENT]
lemma smallomega_1_iff:
  "eventually_nonneg F f \<Longrightarrow> f \<in> \<omega>[F](\<lambda>_. 1 :: real) \<longleftrightarrow> filterlim f at_top F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonneg F f \<Longrightarrow> (f \<in> \<omega>[F](\<lambda>_. 1)) = filterlim f at_top F
[PROOF STEP]
by (simp add: filterlim_at_top_iff_smallomega)


[STATEMENT]
lemma map_comp: "map_spmf f (map_spmf g p) = map_spmf (f \<circ> g) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf f (map_spmf g p) = map_spmf (f \<circ> g) p
[PROOF STEP]
by(simp add: pmf.map_comp o_def option.map_comp)


[STATEMENT]
lemma mset_merge [simp]:
  "mset (merge xs ys) = mset xs + mset ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (merge xs ys) = mset xs + mset ys
[PROOF STEP]
by (induct xs ys rule: merge.induct) (simp_all add: ac_simps)


[STATEMENT]
lemma unvis_empty: "unvisited_verts u {a. u \<rightarrow>\<^sup>* a} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unvisited_verts u {a. u \<rightarrow>\<^sup>* a} = {}
[PROOF STEP]
unfolding unvisited_verts_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> verts G - Collect (reachable G u). u \<rightarrow>\<^sup>* x} = {}
[PROOF STEP]
by auto


[STATEMENT]
theorem wls_subst_Var_simp1[simp]:
assumes "wls (asSort ys) Y"
and "ys \<noteq> xs \<or> y \<noteq> x "
shows "((Var xs x) #[Y / y]_ys) = Var xs x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Var xs x #[Y / y]_ys = Var xs x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls (asSort ys) Y
ys \<noteq> xs \<or> y \<noteq> x

goal (1 subgoal):
 1. Var xs x #[Y / y]_ys = Var xs x
[PROOF STEP]
unfolding subst_def
[PROOF STATE]
proof (prove)
using this:
wls (asSort ys) Y
ys \<noteq> xs \<or> y \<noteq> x

goal (1 subgoal):
 1. Var xs x #[idEnv [y \<leftarrow> Y]_ys] = Var xs x
[PROOF STEP]
by auto


[STATEMENT]
lemma dvd_imp_order_le: "q \<noteq> 0 \<Longrightarrow> p dvd q \<Longrightarrow> Polynomial.order a p \<le> Polynomial.order a q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>q \<noteq> 0; p dvd q\<rbrakk> \<Longrightarrow> order a p \<le> order a q
[PROOF STEP]
by (auto simp: order_mult)


[STATEMENT]
lemma wf_less_multiset: "wf {(M :: 'a multiset, N). M < N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(M, N). M < N}
[PROOF STEP]
unfolding less_multiset_def multp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(M, N). (M, N) \<in> mult {(x, y). x < y}}
[PROOF STEP]
by (auto intro: wf_mult wf)


[STATEMENT]
lemma is_derivationI:
  "is_derivation X p"
  if "linear_diff_fun X"
    "\<And>f g. f \<in> diff_fun_space \<Longrightarrow> g \<in> diff_fun_space \<Longrightarrow> X (f * g) = f p * X g + g p * X f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_derivation X p
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
linear_on diff_fun_space UNIV (*\<^sub>R) (*\<^sub>R) X
\<lbrakk>?f3 \<in> diff_fun_space; ?g3 \<in> diff_fun_space\<rbrakk> \<Longrightarrow> X (?f3 * ?g3) = ?f3 p * X ?g3 + ?g3 p * X ?f3

goal (1 subgoal):
 1. is_derivation X p
[PROOF STEP]
unfolding is_derivation_def
[PROOF STATE]
proof (prove)
using this:
linear_on diff_fun_space UNIV (*\<^sub>R) (*\<^sub>R) X
\<lbrakk>?f3 \<in> diff_fun_space; ?g3 \<in> diff_fun_space\<rbrakk> \<Longrightarrow> X (?f3 * ?g3) = ?f3 p * X ?g3 + ?g3 p * X ?f3

goal (1 subgoal):
 1. linear_on diff_fun_space UNIV (*\<^sub>R) (*\<^sub>R) X \<and> (\<forall>f g. f \<in> diff_fun_space \<longrightarrow> g \<in> diff_fun_space \<longrightarrow> X (f * g) = f p * X g + g p * X f)
[PROOF STEP]
by blast


[STATEMENT]
theorem Range: "Elem y (Range f) = (\<exists>x. Elem (Opair x y) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Elem y (HOLZF.Range f) = (\<exists>x. Elem (Opair x y) f)
[PROOF STEP]
apply (auto simp add: Range_def Replacement)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>isOpair x; Elem x f; y = Snd x\<rbrakk> \<Longrightarrow> \<exists>xa. Elem (Opair xa (Snd x)) f
 2. \<And>x. Elem (Opair x y) f \<Longrightarrow> \<exists>x. (isOpair x \<longrightarrow> Elem x f \<and> Snd x = y) \<and> isOpair x
[PROOF STEP]
apply (rule_tac x="Fst x" in exI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>isOpair x; Elem x f; y = Snd x\<rbrakk> \<Longrightarrow> Elem (Opair (Fst x) (Snd x)) f
 2. \<And>x. Elem (Opair x y) f \<Longrightarrow> \<exists>x. (isOpair x \<longrightarrow> Elem x f \<and> Snd x = y) \<and> isOpair x
[PROOF STEP]
apply (simp add: FstSnd)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. Elem (Opair x y) f \<Longrightarrow> \<exists>x. (isOpair x \<longrightarrow> Elem x f \<and> Snd x = y) \<and> isOpair x
[PROOF STEP]
apply (rule_tac x="Opair x y" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. Elem (Opair x y) f \<Longrightarrow> (isOpair (Opair x y) \<longrightarrow> Elem (Opair x y) f \<and> Snd (Opair x y) = y) \<and> isOpair (Opair x y)
[PROOF STEP]
apply (simp add: isOpair Snd)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma OrdP_IN_SUCC_D_lemma: "{OrdP x, SUCC y IN SUCC x} \<turnstile> y IN x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {OrdP x, SUCC y IN SUCC x} \<turnstile> y IN x
[PROOF STEP]
apply (rule OrdP_linear [of _ "x" "y"], auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. {OrdP x, SUCC y IN SUCC x} \<turnstile> OrdP y
 2. {x IN y, OrdP x, SUCC y IN SUCC x} \<turnstile> y IN x
 3. {x EQ y, OrdP x, SUCC y IN SUCC x} \<turnstile> y IN x
[PROOF STEP]
apply (metis Assume AssumeH(2) Mem_SUCC_Refl OrdP_SUCC_I Ord_IN_Ord)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x IN y, OrdP x, SUCC y IN SUCC x} \<turnstile> y IN x
 2. {x EQ y, OrdP x, SUCC y IN SUCC x} \<turnstile> y IN x
[PROOF STEP]
apply (metis Assume EQ_imp_SUBS Mem_Eats_EH(2) Mem_SUCC_Refl OrdP_Mem_imp_Subset SUCC_def Subset_D thin1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x EQ y, OrdP x, SUCC y IN SUCC x} \<turnstile> y IN x
[PROOF STEP]
by (meson Assume EQ_imp_SUBS Mem_SUCC_E Mem_SUCC_Refl OrdP_Mem_imp_Subset Subset_D rotate3)