[STATEMENT]
lemma nn_transfer_operator_sum:
  assumes [measurable]: "f \<in> borel_measurable M" "g \<in> borel_measurable M"
  shows "AE x in M. nn_transfer_operator (\<lambda>x. f x + g x) x = nn_transfer_operator f x + nn_transfer_operator g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. nn_transfer_operator (\<lambda>x. f x + g x) x = nn_transfer_operator f x + nn_transfer_operator g x
[PROOF STEP]
proof (rule nn_transfer_operator_charact)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
assume [measurable]: "A \<in> sets M"
[PROOF STATE]
proof (state)
this:
A \<in> sets M

goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
have "(\<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M) =
        (\<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x + indicator A x * nn_transfer_operator g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x + indicator A x * nn_transfer_operator g x \<partial>M
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x + indicator A x * nn_transfer_operator g x \<partial>M

goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x + indicator A x * nn_transfer_operator g x \<partial>M

goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
have "... = (\<integral>\<^sup>+x. indicator A x * nn_transfer_operator f x \<partial>M) + (\<integral>\<^sup>+x. indicator A x * nn_transfer_operator g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x + indicator A x * nn_transfer_operator g x \<partial>M = \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x \<partial>M + \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator g x \<partial>M
[PROOF STEP]
by (rule nn_integral_add, auto)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x + indicator A x * nn_transfer_operator g x \<partial>M = \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x \<partial>M + \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator g x \<partial>M

goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x + indicator A x * nn_transfer_operator g x \<partial>M = \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x \<partial>M + \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator g x \<partial>M

goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
have "... = (\<integral>\<^sup>+x. indicator A (T x) * f x \<partial>M) + (\<integral>\<^sup>+x. indicator A (T x) * g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x \<partial>M + \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator g x \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * f x \<partial>M + \<integral>\<^sup>+ x. indicator A (T x) * g x \<partial>M
[PROOF STEP]
by (simp add: nn_transfer_operator_intg)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x \<partial>M + \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator g x \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * f x \<partial>M + \<integral>\<^sup>+ x. indicator A (T x) * g x \<partial>M

goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator A x * nn_transfer_operator f x \<partial>M + \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator g x \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * f x \<partial>M + \<integral>\<^sup>+ x. indicator A (T x) * g x \<partial>M

goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
have "... = (\<integral>\<^sup>+x. indicator A (T x) * f x + indicator A (T x) * g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. indicator A (T x) * f x \<partial>M + \<integral>\<^sup>+ x. indicator A (T x) * g x \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * f x + indicator A (T x) * g x \<partial>M
[PROOF STEP]
by (rule nn_integral_add[symmetric], auto)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator A (T x) * f x \<partial>M + \<integral>\<^sup>+ x. indicator A (T x) * g x \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * f x + indicator A (T x) * g x \<partial>M

goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator A (T x) * f x \<partial>M + \<integral>\<^sup>+ x. indicator A (T x) * g x \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * f x + indicator A (T x) * g x \<partial>M

goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
have "... = (\<integral>\<^sup>+x. indicator A (T x) * (f x + g x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. indicator A (T x) * f x + indicator A (T x) * g x \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator A (T x) * f x + indicator A (T x) * g x \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M

goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
 2. (\<lambda>x. f x + g x) \<in> borel_measurable M
 3. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
[PROOF STEP]
show "(\<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M) = (\<integral>\<^sup>+x. indicator A (T x) * (f x + g x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. indicator A x * (nn_transfer_operator f x + nn_transfer_operator g x) \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * (f x + g x) \<partial>M

goal (2 subgoals):
 1. (\<lambda>x. f x + g x) \<in> borel_measurable M
 2. (\<lambda>x. nn_transfer_operator f x + nn_transfer_operator g x) \<in> borel_measurable M
[PROOF STEP]
qed (auto simp add: assms)


[STATEMENT]
lemma bounded_real: "bounded (S::real set) \<longleftrightarrow> (\<exists>a. \<forall>x\<in>S. \<bar>x\<bar> \<le> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S = (\<exists>a. \<forall>x\<in>S. \<bar>x\<bar> \<le> a)
[PROOF STEP]
by (simp add: bounded_iff)


[STATEMENT]
lemma coprimeI_power_mod:
  fixes x r n :: nat
  assumes "x ^ r mod n = 1" "r \<noteq> 0" "n \<noteq> 0"
  shows "coprime x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime x n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coprime x n
[PROOF STEP]
have "coprime (x ^ r mod n) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (x ^ r mod n) n
[PROOF STEP]
using coprime_1_right \<open>x ^ r mod n = 1\<close>
[PROOF STATE]
proof (prove)
using this:
coprime ?a (1::?'a)
x ^ r mod n = 1

goal (1 subgoal):
 1. coprime (x ^ r mod n) n
[PROOF STEP]
by (simp add: coprime_commute)
[PROOF STATE]
proof (state)
this:
coprime (x ^ r mod n) n

goal (1 subgoal):
 1. coprime x n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
coprime (x ^ r mod n) n

goal (1 subgoal):
 1. coprime x n
[PROOF STEP]
using \<open>r \<noteq> 0\<close> \<open>n \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
coprime (x ^ r mod n) n
r \<noteq> 0
n \<noteq> 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem find_path_halving:
  "VARS p y
  [ find_set_precondition p x \<and> p0 = p ]
  y := x;
  WHILE y \<noteq> p[[y]]
    INV { path_halving_invariant p x y p0 }
    VAR { (p\<^sup>T\<^sup>\<star> * y)\<down> }
     DO p[y] := p[[p[[y]]]];
        y := p[[y]]
     OD
  [ path_halving_postcondition p x y p0 ]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [find_set_precondition p x \<and> p0 = p]
y := x; WHILE y \<noteq> p[[y]] INV {path_halving_invariant p x y p0}  VAR {(p\<^sup>T\<^sup>\<star> * y)\<down>}
DO p := (p[y\<longmapsto>p[[p[[y]]]]]); y := p[[y]] OD
[path_halving_postcondition p x y p0]
[PROOF STEP]
apply vcg_tc_simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. find_set_precondition p0 x \<Longrightarrow> path_halving_invariant p0 x x p0
 2. \<And>p y. path_halving_invariant p x y p0 \<and> y \<noteq> p[[y]] \<Longrightarrow> path_halving_invariant (p[y\<longmapsto>p[[p[[y]]]]]) x ((p[y\<longmapsto>p[[p[[y]]]]])[[y]]) p0 \<and> ((p[y\<longmapsto>p[[p[[y]]]]])\<^sup>T\<^sup>\<star> * ((p[y\<longmapsto>p[[p[[y]]]]])[[y]]))\<down> < (p\<^sup>T\<^sup>\<star> * y)\<down>
 3. \<And>p y. path_halving_invariant p x y p0 \<and> y = p[[y]] \<Longrightarrow> path_halving_postcondition p x y p0
[PROOF STEP]
apply (fact path_halving_1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>p y. path_halving_invariant p x y p0 \<and> y \<noteq> p[[y]] \<Longrightarrow> path_halving_invariant (p[y\<longmapsto>p[[p[[y]]]]]) x ((p[y\<longmapsto>p[[p[[y]]]]])[[y]]) p0 \<and> ((p[y\<longmapsto>p[[p[[y]]]]])\<^sup>T\<^sup>\<star> * ((p[y\<longmapsto>p[[p[[y]]]]])[[y]]))\<down> < (p\<^sup>T\<^sup>\<star> * y)\<down>
 2. \<And>p y. path_halving_invariant p x y p0 \<and> y = p[[y]] \<Longrightarrow> path_halving_postcondition p x y p0
[PROOF STEP]
apply (fact path_halving_2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p y. path_halving_invariant p x y p0 \<and> y = p[[y]] \<Longrightarrow> path_halving_postcondition p x y p0
[PROOF STEP]
by (fact path_halving_3)


[STATEMENT]
lemma path_graph_cong:
  "\<lbrakk>path g\<^sub>1 u p v; set p \<subseteq> edges g\<^sub>1 \<Longrightarrow> set p \<subseteq> edges g\<^sub>2\<rbrakk> \<Longrightarrow> path g\<^sub>2 u p v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path g\<^sub>1 u p v; set p \<subseteq> edges g\<^sub>1 \<Longrightarrow> set p \<subseteq> edges g\<^sub>2\<rbrakk> \<Longrightarrow> path g\<^sub>2 u p v
[PROOF STEP]
apply (frule path_edges; simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path g\<^sub>1 u p v; set p \<subseteq> edges g\<^sub>2; set p \<subseteq> edges g\<^sub>1\<rbrakk> \<Longrightarrow> path g\<^sub>2 u p v
[PROOF STEP]
apply (induction p arbitrary: u)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>u. \<lbrakk>path g\<^sub>1 u [] v; set [] \<subseteq> edges g\<^sub>2; set [] \<subseteq> edges g\<^sub>1\<rbrakk> \<Longrightarrow> path g\<^sub>2 u [] v
 2. \<And>a p u. \<lbrakk>\<And>u. \<lbrakk>path g\<^sub>1 u p v; set p \<subseteq> edges g\<^sub>2; set p \<subseteq> edges g\<^sub>1\<rbrakk> \<Longrightarrow> path g\<^sub>2 u p v; path g\<^sub>1 u (a # p) v; set (a # p) \<subseteq> edges g\<^sub>2; set (a # p) \<subseteq> edges g\<^sub>1\<rbrakk> \<Longrightarrow> path g\<^sub>2 u (a # p) v
[PROOF STEP]
by auto


[STATEMENT]
lemma resultant_zero_imp_common_factor:
  fixes p q :: "'a :: ufd poly"
  assumes deg: "degree p > 0 \<or> degree q > 0" and r0: "resultant p q = 0"
  shows "\<not> coprime p q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
unfolding neq0_conv[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
assume degp: "degree p > 0" and degq: "degree q > 0"
[PROOF STATE]
proof (state)
this:
0 < degree p
0 < degree q

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
assume cop: "coprime p q"
[PROOF STATE]
proof (state)
this:
comm_monoid_mult_class.coprime p q

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
obtain p' q' where "p' * p + q' * q = 0"
      and p': "degree p' < degree q" and q': "degree q' < degree p"
      and p'0: "p' \<noteq> 0" and q'0: "q' \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p' q'. \<lbrakk>p' * p + q' * q = 0; degree p' < degree q; degree q' < degree p; p' \<noteq> 0; q' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using resultant_as_nonzero_poly[OF degp degq] r0
[PROOF STATE]
proof (prove)
using this:
\<exists>p' q'. degree p' < degree q \<and> degree q' < degree p \<and> [:resultant p q:] = p' * p + q' * q \<and> p' \<noteq> 0 \<and> q' \<noteq> 0
resultant p q = (0::'a)

goal (1 subgoal):
 1. (\<And>p' q'. \<lbrakk>p' * p + q' * q = 0; degree p' < degree q; degree q' < degree p; p' \<noteq> 0; q' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p' * p + q' * q = 0
degree p' < degree q
degree q' < degree p
p' \<noteq> 0
q' \<noteq> 0

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
hence "p' * p = - q' * q"
[PROOF STATE]
proof (prove)
using this:
p' * p + q' * q = 0
degree p' < degree q
degree q' < degree p
p' \<noteq> 0
q' \<noteq> 0

goal (1 subgoal):
 1. p' * p = - q' * q
[PROOF STEP]
by (simp add: eq_neg_iff_add_eq_0)
[PROOF STATE]
proof (state)
this:
p' * p = - q' * q

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
from some_gcd.coprime_mult_cross_dvd[OF cop this]
[PROOF STATE]
proof (chain)
picking this:
p dvd - q'
q dvd p'
[PROOF STEP]
have "p dvd q'"
[PROOF STATE]
proof (prove)
using this:
p dvd - q'
q dvd p'

goal (1 subgoal):
 1. p dvd q'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p dvd q'

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
from dvd_imp_degree_le[OF this q'0]
[PROOF STATE]
proof (chain)
picking this:
degree p \<le> degree q'
[PROOF STEP]
have "degree p \<le> degree q'"
[PROOF STATE]
proof (prove)
using this:
degree p \<le> degree q'

goal (1 subgoal):
 1. degree p \<le> degree q'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree p \<le> degree q'

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
degree p \<le> degree q'

goal (1 subgoal):
 1. False
[PROOF STEP]
using q'
[PROOF STATE]
proof (prove)
using this:
degree p \<le> degree q'
degree q' < degree p

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

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < degree p; 0 < degree q; comm_monoid_mult_class.coprime p q\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < degree p; 0 < degree q; comm_monoid_mult_class.coprime p q\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < degree p; 0 < degree q; comm_monoid_mult_class.coprime p q\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
assume degp: "degree p = 0"
[PROOF STATE]
proof (state)
this:
degree p = 0

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree p = 0
[PROOF STEP]
obtain x where "p = [:x:]"
[PROOF STATE]
proof (prove)
using this:
degree p = 0

goal (1 subgoal):
 1. (\<And>x. p = [:x:] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim degree_eq_zeroE)
[PROOF STATE]
proof (state)
this:
p = [:x:]

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p = [:x:]

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
hence "resultant p q = x ^ degree q"
[PROOF STATE]
proof (prove)
using this:
p = [:x:]

goal (1 subgoal):
 1. resultant p q = x ^ degree q
[PROOF STEP]
using resultant_const
[PROOF STATE]
proof (prove)
using this:
p = [:x:]
resultant [:?a:] ?q = ?a ^ degree ?q
resultant ?p [:?a:] = ?a ^ degree ?p

goal (1 subgoal):
 1. resultant p q = x ^ degree q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
resultant p q = x ^ degree q

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
hence "x = 0"
[PROOF STATE]
proof (prove)
using this:
resultant p q = x ^ degree q

goal (1 subgoal):
 1. x = (0::'a)
[PROOF STEP]
using r0
[PROOF STATE]
proof (prove)
using this:
resultant p q = x ^ degree q
resultant p q = (0::'a)

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

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p = [:x:]
x = (0::'a)
[PROOF STEP]
have "p = 0"
[PROOF STATE]
proof (prove)
using this:
p = [:x:]
x = (0::'a)

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

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
hence ?thesis
[PROOF STATE]
proof (prove)
using this:
p = 0

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
unfolding not_coprime_iff_common_factor
[PROOF STATE]
proof (prove)
using this:
p = 0

goal (1 subgoal):
 1. \<exists>r. r dvd p \<and> r dvd q \<and> \<not> r dvd 1
[PROOF STEP]
by (metis deg degp dvd_0_right dvd_refl less_numeral_extra(3) poly_dvd_1)
[PROOF STATE]
proof (state)
this:
\<not> comm_monoid_mult_class.coprime p q

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
degree p = 0 \<Longrightarrow> \<not> comm_monoid_mult_class.coprime p q

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
degree p = 0 \<Longrightarrow> \<not> comm_monoid_mult_class.coprime p q

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
degree p = 0 \<Longrightarrow> \<not> comm_monoid_mult_class.coprime p q

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
assume degq: "degree q = 0"
[PROOF STATE]
proof (state)
this:
degree q = 0

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree q = 0
[PROOF STEP]
obtain x where "q = [:x:]"
[PROOF STATE]
proof (prove)
using this:
degree q = 0

goal (1 subgoal):
 1. (\<And>x. q = [:x:] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim degree_eq_zeroE)
[PROOF STATE]
proof (state)
this:
q = [:x:]

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
q = [:x:]

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
hence "resultant p q = x ^ degree p"
[PROOF STATE]
proof (prove)
using this:
q = [:x:]

goal (1 subgoal):
 1. resultant p q = x ^ degree p
[PROOF STEP]
using resultant_const
[PROOF STATE]
proof (prove)
using this:
q = [:x:]
resultant [:?a:] ?q = ?a ^ degree ?q
resultant ?p [:?a:] = ?a ^ degree ?p

goal (1 subgoal):
 1. resultant p q = x ^ degree p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
resultant p q = x ^ degree p

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
hence "x = 0"
[PROOF STATE]
proof (prove)
using this:
resultant p q = x ^ degree p

goal (1 subgoal):
 1. x = (0::'a)
[PROOF STEP]
using r0
[PROOF STATE]
proof (prove)
using this:
resultant p q = x ^ degree p
resultant p q = (0::'a)

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

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
q = [:x:]
x = (0::'a)
[PROOF STEP]
have "q = 0"
[PROOF STATE]
proof (prove)
using this:
q = [:x:]
x = (0::'a)

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

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
hence ?thesis
[PROOF STATE]
proof (prove)
using this:
q = 0

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
unfolding not_coprime_iff_common_factor
[PROOF STATE]
proof (prove)
using this:
q = 0

goal (1 subgoal):
 1. \<exists>r. r dvd p \<and> r dvd q \<and> \<not> r dvd 1
[PROOF STEP]
by (metis deg degq dvd_0_right dvd_refl less_numeral_extra(3) poly_dvd_1)
[PROOF STATE]
proof (state)
this:
\<not> comm_monoid_mult_class.coprime p q

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
degree q = 0 \<Longrightarrow> \<not> comm_monoid_mult_class.coprime p q

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < degree p; 0 < degree q; comm_monoid_mult_class.coprime p q\<rbrakk> \<Longrightarrow> False
degree p = 0 \<Longrightarrow> \<not> comm_monoid_mult_class.coprime p q
degree q = 0 \<Longrightarrow> \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < degree p; 0 < degree q; comm_monoid_mult_class.coprime p q\<rbrakk> \<Longrightarrow> False
degree p = 0 \<Longrightarrow> \<not> comm_monoid_mult_class.coprime p q
degree q = 0 \<Longrightarrow> \<not> comm_monoid_mult_class.coprime p q

goal (1 subgoal):
 1. \<not> comm_monoid_mult_class.coprime p q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> comm_monoid_mult_class.coprime p q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma UNION_disjoint_family:
  assumes "finite I" and "\<forall>i\<in>I. finite (A i)"
    and "disjoint_family_on A I"
  shows "F g (\<Union>(A ` I)) = F (\<lambda>x. F g (A x)) I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F g (\<Union> (A ` I)) = F (\<lambda>x. F g (A x)) I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
\<forall>i\<in>I. finite (A i)
disjoint_family_on A I

goal (1 subgoal):
 1. F g (\<Union> (A ` I)) = F (\<lambda>x. F g (A x)) I
[PROOF STEP]
unfolding disjoint_family_on_def
[PROOF STATE]
proof (prove)
using this:
finite I
\<forall>i\<in>I. finite (A i)
\<forall>m\<in>I. \<forall>n\<in>I. m \<noteq> n \<longrightarrow> A m \<inter> A n = {}

goal (1 subgoal):
 1. F g (\<Union> (A ` I)) = F (\<lambda>x. F g (A x)) I
[PROOF STEP]
by (rule UNION_disjoint)


[STATEMENT]
lemma zip_eq_zip_same_len[simp]:
  "\<lbrakk> length a = length b; length a' = length b' \<rbrakk> \<Longrightarrow>
  zip a b = zip a' b' \<longleftrightarrow> a=a' \<and> b=b'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length a = length b; length a' = length b'\<rbrakk> \<Longrightarrow> (zip a b = zip a' b') = (a = a' \<and> b = b')
[PROOF STEP]
by (auto dest: zip_inj)


[STATEMENT]
lemma emeasure_spmf_of_pmf [simp]: "emeasure (measure_spmf (spmf_of_pmf p)) A = emeasure (measure_pmf p) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_spmf (spmf_of_pmf p)) A = emeasure (measure_pmf p) A
[PROOF STEP]
by(simp add: emeasure_measure_spmf_conv_measure_pmf spmf_of_pmf_def inj_vimage_image_eq)


[STATEMENT]
lemma iMin_union_inter: "A \<inter> B \<noteq> {} \<Longrightarrow> min (iMin (A \<union> B)) (iMin (A \<inter> B)) = min (iMin A) (iMin B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> B \<noteq> {} \<Longrightarrow> min (iMin (A \<union> B)) (iMin (A \<inter> B)) = min (iMin A) (iMin B)
[PROOF STEP]
by (metis Int_empty_left Int_lower2 Un_absorb2 Un_assoc Un_empty iMin_Un)


[STATEMENT]
lemma orthogonal_mult:
  assumes "orthogonal a b"
  shows "orthogonal (x *\<^sub>R a) (y *\<^sub>R b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal (x *\<^sub>R a) (y *\<^sub>R b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
orthogonal a b

goal (1 subgoal):
 1. orthogonal (x *\<^sub>R a) (y *\<^sub>R b)
[PROOF STEP]
unfolding orthogonal_def
[PROOF STATE]
proof (prove)
using this:
a \<bullet> b = 0

goal (1 subgoal):
 1. x *\<^sub>R a \<bullet> y *\<^sub>R b = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma intersect_nodes_finite:
    assumes "finite (DBTA.nodes A)" "finite (DBTA.nodes B)"
    shows "finite (DBTA.nodes (intersect A B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (DBTA.nodes (intersect A B))
[PROOF STEP]
using intersect'_nodes_finite assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (DBTA.nodes ?A); finite (DBTA.nodes ?B)\<rbrakk> \<Longrightarrow> finite (DGBTA.nodes (intersect' ?A ?B))
finite (DBTA.nodes A)
finite (DBTA.nodes B)

goal (1 subgoal):
 1. finite (DBTA.nodes (intersect A B))
[PROOF STEP]
by simp


[STATEMENT]
lemma powreal_mult_base:
  assumes "0 \<le> a" and "0 \<le> b"
  shows "(a * b) pow\<^sub>\<real> x = (a pow\<^sub>\<real> x) * (b pow\<^sub>\<real> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
[PROOF STEP]
proof (cases "a \<ge> 1 \<and> b \<ge> 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 \<le> a \<and> 1 \<le> b \<Longrightarrow> (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
 2. \<not> (1 \<le> a \<and> 1 \<le> b) \<Longrightarrow> (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
1 \<le> a \<and> 1 \<le> b

goal (2 subgoals):
 1. 1 \<le> a \<and> 1 \<le> b \<Longrightarrow> (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
 2. \<not> (1 \<le> a \<and> 1 \<le> b) \<Longrightarrow> (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> a \<and> 1 \<le> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 \<le> a \<and> 1 \<le> b

goal (1 subgoal):
 1. (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
[PROOF STEP]
by (simp add: powreal_mult_base_lemma1)
[PROOF STATE]
proof (state)
this:
(a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x

goal (1 subgoal):
 1. \<not> (1 \<le> a \<and> 1 \<le> b) \<Longrightarrow> (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (1 \<le> a \<and> 1 \<le> b) \<Longrightarrow> (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (1 \<le> a \<and> 1 \<le> b)

goal (1 subgoal):
 1. \<not> (1 \<le> a \<and> 1 \<le> b) \<Longrightarrow> (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (1 \<le> a \<and> 1 \<le> b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (1 \<le> a \<and> 1 \<le> b)

goal (1 subgoal):
 1. (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
[PROOF STEP]
using powreal_mult_base_lemma3 powreal_mult_base_lemma2 assms
[PROOF STATE]
proof (prove)
using this:
\<not> (1 \<le> a \<and> 1 \<le> b)
\<lbrakk>0 < ?a; ?a < 1; 0 < ?b; ?b < 1\<rbrakk> \<Longrightarrow> (?a * ?b) pow\<^sub>\<real> ?x = ?a pow\<^sub>\<real> ?x * ?b pow\<^sub>\<real> ?x
\<lbrakk>1 \<le> ?a; 0 < ?b; ?b < 1\<rbrakk> \<Longrightarrow> (?a * ?b) pow\<^sub>\<real> ?x = ?a pow\<^sub>\<real> ?x * ?b pow\<^sub>\<real> ?x
0 \<le> a
0 \<le> b

goal (1 subgoal):
 1. (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
[PROOF STEP]
by (smt (verit) mult.commute mult_minus_left powreal_def)
[PROOF STATE]
proof (state)
this:
(a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smaps_over_un:
  assumes "m1 \<in> smaps_over A B" and "m2 \<in> smaps_over A B"
  shows "m1 \<union>. m2 \<in> smaps_over A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m1 \<union>. m2 \<in> smaps_over A B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m1 \<in> smaps_over A B
m2 \<in> smaps_over A B

goal (1 subgoal):
 1. m1 \<union>. m2 \<in> smaps_over A B
[PROOF STEP]
unfolding smaps_over_def
[PROOF STATE]
proof (prove)
using this:
m1 \<in> {m. sdom m \<subseteq> A \<and> sran m \<subseteq> B}
m2 \<in> {m. sdom m \<subseteq> A \<and> sran m \<subseteq> B}

goal (1 subgoal):
 1. m1 \<union>. m2 \<in> {m. sdom m \<subseteq> A \<and> sran m \<subseteq> B}
[PROOF STEP]
by (auto simp add:smap_union_def)


[STATEMENT]
lemma LIMSEQ_erf_remainder_integral:
  "x > 0 \<Longrightarrow> (\<lambda>m. integral {x..x + real m} (\<lambda>t. exp (-(t^2)) / t ^ (2*n))) \<longlonglongrightarrow>
                 erf_remainder_integral n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (\<lambda>m. integral {x..x + real m} (\<lambda>t. exp (- t\<^sup>2) / t ^ (2 * n))) \<longlonglongrightarrow> erf_remainder_integral n x
[PROOF STEP]
using convergent_erf_remainder_integral[of x]
[PROOF STATE]
proof (prove)
using this:
0 < x \<Longrightarrow> convergent (\<lambda>m. integral {x..x + real m} (\<lambda>t. exp (- t\<^sup>2) / t ^ (2 * ?n)))

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (\<lambda>m. integral {x..x + real m} (\<lambda>t. exp (- t\<^sup>2) / t ^ (2 * n))) \<longlonglongrightarrow> erf_remainder_integral n x
[PROOF STEP]
by (simp add: convergent_LIMSEQ_iff erf_remainder_integral_def)


[STATEMENT]
theorem rtl_complement_closed:
  "L\<in>regular_languages A \<Longrightarrow> ranked_trees A - L \<in> regular_languages A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L \<in> regular_languages A \<Longrightarrow> ranked_trees A - L \<in> regular_languages A
[PROOF STEP]
proof (elim rtlE_complete, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>TA. \<lbrakk>L = ta_lang TA; complete_tree_automaton TA A\<rbrakk> \<Longrightarrow> ranked_trees A - L \<in> regular_languages A
[PROOF STEP]
case prems: (1 TA)
[PROOF STATE]
proof (state)
this:
L = ta_lang TA
complete_tree_automaton TA A

goal (1 subgoal):
 1. \<And>TA. \<lbrakk>L = ta_lang TA; complete_tree_automaton TA A\<rbrakk> \<Longrightarrow> ranked_trees A - L \<in> regular_languages A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
L = ta_lang TA
complete_tree_automaton TA A
[PROOF STEP]
interpret ta: complete_tree_automaton TA A
[PROOF STATE]
proof (prove)
using this:
L = ta_lang TA
complete_tree_automaton TA A

goal (1 subgoal):
 1. complete_tree_automaton TA A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>TA. \<lbrakk>L = ta_lang TA; complete_tree_automaton TA A\<rbrakk> \<Longrightarrow> ranked_trees A - L \<in> regular_languages A
[PROOF STEP]
from ta.complementTA_correct
[PROOF STATE]
proof (chain)
picking this:
ta_lang ta.complementTA = ranked_trees A - ta_lang TA
complete_tree_automaton ta.complementTA A
[PROOF STEP]
have
    [simp]: "ta_lang (ta.complementTA) = ranked_trees A - ta_lang TA" and
    CTA: "complete_tree_automaton ta.complementTA A"
[PROOF STATE]
proof (prove)
using this:
ta_lang ta.complementTA = ranked_trees A - ta_lang TA
complete_tree_automaton ta.complementTA A

goal (1 subgoal):
 1. ta_lang ta.complementTA = ranked_trees A - ta_lang TA &&& complete_tree_automaton ta.complementTA A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ta_lang ta.complementTA = ranked_trees A - ta_lang TA
complete_tree_automaton ta.complementTA A

goal (1 subgoal):
 1. \<And>TA. \<lbrakk>L = ta_lang TA; complete_tree_automaton TA A\<rbrakk> \<Longrightarrow> ranked_trees A - L \<in> regular_languages A
[PROOF STEP]
interpret cta: complete_tree_automaton ta.complementTA A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complete_tree_automaton ta.complementTA A
[PROOF STEP]
using CTA
[PROOF STATE]
proof (prove)
using this:
complete_tree_automaton ta.complementTA A

goal (1 subgoal):
 1. complete_tree_automaton ta.complementTA A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>TA. \<lbrakk>L = ta_lang TA; complete_tree_automaton TA A\<rbrakk> \<Longrightarrow> ranked_trees A - L \<in> regular_languages A
[PROOF STEP]
from cta.rtlI prems(1)
[PROOF STATE]
proof (chain)
picking this:
ta_lang ta.complementTA \<in> regular_languages A
L = ta_lang TA
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ta_lang ta.complementTA \<in> regular_languages A
L = ta_lang TA

goal (1 subgoal):
 1. ranked_trees A - L \<in> regular_languages A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ranked_trees A - L \<in> regular_languages A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Gromov_extension_isometry_iterates:
  fixes f::"'a \<Rightarrow> ('a::Gromov_hyperbolic_space)"
  assumes "isometry f"
  shows "Gromov_extension (f^^n) = (Gromov_extension f)^^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_extension (f ^^ n) = Gromov_extension f ^^ n
[PROOF STEP]
apply (induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Gromov_extension (f ^^ 0) = Gromov_extension f ^^ 0
 2. \<And>n. Gromov_extension (f ^^ n) = Gromov_extension f ^^ n \<Longrightarrow> Gromov_extension (f ^^ Suc n) = Gromov_extension f ^^ Suc n
[PROOF STEP]
using Gromov_extension_isometry_composition[OF isometry_iterates[OF assms] assms]
[PROOF STATE]
proof (prove)
using this:
Gromov_extension (f \<circ> f ^^ ?n1) = Gromov_extension f \<circ> Gromov_extension (f ^^ ?n1)

goal (2 subgoals):
 1. Gromov_extension (f ^^ 0) = Gromov_extension f ^^ 0
 2. \<And>n. Gromov_extension (f ^^ n) = Gromov_extension f ^^ n \<Longrightarrow> Gromov_extension (f ^^ Suc n) = Gromov_extension f ^^ Suc n
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
using this:
Gromov_extension (\<lambda>x. f ((f ^^ ?n1) x)) = (\<lambda>x. Gromov_extension f (Gromov_extension (f ^^ ?n1) x))

goal (2 subgoals):
 1. Gromov_extension (f ^^ 0) = Gromov_extension f ^^ 0
 2. \<And>n. Gromov_extension (f ^^ n) = Gromov_extension f ^^ n \<Longrightarrow> Gromov_extension (f ^^ Suc n) = Gromov_extension f ^^ Suc n
[PROOF STEP]
by auto


[STATEMENT]
lemma list_all2_op_map_iff:
  "list_all2 (\<lambda> a b. b = f a) xs ys \<longleftrightarrow> map f xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (\<lambda>a b. b = f a) xs ys = (map f xs = ys)
[PROOF STEP]
unfolding list_all2_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = length ys \<and> (\<forall>(a, b)\<in>set (zip xs ys). b = f a)) = (map f xs = ys)
[PROOF STEP]
proof (induction xs arbitrary: ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys. (length [] = length ys \<and> (\<forall>(a, b)\<in>set (zip [] ys). b = f a)) = (map f [] = ys)
 2. \<And>a xs ys. (\<And>ys. (length xs = length ys \<and> (\<forall>(a, b)\<in>set (zip xs ys). b = f a)) = (map f xs = ys)) \<Longrightarrow> (length (a # xs) = length ys \<and> (\<forall>(a, b)\<in>set (zip (a # xs) ys). b = f a)) = (map f (a # xs) = ys)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>ys. (length [] = length ys \<and> (\<forall>(a, b)\<in>set (zip [] ys). b = f a)) = (map f [] = ys)
 2. \<And>a xs ys. (\<And>ys. (length xs = length ys \<and> (\<forall>(a, b)\<in>set (zip xs ys). b = f a)) = (map f xs = ys)) \<Longrightarrow> (length (a # xs) = length ys \<and> (\<forall>(a, b)\<in>set (zip (a # xs) ys). b = f a)) = (map f (a # xs) = ys)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length [] = length ys \<and> (\<forall>a\<in>set (zip [] ys). case a of (a, b) \<Rightarrow> b = f a)) = (map f [] = ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(length [] = length ys \<and> (\<forall>a\<in>set (zip [] ys). case a of (a, b) \<Rightarrow> b = f a)) = (map f [] = ys)

goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. (length xs = length ys \<and> (\<forall>(a, b)\<in>set (zip xs ys). b = f a)) = (map f xs = ys)) \<Longrightarrow> (length (a # xs) = length ys \<and> (\<forall>(a, b)\<in>set (zip (a # xs) ys). b = f a)) = (map f (a # xs) = ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. (length xs = length ys \<and> (\<forall>(a, b)\<in>set (zip xs ys). b = f a)) = (map f xs = ys)) \<Longrightarrow> (length (a # xs) = length ys \<and> (\<forall>(a, b)\<in>set (zip (a # xs) ys). b = f a)) = (map f (a # xs) = ys)
[PROOF STEP]
case (Cons a xs ys)
[PROOF STATE]
proof (state)
this:
(length xs = length ?ys \<and> (\<forall>a\<in>set (zip xs ?ys). case a of (a, b) \<Rightarrow> b = f a)) = (map f xs = ?ys)

goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. (length xs = length ys \<and> (\<forall>(a, b)\<in>set (zip xs ys). b = f a)) = (map f xs = ys)) \<Longrightarrow> (length (a # xs) = length ys \<and> (\<forall>(a, b)\<in>set (zip (a # xs) ys). b = f a)) = (map f (a # xs) = ys)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(length xs = length ?ys \<and> (\<forall>a\<in>set (zip xs ?ys). case a of (a, b) \<Rightarrow> b = f a)) = (map f xs = ?ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(length xs = length ?ys \<and> (\<forall>a\<in>set (zip xs ?ys). case a of (a, b) \<Rightarrow> b = f a)) = (map f xs = ?ys)

goal (1 subgoal):
 1. (length (a # xs) = length ys \<and> (\<forall>a\<in>set (zip (a # xs) ys). case a of (a, b) \<Rightarrow> b = f a)) = (map f (a # xs) = ys)
[PROOF STEP]
by (cases ys) auto
[PROOF STATE]
proof (state)
this:
(length (a # xs) = length ys \<and> (\<forall>a\<in>set (zip (a # xs) ys). case a of (a, b) \<Rightarrow> b = f a)) = (map f (a # xs) = ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [code abstract]:
    "Rep_BinomialHeap (meld q1 q2)
    = BinomialHeapStruc.meld (Rep_BinomialHeap q1) (Rep_BinomialHeap q2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_BinomialHeap (meld q1 q2) = BinomialHeapStruc.meld (Rep_BinomialHeap q1) (Rep_BinomialHeap q2)
[PROOF STEP]
by (simp add: meld_def BinomialHeapStruc.meld_correct)


[STATEMENT]
lemma funpower_upperbound:
  "(\<And> I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G) \<Longrightarrow> I \<subseteq> G \<Longrightarrow> funpower f n I \<subseteq> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f n I \<subseteq> G
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f 0 I \<subseteq> G
 2. \<And>n. \<lbrakk>\<lbrakk>\<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f n I \<subseteq> G; \<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f (Suc n) I \<subseteq> G
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
?I \<subseteq> G \<Longrightarrow> f ?I \<subseteq> G
I \<subseteq> G

goal (2 subgoals):
 1. \<lbrakk>\<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f 0 I \<subseteq> G
 2. \<And>n. \<lbrakk>\<lbrakk>\<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f n I \<subseteq> G; \<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f (Suc n) I \<subseteq> G
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?I \<subseteq> G \<Longrightarrow> f ?I \<subseteq> G
I \<subseteq> G

goal (1 subgoal):
 1. funpower f 0 I \<subseteq> G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
funpower f 0 I \<subseteq> G

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f n I \<subseteq> G; \<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f (Suc n) I \<subseteq> G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f n I \<subseteq> G; \<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f (Suc n) I \<subseteq> G
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f n I \<subseteq> G
?I \<subseteq> G \<Longrightarrow> f ?I \<subseteq> G
I \<subseteq> G

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f n I \<subseteq> G; \<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f (Suc n) I \<subseteq> G
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>I. I \<subseteq> G \<Longrightarrow> f I \<subseteq> G; I \<subseteq> G\<rbrakk> \<Longrightarrow> funpower f n I \<subseteq> G
?I \<subseteq> G \<Longrightarrow> f ?I \<subseteq> G
I \<subseteq> G

goal (1 subgoal):
 1. funpower f (Suc n) I \<subseteq> G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
funpower f (Suc n) I \<subseteq> G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_all2_reorder_left_invariance:
  assumes rel: "list_all2 R xs ys" and ms_x: "mset xs' = mset xs"
  shows "\<exists>ys'. list_all2 R xs' ys' \<and> mset ys' = mset ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ys'. list_all2 R xs' ys' \<and> mset ys' = mset ys
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>ys'. list_all2 R xs' ys' \<and> mset ys' = mset ys
[PROOF STEP]
have len: "length xs = length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys
[PROOF STEP]
using rel list_all2_conv_all_nth
[PROOF STATE]
proof (prove)
using this:
list_all2 R xs ys
list_all2 ?P ?xs ?ys = (length ?xs = length ?ys \<and> (\<forall>i<length ?xs. ?P (?xs ! i) (?ys ! i)))

goal (1 subgoal):
 1. length xs = length ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length xs = length ys

goal (1 subgoal):
 1. \<exists>ys'. list_all2 R xs' ys' \<and> mset ys' = mset ys
[PROOF STEP]
obtain ys' where
    len': "length xs' = length ys'" and ms_xy: "mset (zip xs' ys') = mset (zip xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>ys'. \<lbrakk>length xs' = length ys'; mset (zip xs' ys') = mset (zip xs ys)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using len ms_x
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
mset xs' = mset xs

goal (1 subgoal):
 1. (\<And>ys'. \<lbrakk>length xs' = length ys'; mset (zip xs' ys') = mset (zip xs ys)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis ex_mset_zip_left)
[PROOF STATE]
proof (state)
this:
length xs' = length ys'
mset (zip xs' ys') = mset (zip xs ys)

goal (1 subgoal):
 1. \<exists>ys'. list_all2 R xs' ys' \<and> mset ys' = mset ys
[PROOF STEP]
have "list_all2 R xs' ys'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 R xs' ys'
[PROOF STEP]
using assms(1) len' ms_xy
[PROOF STATE]
proof (prove)
using this:
list_all2 R xs ys
length xs' = length ys'
mset (zip xs' ys') = mset (zip xs ys)

goal (1 subgoal):
 1. list_all2 R xs' ys'
[PROOF STEP]
unfolding list_all2_iff
[PROOF STATE]
proof (prove)
using this:
length xs = length ys \<and> (\<forall>(x, y)\<in>set (zip xs ys). R x y)
length xs' = length ys'
mset (zip xs' ys') = mset (zip xs ys)

goal (1 subgoal):
 1. length xs' = length ys' \<and> (\<forall>(x, y)\<in>set (zip xs' ys'). R x y)
[PROOF STEP]
by (blast dest: mset_eq_setD)
[PROOF STATE]
proof (state)
this:
list_all2 R xs' ys'

goal (1 subgoal):
 1. \<exists>ys'. list_all2 R xs' ys' \<and> mset ys' = mset ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
list_all2 R xs' ys'

goal (1 subgoal):
 1. \<exists>ys'. list_all2 R xs' ys' \<and> mset ys' = mset ys
[PROOF STEP]
have "mset ys' = mset ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset ys' = mset ys
[PROOF STEP]
using len len' ms_xy map_snd_zip mset_map
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
length xs' = length ys'
mset (zip xs' ys') = mset (zip xs ys)
length ?xs = length ?ys \<Longrightarrow> map snd (zip ?xs ?ys) = ?ys
mset (map ?f ?xs) = image_mset ?f (mset ?xs)

goal (1 subgoal):
 1. mset ys' = mset ys
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mset ys' = mset ys

goal (1 subgoal):
 1. \<exists>ys'. list_all2 R xs' ys' \<and> mset ys' = mset ys
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
list_all2 R xs' ys'
mset ys' = mset ys
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
list_all2 R xs' ys'
mset ys' = mset ys

goal (1 subgoal):
 1. \<exists>ys'. list_all2 R xs' ys' \<and> mset ys' = mset ys
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>ys'. list_all2 R xs' ys' \<and> mset ys' = mset ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in order) order_zmset_exists_foundation:
  fixes   t :: 'a
  assumes "0 < zcount M t"
  shows   "\<exists>s. s \<le> t \<and> 0 < zcount M s \<and> (\<forall>u. 0 < zcount M u \<longrightarrow> \<not> u < s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>s\<le>t. 0 < zcount M s \<and> (\<forall>u. 0 < zcount M u \<longrightarrow> \<not> u < s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < zcount M t

goal (1 subgoal):
 1. \<exists>s\<le>t. 0 < zcount M s \<and> (\<forall>u. 0 < zcount M u \<longrightarrow> \<not> u < s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < zcount M t \<Longrightarrow> \<exists>s\<le>t. 0 < zcount M s \<and> (\<forall>u. 0 < zcount M u \<longrightarrow> \<not> u < s)
[PROOF STEP]
let ?M = "{t. 0 < zcount M t}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < zcount M t \<Longrightarrow> \<exists>s\<le>t. 0 < zcount M s \<and> (\<forall>u. 0 < zcount M u \<longrightarrow> \<not> u < s)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < zcount M t
[PROOF STEP]
have "t \<in> ?M"
[PROOF STATE]
proof (prove)
using this:
0 < zcount M t

goal (1 subgoal):
 1. t \<in> {t. 0 < zcount M t}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
t \<in> {t. 0 < zcount M t}

goal (1 subgoal):
 1. 0 < zcount M t \<Longrightarrow> \<exists>s\<le>t. 0 < zcount M s \<and> (\<forall>u. 0 < zcount M u \<longrightarrow> \<not> u < s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> {t. 0 < zcount M t}
[PROOF STEP]
have "\<exists>s\<in>?M. s \<le> t \<and> (\<forall>u\<in>?M. \<not> u < s)"
[PROOF STATE]
proof (prove)
using this:
t \<in> {t. 0 < zcount M t}

goal (1 subgoal):
 1. \<exists>s\<in>{t. 0 < zcount M t}. s \<le> t \<and> (\<forall>u\<in>{t. 0 < zcount M t}. \<not> u < s)
[PROOF STEP]
by - (drule order_finite_set_exists_foundation[rotated 1], auto)
[PROOF STATE]
proof (state)
this:
\<exists>s\<in>{t. 0 < zcount M t}. s \<le> t \<and> (\<forall>u\<in>{t. 0 < zcount M t}. \<not> u < s)

goal (1 subgoal):
 1. 0 < zcount M t \<Longrightarrow> \<exists>s\<le>t. 0 < zcount M s \<and> (\<forall>u. 0 < zcount M u \<longrightarrow> \<not> u < s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>s\<in>{t. 0 < zcount M t}. s \<le> t \<and> (\<forall>u\<in>{t. 0 < zcount M t}. \<not> u < s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>s\<in>{t. 0 < zcount M t}. s \<le> t \<and> (\<forall>u\<in>{t. 0 < zcount M t}. \<not> u < s)

goal (1 subgoal):
 1. \<exists>s\<le>t. 0 < zcount M s \<and> (\<forall>u. 0 < zcount M u \<longrightarrow> \<not> u < s)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>s\<le>t. 0 < zcount M s \<and> (\<forall>u. 0 < zcount M u \<longrightarrow> \<not> u < s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_list_insertion: "insertion f p = sum_list [insertion f term * (f v) ^ i. (term,i)\<leftarrow>(to_list v p)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f p = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. insertion f p = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)
[PROOF STEP]
have h1 :  "insertion f p = insertion f (\<Sum>i\<le>MPoly_Type.degree p v. isolate_variable_sparse p v i * Var v ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f p = insertion f (\<Sum>i\<le>MPoly_Type.degree p v. isolate_variable_sparse p v i * Var v ^ i)
[PROOF STEP]
using sum_over_zero
[PROOF STATE]
proof (prove)
using this:
?mp = (\<Sum>i\<le>MPoly_Type.degree ?mp ?x. isolate_variable_sparse ?mp ?x i * Var ?x ^ i)

goal (1 subgoal):
 1. insertion f p = insertion f (\<Sum>i\<le>MPoly_Type.degree p v. isolate_variable_sparse p v i * Var v ^ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insertion f p = insertion f (\<Sum>i\<le>MPoly_Type.degree p v. isolate_variable_sparse p v i * Var v ^ i)

goal (1 subgoal):
 1. insertion f p = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)
[PROOF STEP]
have h2 : "insertion f (Var v) = f v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f (Var v) = f v
[PROOF STEP]
by (auto simp: monomials_Var coeff_Var insertion_code)
[PROOF STATE]
proof (state)
this:
insertion f (Var v) = f v

goal (1 subgoal):
 1. insertion f p = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)
[PROOF STEP]
define d where "d = MPoly_Type.degree p v"
[PROOF STATE]
proof (state)
this:
d = MPoly_Type.degree p v

goal (1 subgoal):
 1. insertion f p = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)
[PROOF STEP]
define g where "g = (\<lambda>x. insertion f (isolate_variable_sparse p v x) * f v ^ x)"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>x. insertion f (isolate_variable_sparse p v x) * f v ^ x)

goal (1 subgoal):
 1. insertion f p = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)
[PROOF STEP]
have h3 : "insertion f (isolate_variable_sparse p v d) * f v ^ d = g d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f (isolate_variable_sparse p v d) * f v ^ d = g d
[PROOF STEP]
using g_def
[PROOF STATE]
proof (prove)
using this:
g = (\<lambda>x. insertion f (isolate_variable_sparse p v x) * f v ^ x)

goal (1 subgoal):
 1. insertion f (isolate_variable_sparse p v d) * f v ^ d = g d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insertion f (isolate_variable_sparse p v d) * f v ^ d = g d

goal (1 subgoal):
 1. insertion f p = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f p = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)
[PROOF STEP]
unfolding h1
      insertion_sum' insertion_mult insertion_pow h2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>MPoly_Type.degree p v. insertion f (isolate_variable_sparse p v i) * f v ^ i) = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>MPoly_Type.degree p v. insertion f (isolate_variable_sparse p v i) * f v ^ i) = sum_list (map ((\<lambda>(term, i). insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<MPoly_Type.degree p v]) + insertion f (isolate_variable_sparse p v (MPoly_Type.degree p v)) * f v ^ MPoly_Type.degree p v
[PROOF STEP]
unfolding d_def[symmetric] g_def[symmetric]
      h3
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g {..d} = sum_list (map ((\<lambda>(term, i). insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<d]) + g d
[PROOF STEP]
proof(induction d)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sum g {..0} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<0]) + g 0
 2. \<And>d. sum g {..d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<d]) + g d \<Longrightarrow> sum g {..Suc d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<Suc d]) + g (Suc d)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. sum g {..0} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<0]) + g 0
 2. \<And>d. sum g {..d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<d]) + g d \<Longrightarrow> sum g {..Suc d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<Suc d]) + g (Suc d)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g {..0} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<0]) + g 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum g {..0} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<0]) + g 0

goal (1 subgoal):
 1. \<And>d. sum g {..d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<d]) + g d \<Longrightarrow> sum g {..Suc d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<Suc d]) + g (Suc d)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>d. sum g {..d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<d]) + g d \<Longrightarrow> sum g {..Suc d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<Suc d]) + g (Suc d)
[PROOF STEP]
case (Suc d)
[PROOF STATE]
proof (state)
this:
sum g {..d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<d]) + g d

goal (1 subgoal):
 1. \<And>d. sum g {..d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<d]) + g d \<Longrightarrow> sum g {..Suc d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<Suc d]) + g (Suc d)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g {..Suc d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<Suc d]) + g (Suc d)
[PROOF STEP]
apply (auto simp add: Suc )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g d = insertion f (isolate_variable_sparse p v d) * f v ^ d
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f (isolate_variable_sparse p v d) * f v ^ d = insertion f (isolate_variable_sparse p v d) * f v ^ d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum g {..Suc d} = sum_list (map ((\<lambda>a. case a of (term, i) \<Rightarrow> insertion f term * f v ^ i) \<circ> (\<lambda>x. (isolate_variable_sparse p v x, x))) [0..<Suc d]) + g (Suc d)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
insertion f p = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Module) mHom_eq_ker:"\<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M;
      b\<in> carrier M; a \<plusminus> (-\<^sub>a b) \<in> ker\<^bsub>M,N\<^esub> f\<rbrakk> \<Longrightarrow> f a = f b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; b \<in> carrier M; a \<plusminus> -\<^sub>a b \<in> ker\<^bsub>M,N\<^esub> f\<rbrakk> \<Longrightarrow> f a = f b
[PROOF STEP]
apply (simp add:ker_def, erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; b \<in> carrier M; a \<plusminus> -\<^sub>a b \<in> carrier M; f (a \<plusminus> -\<^sub>a b) = \<zero>\<^bsub>N\<^esub>\<rbrakk> \<Longrightarrow> f a = f b
[PROOF STEP]
apply (cut_tac module_is_ag,
       frule aGroup.ag_mOp_closed [of "M" "b"], assumption+,
       simp add:mHom_add, simp add:mHom_inv,
       thin_tac "aGroup M")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; b \<in> carrier M; a \<plusminus> -\<^sub>a b \<in> carrier M; f a \<plusminus>\<^bsub>N\<^esub> -\<^sub>a\<^bsub>N\<^esub> f b = \<zero>\<^bsub>N\<^esub>; -\<^sub>a b \<in> carrier M\<rbrakk> \<Longrightarrow> f a = f b
[PROOF STEP]
apply (frule mHom_mem [of N f a], assumption+,
       frule mHom_mem [of N f b], assumption+,
       frule Module.module_is_ag[of N])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; a \<in> carrier M; b \<in> carrier M; a \<plusminus> -\<^sub>a b \<in> carrier M; f a \<plusminus>\<^bsub>N\<^esub> -\<^sub>a\<^bsub>N\<^esub> f b = \<zero>\<^bsub>N\<^esub>; -\<^sub>a b \<in> carrier M; f a \<in> carrier N; f b \<in> carrier N; aGroup N\<rbrakk> \<Longrightarrow> f a = f b
[PROOF STEP]
apply (subst aGroup.ag_eq_diffzero[of N], assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma omega_div_exp_min1:
  assumes "2^(Suc l) \<le> n"
  shows "(\<omega> ^(n div 2^(Suc l)))^(2^l) = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = - 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = - 1
[PROOF STEP]
have "(\<omega> ^(n div 2^(Suc l)))^(2^l) = \<omega> ^((n div 2^(Suc l))*2^l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = \<omega> ^ (n div 2 ^ Suc l * 2 ^ l)
[PROOF STEP]
by (simp add: power_mult)
[PROOF STATE]
proof (state)
this:
(\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = \<omega> ^ (n div 2 ^ Suc l * 2 ^ l)

goal (1 subgoal):
 1. (\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = - 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = \<omega> ^ (n div 2 ^ Suc l * 2 ^ l)

goal (1 subgoal):
 1. (\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = - 1
[PROOF STEP]
have "(n div 2^(Suc l)) = 2^(N - Suc l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n div 2 ^ Suc l = 2 ^ (N - Suc l)
[PROOF STEP]
using assms div_exp_sub
[PROOF STATE]
proof (prove)
using this:
2 ^ Suc l \<le> n
2 ^ ?l < n \<Longrightarrow> n div 2 ^ ?l = 2 ^ (N - ?l)

goal (1 subgoal):
 1. n div 2 ^ Suc l = 2 ^ (N - Suc l)
[PROOF STEP]
by (metis n_two_pot eq_imp_le le_neq_implies_less one_less_numeral_iff power_diff power_inject_exp semiring_norm(76) zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
n div 2 ^ Suc l = 2 ^ (N - Suc l)

goal (1 subgoal):
 1. (\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = - 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n div 2 ^ Suc l = 2 ^ (N - Suc l)

goal (1 subgoal):
 1. (\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = - 1
[PROOF STEP]
have "N \<ge> Suc l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc l \<le> N
[PROOF STEP]
using assms n_two_pot
[PROOF STATE]
proof (prove)
using this:
2 ^ Suc l \<le> n
n = 2 ^ N

goal (1 subgoal):
 1. Suc l \<le> N
[PROOF STEP]
by (metis diff_is_0_eq diff_le_diff_pow gr0I leD le_refl)
[PROOF STATE]
proof (state)
this:
Suc l \<le> N

goal (1 subgoal):
 1. (\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = - 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Suc l \<le> N

goal (1 subgoal):
 1. (\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = - 1
[PROOF STEP]
hence "(2::nat)^(N - Suc l)*2^l = 2^(N- 1)"
[PROOF STATE]
proof (prove)
using this:
Suc l \<le> N

goal (1 subgoal):
 1. 2 ^ (N - Suc l) * 2 ^ l = 2 ^ (N - 1)
[PROOF STEP]
by (metis Nat.add_diff_assoc diff_Suc_1 diff_diff_cancel diff_le_self le_add1 le_add_diff_inverse plus_1_eq_Suc power_add)
[PROOF STATE]
proof (state)
this:
2 ^ (N - Suc l) * 2 ^ l = 2 ^ (N - 1)

goal (1 subgoal):
 1. (\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = - 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = \<omega> ^ (n div 2 ^ Suc l * 2 ^ l)
n div 2 ^ Suc l = 2 ^ (N - Suc l)
Suc l \<le> N
2 ^ (N - Suc l) * 2 ^ l = 2 ^ (N - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = \<omega> ^ (n div 2 ^ Suc l * 2 ^ l)
n div 2 ^ Suc l = 2 ^ (N - Suc l)
Suc l \<le> N
2 ^ (N - Suc l) * 2 ^ l = 2 ^ (N - 1)

goal (1 subgoal):
 1. (\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = - 1
[PROOF STEP]
by (metis n_two_pot One_nat_def \<open>n div 2 ^ Suc l = 2 ^ (N - Suc l)\<close> diff_Suc_1 div_exp_sub n_lst2 n_min1_2 n_min1_gr2 nat_less_le nat_power_eq_Suc_0_iff one_less_numeral_iff power_inject_exp power_one_right semiring_norm(76))
[PROOF STATE]
proof (state)
this:
(\<omega> ^ (n div 2 ^ Suc l)) ^ 2 ^ l = - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounded_pow_blinfun[intro]:
  assumes "bounded (range (F::nat \<Rightarrow> 'a::real_normed_vector \<Rightarrow>\<^sub>L 'a))"
  shows "bounded (range (\<lambda>t. (F t)^^(Suc n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (range (\<lambda>t. F t ^^ Suc n))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bounded (range F)

goal (1 subgoal):
 1. bounded (range (\<lambda>t. F t ^^ Suc n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded (range F) \<Longrightarrow> bounded (range (\<lambda>t. F t ^^ Suc n))
[PROOF STEP]
assume "bounded (range F)"
[PROOF STATE]
proof (state)
this:
bounded (range F)

goal (1 subgoal):
 1. bounded (range F) \<Longrightarrow> bounded (range (\<lambda>t. F t ^^ Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded (range F)
[PROOF STEP]
obtain b where bh: "\<And>x. norm (F x) \<le> b"
[PROOF STATE]
proof (prove)
using this:
bounded (range F)

goal (1 subgoal):
 1. (\<And>b. (\<And>x. norm (F x) \<le> b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: bounded_iff)
[PROOF STATE]
proof (state)
this:
norm (F ?x) \<le> b

goal (1 subgoal):
 1. bounded (range F) \<Longrightarrow> bounded (range (\<lambda>t. F t ^^ Suc n))
[PROOF STEP]
hence "norm ((F x)^^(Suc n)) \<le> b^(Suc n)" for x
[PROOF STATE]
proof (prove)
using this:
norm (F ?x) \<le> b

goal (1 subgoal):
 1. norm (F x ^^ Suc n) \<le> b ^ Suc n
[PROOF STEP]
using bh
[PROOF STATE]
proof (prove)
using this:
norm (F ?x) \<le> b
norm (F ?x) \<le> b

goal (1 subgoal):
 1. norm (F x ^^ Suc n) \<le> b ^ Suc n
[PROOF STEP]
by (induction n) (auto intro!: order.trans[OF norm_blinfun_compose] simp: mult_mono')
[PROOF STATE]
proof (state)
this:
norm (F ?x ^^ Suc n) \<le> b ^ Suc n

goal (1 subgoal):
 1. bounded (range F) \<Longrightarrow> bounded (range (\<lambda>t. F t ^^ Suc n))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (F ?x ^^ Suc n) \<le> b ^ Suc n

goal (1 subgoal):
 1. bounded (range (\<lambda>t. F t ^^ Suc n))
[PROOF STEP]
by (auto intro!: boundedI)
[PROOF STATE]
proof (state)
this:
bounded (range (\<lambda>t. F t ^^ Suc n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pow_carrier_mod:
  assumes "g \<in> carrier G"
  shows "g [^] (k mod order G) = g [^] k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g [^] (k mod order G) = g [^] k
[PROOF STEP]
using assms pow_generator_mod
[PROOF STATE]
proof (prove)
using this:
g \<in> carrier G
\<^bold>g [^] (?k mod order G) = \<^bold>g [^] ?k

goal (1 subgoal):
 1. g [^] (k mod order G) = g [^] k
[PROOF STEP]
by (metis generatorE generator_closed mod_mult_right_eq nat_pow_pow)


[STATEMENT]
lemma S_abs:
  assumes "v \<noteq> 0"
  shows "proj2_abs v \<in> S \<longleftrightarrow> v \<bullet> (M *v v) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (proj2_abs v \<in> S) = (v \<bullet> (M *v v) = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (proj2_abs v \<in> S) = (v \<bullet> (M *v v) = 0)
[PROOF STEP]
have "proj2_abs v \<in> S \<longleftrightarrow> conic_sgn (proj2_abs v) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (proj2_abs v \<in> S) = (conic_sgn (proj2_abs v) = 0)
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (proj2_abs v \<in> {p. conic_sgn p = 0}) = (conic_sgn (proj2_abs v) = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(proj2_abs v \<in> S) = (conic_sgn (proj2_abs v) = 0)

goal (1 subgoal):
 1. (proj2_abs v \<in> S) = (v \<bullet> (M *v v) = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(proj2_abs v \<in> S) = (conic_sgn (proj2_abs v) = 0)

goal (1 subgoal):
 1. (proj2_abs v \<in> S) = (v \<bullet> (M *v v) = 0)
[PROOF STEP]
from \<open>v \<noteq> 0\<close> and conic_sgn_abs
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0
?v \<noteq> 0 \<Longrightarrow> conic_sgn (proj2_abs ?v) = sgn (?v \<bullet> (M *v ?v))
[PROOF STEP]
have "\<dots> \<longleftrightarrow> sgn (v \<bullet> (M *v v)) = 0"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0
?v \<noteq> 0 \<Longrightarrow> conic_sgn (proj2_abs ?v) = sgn (?v \<bullet> (M *v ?v))

goal (1 subgoal):
 1. (conic_sgn (proj2_abs v) = 0) = (sgn (v \<bullet> (M *v v)) = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(conic_sgn (proj2_abs v) = 0) = (sgn (v \<bullet> (M *v v)) = 0)

goal (1 subgoal):
 1. (proj2_abs v \<in> S) = (v \<bullet> (M *v v) = 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(proj2_abs v \<in> S) = (sgn (v \<bullet> (M *v v)) = 0)
[PROOF STEP]
show "proj2_abs v \<in> S \<longleftrightarrow> v \<bullet> (M *v v) = 0"
[PROOF STATE]
proof (prove)
using this:
(proj2_abs v \<in> S) = (sgn (v \<bullet> (M *v v)) = 0)

goal (1 subgoal):
 1. (proj2_abs v \<in> S) = (v \<bullet> (M *v v) = 0)
[PROOF STEP]
by (simp add: sgn_0_0)
[PROOF STATE]
proof (state)
this:
(proj2_abs v \<in> S) = (v \<bullet> (M *v v) = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma forest_alt:
  assumes "\<And>e. e\<in>F \<Longrightarrow> proper_uprod e"
  shows "forest F \<longleftrightarrow> (\<forall>a b. Upair a b \<in> F \<longrightarrow> (a,b) \<notin>  uconnected (F - {Upair a b})) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. forest F = (\<forall>a b. Upair a b \<in> F \<longrightarrow> (a, b) \<notin> uconnected (F - {Upair a b}))
[PROOF STEP]
using assms forest_alt1 forest_alt2
[PROOF STATE]
proof (prove)
using this:
?e \<in> F \<Longrightarrow> proper_uprod ?e
\<lbrakk>Upair ?a ?b \<in> ?F; forest ?F; \<And>e. e \<in> ?F \<Longrightarrow> proper_uprod e\<rbrakk> \<Longrightarrow> (?a, ?b) \<notin> uconnected (?F - {Upair ?a ?b})
\<lbrakk>\<And>e. e \<in> ?F \<Longrightarrow> proper_uprod e; \<And>a b. Upair a b \<in> ?F \<Longrightarrow> (a, b) \<notin> uconnected (?F - {Upair a b})\<rbrakk> \<Longrightarrow> forest ?F

goal (1 subgoal):
 1. forest F = (\<forall>a b. Upair a b \<in> F \<longrightarrow> (a, b) \<notin> uconnected (F - {Upair a b}))
[PROOF STEP]
by metis


[STATEMENT]
lemma (in algebra) lambda_system_Un:
  fixes f:: "'a set \<Rightarrow> ennreal"
  assumes xl: "x \<in> lambda_system \<Omega> M f" and yl: "y \<in> lambda_system \<Omega> M f"
  shows "x \<union> y \<in> lambda_system \<Omega> M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<union> y \<in> lambda_system \<Omega> M f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<union> y \<in> lambda_system \<Omega> M f
[PROOF STEP]
have "(\<Omega> - x) \<inter> (\<Omega> - y) \<in> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Omega> - x) \<inter> (\<Omega> - y) \<in> M
[PROOF STEP]
by (metis Diff_Un Un compl_sets lambda_system_sets xl yl)
[PROOF STATE]
proof (state)
this:
(\<Omega> - x) \<inter> (\<Omega> - y) \<in> M

goal (1 subgoal):
 1. x \<union> y \<in> lambda_system \<Omega> M f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Omega> - x) \<inter> (\<Omega> - y) \<in> M

goal (1 subgoal):
 1. x \<union> y \<in> lambda_system \<Omega> M f
[PROOF STEP]
have "x \<union> y = \<Omega> - ((\<Omega> - x) \<inter> (\<Omega> - y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<union> y = \<Omega> - (\<Omega> - x) \<inter> (\<Omega> - y)
[PROOF STEP]
by auto (metis subsetD lambda_system_sets sets_into_space xl yl)+
[PROOF STATE]
proof (state)
this:
x \<union> y = \<Omega> - (\<Omega> - x) \<inter> (\<Omega> - y)

goal (1 subgoal):
 1. x \<union> y \<in> lambda_system \<Omega> M f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Omega> - x) \<inter> (\<Omega> - y) \<in> M
x \<union> y = \<Omega> - (\<Omega> - x) \<inter> (\<Omega> - y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Omega> - x) \<inter> (\<Omega> - y) \<in> M
x \<union> y = \<Omega> - (\<Omega> - x) \<inter> (\<Omega> - y)

goal (1 subgoal):
 1. x \<union> y \<in> lambda_system \<Omega> M f
[PROOF STEP]
by (metis lambda_system_Compl lambda_system_Int xl yl)
[PROOF STATE]
proof (state)
this:
x \<union> y \<in> lambda_system \<Omega> M f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sigma_sets_INTER:
  assumes Asb: "A \<subseteq> Pow sp"
      and ai: "\<And>i::nat. i \<in> S \<Longrightarrow> a i \<in> sigma_sets sp A" and non: "S \<noteq> {}"
  shows "(\<Inter>i\<in>S. a i) \<in> sigma_sets sp A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> (a ` S) \<in> sigma_sets sp A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Inter> (a ` S) \<in> sigma_sets sp A
[PROOF STEP]
from ai
[PROOF STATE]
proof (chain)
picking this:
?i \<in> S \<Longrightarrow> a ?i \<in> sigma_sets sp A
[PROOF STEP]
have "\<And>i. (if i\<in>S then a i else sp) \<in> sigma_sets sp A"
[PROOF STATE]
proof (prove)
using this:
?i \<in> S \<Longrightarrow> a ?i \<in> sigma_sets sp A

goal (1 subgoal):
 1. \<And>i. (if i \<in> S then a i else sp) \<in> sigma_sets sp A
[PROOF STEP]
by (simp add: sigma_sets.intros(2-) sigma_sets_top)
[PROOF STATE]
proof (state)
this:
(if ?i \<in> S then a ?i else sp) \<in> sigma_sets sp A

goal (1 subgoal):
 1. \<Inter> (a ` S) \<in> sigma_sets sp A
[PROOF STEP]
hence "(\<Inter>i. (if i\<in>S then a i else sp)) \<in> sigma_sets sp A"
[PROOF STATE]
proof (prove)
using this:
(if ?i \<in> S then a ?i else sp) \<in> sigma_sets sp A

goal (1 subgoal):
 1. (\<Inter>i. if i \<in> S then a i else sp) \<in> sigma_sets sp A
[PROOF STEP]
by (rule sigma_sets_Inter [OF Asb])
[PROOF STATE]
proof (state)
this:
(\<Inter>i. if i \<in> S then a i else sp) \<in> sigma_sets sp A

goal (1 subgoal):
 1. \<Inter> (a ` S) \<in> sigma_sets sp A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Inter>i. if i \<in> S then a i else sp) \<in> sigma_sets sp A

goal (1 subgoal):
 1. \<Inter> (a ` S) \<in> sigma_sets sp A
[PROOF STEP]
have "(\<Inter>i. (if i\<in>S then a i else sp)) = (\<Inter>i\<in>S. a i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Inter>i. if i \<in> S then a i else sp) = \<Inter> (a ` S)
[PROOF STEP]
by auto (metis ai non sigma_sets_into_sp subset_empty subset_iff Asb)+
[PROOF STATE]
proof (state)
this:
(\<Inter>i. if i \<in> S then a i else sp) = \<Inter> (a ` S)

goal (1 subgoal):
 1. \<Inter> (a ` S) \<in> sigma_sets sp A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Inter> (a ` S) \<in> sigma_sets sp A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Inter> (a ` S) \<in> sigma_sets sp A

goal (1 subgoal):
 1. \<Inter> (a ` S) \<in> sigma_sets sp A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Inter> (a ` S) \<in> sigma_sets sp A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma roots_of_3:
  shows "p \<noteq> 0 \<Longrightarrow> real_of_3 ` set (roots_of_3 p) = {x. ipoly p x = 0}"
    "distinct (map real_of_3 (roots_of_3 p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<noteq> 0 \<Longrightarrow> real_of_3 ` set (roots_of_3 p) = {x. poly (real_of_int_poly p) x = 0}) &&& distinct (map real_of_3 (roots_of_3 p))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<noteq> 0 \<Longrightarrow> real_of_3 ` set (roots_of_3 p) = {x. poly (real_of_int_poly p) x = 0}
 2. distinct (map real_of_3 (roots_of_3 p))
[PROOF STEP]
show "p \<noteq> 0 \<Longrightarrow> real_of_3 ` set (roots_of_3 p) = {x. ipoly p x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> real_of_3 ` set (roots_of_3 p) = {x. poly (real_of_int_poly p) x = 0}
[PROOF STEP]
by (transfer; intro roots_of_2, auto)
[PROOF STATE]
proof (state)
this:
p \<noteq> 0 \<Longrightarrow> real_of_3 ` set (roots_of_3 p) = {x. poly (real_of_int_poly p) x = 0}

goal (1 subgoal):
 1. distinct (map real_of_3 (roots_of_3 p))
[PROOF STEP]
show "distinct (map real_of_3 (roots_of_3 p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map real_of_3 (roots_of_3 p))
[PROOF STEP]
by (transfer; insert roots_of_2, auto)
[PROOF STATE]
proof (state)
this:
distinct (map real_of_3 (roots_of_3 p))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma setdist_neq_0_sing_1:
  "\<lbrakk>setdist {x} S = a; a \<noteq> 0\<rbrakk> \<Longrightarrow> S \<noteq> {} \<and> x \<notin> closure S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>setdist {x} S = a; a \<noteq> 0\<rbrakk> \<Longrightarrow> S \<noteq> {} \<and> x \<notin> closure S
[PROOF STEP]
by (metis setdist_closure_2 setdist_empty2 setdist_eq_0I singletonI)


[STATEMENT]
lemma card_left_less_pair:
  fixes A :: "('a :: linorder) set"
  assumes "finite A"
  shows "card {(a,b). a \<in> A \<and> b \<in> A \<and> a < b}
    = (card A * (card A - 1)) div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {(a, b). a \<in> A \<and> b \<in> A \<and> a < b} = card A * (card A - 1) div 2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. card {(a, b). a \<in> A \<and> b \<in> A \<and> a < b} = card A * (card A - 1) div 2
[PROOF STEP]
proof (induct A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card {a. case a of (a, b) \<Rightarrow> a \<in> {} \<and> b \<in> {} \<and> a < b} = card {} * (card {} - 1) div 2
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; card {a. case a of (a, b) \<Rightarrow> a \<in> F \<and> b \<in> F \<and> a < b} = card F * (card F - 1) div 2\<rbrakk> \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x F \<and> b \<in> insert x F \<and> a < b} = card (insert x F) * (card (insert x F) - 1) div 2
[PROOF STEP]
case (insert x A)
[PROOF STATE]
proof (state)
this:
finite A
x \<notin> A
card {a. case a of (a, b) \<Rightarrow> a \<in> A \<and> b \<in> A \<and> a < b} = card A * (card A - 1) div 2

goal (2 subgoals):
 1. card {a. case a of (a, b) \<Rightarrow> a \<in> {} \<and> b \<in> {} \<and> a < b} = card {} * (card {} - 1) div 2
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; card {a. case a of (a, b) \<Rightarrow> a \<in> F \<and> b \<in> F \<and> a < b} = card F * (card F - 1) div 2\<rbrakk> \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x F \<and> b \<in> insert x F \<and> a < b} = card (insert x F) * (card (insert x F) - 1) div 2
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
proof (cases "card A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card A = 0 \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
 2. \<And>nat. card A = Suc nat \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
card A = Suc n

goal (2 subgoals):
 1. card A = 0 \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
 2. \<And>nat. card A = Suc nat \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
have "{(a,b). a \<in> insert x A \<and> b \<in> insert x A \<and> a < b}
        = {(a,b). a \<in> A \<and> b \<in> A \<and> a < b} \<union> (\<lambda>a. if a < x then (a,x) else (x,a)) ` A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(a, b). a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = {(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<union> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A
[PROOF STEP]
using \<open>x \<notin> A\<close>
[PROOF STATE]
proof (prove)
using this:
x \<notin> A

goal (1 subgoal):
 1. {(a, b). a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = {(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<union> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A
[PROOF STEP]
by (auto simp: order_less_le)
[PROOF STATE]
proof (state)
this:
{(a, b). a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = {(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<union> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A

goal (2 subgoals):
 1. card A = 0 \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
 2. \<And>nat. card A = Suc nat \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{(a, b). a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = {(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<union> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A

goal (2 subgoals):
 1. card A = 0 \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
 2. \<And>nat. card A = Suc nat \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
have "finite {(a,b). a \<in> A \<and> b \<in> A \<and> a < b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(a, b). a \<in> A \<and> b \<in> A \<and> a < b}
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
card {a. case a of (a, b) \<Rightarrow> a \<in> A \<and> b \<in> A \<and> a < b} = card A * (card A - 1) div 2

goal (1 subgoal):
 1. finite {(a, b). a \<in> A \<and> b \<in> A \<and> a < b}
[PROOF STEP]
by (auto intro: finite_subset[of _ "A \<times> A"])
[PROOF STATE]
proof (state)
this:
finite {(a, b). a \<in> A \<and> b \<in> A \<and> a < b}

goal (2 subgoals):
 1. card A = 0 \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
 2. \<And>nat. card A = Suc nat \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {(a, b). a \<in> A \<and> b \<in> A \<and> a < b}

goal (2 subgoals):
 1. card A = 0 \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
 2. \<And>nat. card A = Suc nat \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
have "{(a,b). a \<in> A \<and> b \<in> A \<and> a < b} \<inter> (\<lambda>a. if a < x then (a,x) else (x,a)) ` A = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<inter> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A = {}
[PROOF STEP]
using \<open>x \<notin> A\<close>
[PROOF STATE]
proof (prove)
using this:
x \<notin> A

goal (1 subgoal):
 1. {(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<inter> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<inter> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A = {}

goal (2 subgoals):
 1. card A = 0 \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
 2. \<And>nat. card A = Suc nat \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<inter> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A = {}

goal (2 subgoals):
 1. card A = 0 \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
 2. \<And>nat. card A = Suc nat \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
have "inj_on (\<lambda>a. if a < x then (a, x) else (x, a)) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>a. if a < x then (a, x) else (x, a)) A
[PROOF STEP]
by (auto intro: inj_onI split: if_split_asm)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>a. if a < x then (a, x) else (x, a)) A

goal (2 subgoals):
 1. card A = 0 \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
 2. \<And>nat. card A = Suc nat \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{(a, b). a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = {(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<union> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A
finite {(a, b). a \<in> A \<and> b \<in> A \<and> a < b}
{(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<inter> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A = {}
inj_on (\<lambda>a. if a < x then (a, x) else (x, a)) A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{(a, b). a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = {(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<union> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A
finite {(a, b). a \<in> A \<and> b \<in> A \<and> a < b}
{(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<inter> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A = {}
inj_on (\<lambda>a. if a < x then (a, x) else (x, a)) A

goal (1 subgoal):
 1. card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
using insert Suc
[PROOF STATE]
proof (prove)
using this:
{(a, b). a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = {(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<union> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A
finite {(a, b). a \<in> A \<and> b \<in> A \<and> a < b}
{(a, b). a \<in> A \<and> b \<in> A \<and> a < b} \<inter> (\<lambda>a. if a < x then (a, x) else (x, a)) ` A = {}
inj_on (\<lambda>a. if a < x then (a, x) else (x, a)) A
finite A
x \<notin> A
card {a. case a of (a, b) \<Rightarrow> a \<in> A \<and> b \<in> A \<and> a < b} = card A * (card A - 1) div 2
card A = Suc n

goal (1 subgoal):
 1. card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
by (simp add: card_Un_disjoint card_image del: if_image_distrib)
[PROOF STATE]
proof (state)
this:
card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2

goal (1 subgoal):
 1. card A = 0 \<Longrightarrow> card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2
[PROOF STEP]
qed (simp add: card_eq_0_iff insert)
[PROOF STATE]
proof (state)
this:
card {a. case a of (a, b) \<Rightarrow> a \<in> insert x A \<and> b \<in> insert x A \<and> a < b} = card (insert x A) * (card (insert x A) - 1) div 2

goal (1 subgoal):
 1. card {a. case a of (a, b) \<Rightarrow> a \<in> {} \<and> b \<in> {} \<and> a < b} = card {} * (card {} - 1) div 2
[PROOF STEP]
qed simp


[STATEMENT]
lemma connected_component_of_mono:
   "\<lbrakk>connected_component_of (subtopology X S) x y; S \<subseteq> T\<rbrakk>
        \<Longrightarrow> connected_component_of (subtopology X T) x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>connected_component_of (subtopology X S) x y; S \<subseteq> T\<rbrakk> \<Longrightarrow> connected_component_of (subtopology X T) x y
[PROOF STEP]
by (metis connected_component_of_def connectedin_subtopology inf.absorb_iff2 subtopology_subtopology)


[STATEMENT]
lemma SD_trans [simp, trans]: "p \<preceq>[SD(R)] q \<Longrightarrow> q \<preceq>[SD(R)] r \<Longrightarrow> p \<preceq>[SD(R)] r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>SD R p q; SD R q r\<rbrakk> \<Longrightarrow> SD R p r
[PROOF STEP]
unfolding SD_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>q \<in> lotteries_on {x. R x x} \<and> p \<in> lotteries_on {x. R x x} \<and> (\<forall>x. R x x \<longrightarrow> measure_pmf.prob p (Collect (R x)) \<le> measure_pmf.prob q (Collect (R x))); r \<in> lotteries_on {x. R x x} \<and> q \<in> lotteries_on {x. R x x} \<and> (\<forall>x. R x x \<longrightarrow> measure_pmf.prob q (Collect (R x)) \<le> measure_pmf.prob r (Collect (R x)))\<rbrakk> \<Longrightarrow> r \<in> lotteries_on {x. R x x} \<and> p \<in> lotteries_on {x. R x x} \<and> (\<forall>x. R x x \<longrightarrow> measure_pmf.prob p (Collect (R x)) \<le> measure_pmf.prob r (Collect (R x)))
[PROOF STEP]
by (auto intro: order.trans)


[STATEMENT]
lemma mono_bal_d: "\<lbrakk> bal_d n dl; n \<le> n' \<rbrakk> \<Longrightarrow> bal_d n' dl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bal_d n dl; n \<le> n'\<rbrakk> \<Longrightarrow> bal_d n' dl
[PROOF STEP]
unfolding  bal_d_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>real dl < cd * (real n + 1); n \<le> n'\<rbrakk> \<Longrightarrow> real dl < cd * (real n' + 1)
[PROOF STEP]
using cd0 mult_left_mono[of "real n + 1" "real n' + 1" cd]
[PROOF STATE]
proof (prove)
using this:
0 < cd
\<lbrakk>real n + 1 \<le> real n' + 1; 0 \<le> cd\<rbrakk> \<Longrightarrow> cd * (real n + 1) \<le> cd * (real n' + 1)

goal (1 subgoal):
 1. \<lbrakk>real dl < cd * (real n + 1); n \<le> n'\<rbrakk> \<Longrightarrow> real dl < cd * (real n' + 1)
[PROOF STEP]
by linarith


[STATEMENT]
lemma powreal_mult_base_lemma1:
  "\<lbrakk> 1 \<le> a; 1 \<le> b \<rbrakk>
   \<Longrightarrow> (a * b) pow\<^sub>\<real> x = (a pow\<^sub>\<real> x) * (b pow\<^sub>\<real> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> a; 1 \<le> b\<rbrakk> \<Longrightarrow> (a * b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x * b pow\<^sub>\<real> x
[PROOF STEP]
by (metis mult.left_neutral mult_mono' powa_mult_base powreal_eq_powa zero_le_one)


[STATEMENT]
lemma quasinorm_subset_zero_space:
  assumes "N1 \<subseteq>\<^sub>N N2"
  shows "zero_space\<^sub>N N1 \<subseteq> zero_space\<^sub>N N2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zero_space\<^sub>N N1 \<subseteq> zero_space\<^sub>N N2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N1 \<subseteq>\<^sub>N N2

goal (1 subgoal):
 1. zero_space\<^sub>N N1 \<subseteq> zero_space\<^sub>N N2
[PROOF STEP]
unfolding zero_space\<^sub>N_def less_eq_quasinorm_def
[PROOF STATE]
proof (prove)
using this:
\<exists>C\<ge>0. \<forall>f. eNorm N2 f \<le> ennreal C * eNorm N1 f

goal (1 subgoal):
 1. {f. eNorm N1 f = 0} \<subseteq> {f. eNorm N2 f = 0}
[PROOF STEP]
by (auto, metis le_zero_eq mult_zero_right)


[STATEMENT]
lemma is_gcd_gcd: "is_gcd (gcd a b) a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_gcd (gcd a b) a b
[PROOF STEP]
using gcd_greatest
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?c dvd ?a; ?c dvd ?b\<rbrakk> \<Longrightarrow> ?c dvd gcd ?a ?b

goal (1 subgoal):
 1. is_gcd (gcd a b) a b
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_prod_list_zero_iff: fixes x :: "'a :: idom"
  shows "(poly (prod_list ps) x = 0) = (\<exists> p \<in> set ps. poly p x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (prod_list ps) x = (0::'a)) = (\<exists>p\<in>set ps. poly p x = (0::'a))
[PROOF STEP]
by (induct ps, auto)


[STATEMENT]
lemma gcd_is_Max_divisors_nat:
  fixes m n :: nat
  assumes "n > 0" shows "gcd m n = Max {d. d dvd m \<and> d dvd n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd m n = Max {d. d dvd m \<and> d dvd n}
[PROOF STEP]
proof (rule Max_eqI[THEN sym], simp_all)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {d. d dvd m \<and> d dvd n}
 2. \<And>y. y dvd m \<and> y dvd n \<Longrightarrow> y \<le> gcd m n
[PROOF STEP]
show "finite {d. d dvd m \<and> d dvd n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {d. d dvd m \<and> d dvd n}
[PROOF STEP]
by (simp add: \<open>n > 0\<close>)
[PROOF STATE]
proof (state)
this:
finite {d. d dvd m \<and> d dvd n}

goal (1 subgoal):
 1. \<And>y. y dvd m \<and> y dvd n \<Longrightarrow> y \<le> gcd m n
[PROOF STEP]
show "\<And>y. y dvd m \<and> y dvd n \<Longrightarrow> y \<le> gcd m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y dvd m \<and> y dvd n \<Longrightarrow> y \<le> gcd m n
[PROOF STEP]
by (simp add: \<open>n > 0\<close> dvd_imp_le)
[PROOF STATE]
proof (state)
this:
?y dvd m \<and> ?y dvd n \<Longrightarrow> ?y \<le> gcd m n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma total_eval_mult:
  assumes "P \<in> carrier (Pring R I)"
  assumes "Q \<in> carrier (Pring R I)"
  assumes "closed_fun R g"
  shows "total_eval R g (P \<otimes>\<^bsub>Pring R I\<^esub> Q) = (total_eval R g P) \<otimes>\<^bsub>R\<^esub>(total_eval R g Q) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. total_eval R g (P \<otimes>\<^bsub>Pring R I\<^esub> Q) = total_eval R g P \<otimes> total_eval R g Q
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) ring_hom_mult ring_hom_ring.homh total_eval_ring_hom)


[STATEMENT]
lemma an_1[simp]:"an 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. an 1 = 1
[PROOF STEP]
by (simp add:an_def One_ant_def)


[STATEMENT]
lemma octo_of_real_inverse [simp]:
  "octo_of_real (inverse x) = inverse (octo_of_real x )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. octo_of_real (inverse x) = inverse (octo_of_real x)
[PROOF STEP]
by (simp add: octo_eq_iff power2_eq_square divide_simps)


[STATEMENT]
lemma mat_abelian_monoid: "abelian_monoid (mat_ring n b :: (('a :: semiring_1) mat,'b)ring_scheme)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abelian_monoid (mat_ring n b)
[PROOF STEP]
unfolding mat_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abelian_monoid \<lparr>carrier = Collect (mat n n), mult = mat_mult n, one = mat1 n, zero = mat0 n n, add = mat_plus, \<dots> = b\<rparr>
[PROOF STEP]
unfolding abelian_monoid_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.comm_monoid (add_monoid \<lparr>carrier = Collect (mat n n), mult = mat_mult n, one = mat1 n, zero = mat0 n n, add = mat_plus, \<dots> = b\<rparr>)
[PROOF STEP]
using mat_comm_monoid[of n n, unfolded mat_monoid_def mat_ring_def]
[PROOF STATE]
proof (prove)
using this:
Group.comm_monoid \<lparr>carrier = Collect (mat n n), mult = mat_plus, one = mat0 n n, \<dots> = ?b\<rparr>

goal (1 subgoal):
 1. Group.comm_monoid (add_monoid \<lparr>carrier = Collect (mat n n), mult = mat_mult n, one = mat1 n, zero = mat0 n n, add = mat_plus, \<dots> = b\<rparr>)
[PROOF STEP]
by simp