[STATEMENT]
lemma order_sum_degree: assumes "p \<noteq> 0"
  shows "sum (\<lambda> a. order a p) { a. poly p a = 0 } \<le> degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
define n where "n = degree p"
[PROOF STATE]
proof (state)
this:
n = degree p

goal (1 subgoal):
 1. (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
have "degree p \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree p \<le> n
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree p \<le> degree p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree p \<le> n

goal (1 subgoal):
 1. (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
degree p \<le> n

goal (1 subgoal):
 1. (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
using \<open>p \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
degree p \<le> n
p \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
proof (induct n arbitrary: p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>p. \<lbrakk>degree p \<le> 0; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<And>n p. \<lbrakk>\<And>p. \<lbrakk>degree p \<le> n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p; degree p \<le> Suc n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
case (0 p)
[PROOF STATE]
proof (state)
this:
degree p \<le> 0
p \<noteq> 0

goal (2 subgoals):
 1. \<And>p. \<lbrakk>degree p \<le> 0; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<And>n p. \<lbrakk>\<And>p. \<lbrakk>degree p \<le> n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p; degree p \<le> Suc n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
define a where "a = coeff p 0"
[PROOF STATE]
proof (state)
this:
a = coeff p 0

goal (2 subgoals):
 1. \<And>p. \<lbrakk>degree p \<le> 0; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<And>n p. \<lbrakk>\<And>p. \<lbrakk>degree p \<le> n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p; degree p \<le> Suc n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
from 0
[PROOF STATE]
proof (chain)
picking this:
degree p \<le> 0
p \<noteq> 0
[PROOF STEP]
have "degree p = 0"
[PROOF STATE]
proof (prove)
using this:
degree p \<le> 0
p \<noteq> 0

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

goal (2 subgoals):
 1. \<And>p. \<lbrakk>degree p \<le> 0; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<And>n p. \<lbrakk>\<And>p. \<lbrakk>degree p \<le> n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p; degree p \<le> Suc n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
hence p: "p = [: a :]"
[PROOF STATE]
proof (prove)
using this:
degree p = 0

goal (1 subgoal):
 1. p = [:a:]
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
using this:
degree p = 0

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

goal (2 subgoals):
 1. \<And>p. \<lbrakk>degree p \<le> 0; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<And>n p. \<lbrakk>\<And>p. \<lbrakk>degree p \<le> n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p; degree p \<le> Suc n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
with 0
[PROOF STATE]
proof (chain)
picking this:
degree p \<le> 0
p \<noteq> 0
p = [:a:]
[PROOF STEP]
have "a \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
degree p \<le> 0
p \<noteq> 0
p = [:a:]

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

goal (2 subgoals):
 1. \<And>p. \<lbrakk>degree p \<le> 0; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<And>n p. \<lbrakk>\<And>p. \<lbrakk>degree p \<le> n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p; degree p \<le> Suc n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
unfolding p
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<Sum>a | poly [:a:] a = (0::'a). order a [:a:]) \<le> degree [:a:]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p

goal (1 subgoal):
 1. \<And>n p. \<lbrakk>\<And>p. \<lbrakk>degree p \<le> n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p; degree p \<le> Suc n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n p. \<lbrakk>\<And>p. \<lbrakk>degree p \<le> n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p; degree p \<le> Suc n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
case (Suc m p)
[PROOF STATE]
proof (state)
this:
\<lbrakk>degree ?p \<le> m; ?p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly ?p a = (0::'a). order a ?p) \<le> degree ?p
degree p \<le> Suc m
p \<noteq> 0

goal (1 subgoal):
 1. \<And>n p. \<lbrakk>\<And>p. \<lbrakk>degree p \<le> n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p; degree p \<le> Suc n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
note order = order[OF \<open>p \<noteq> 0\<close>]
[PROOF STATE]
proof (state)
this:
[:- ?a, 1::'a:] ^ order ?a p dvd p \<and> \<not> [:- ?a, 1::'a:] ^ Suc (order ?a p) dvd p

goal (1 subgoal):
 1. \<And>n p. \<lbrakk>\<And>p. \<lbrakk>degree p \<le> n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p; degree p \<le> Suc n; p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
proof (cases "\<exists> a. poly p a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<exists>a. poly p a = (0::'a)

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>a. poly p a = (0::'a)
[PROOF STEP]
obtain a where root: "poly p a = 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>a. poly p a = (0::'a)

goal (1 subgoal):
 1. (\<And>a. poly p a = (0::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly p a = (0::'a)

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
with order_root[of p a] Suc
[PROOF STATE]
proof (chain)
picking this:
(poly p a = (0::'a)) = (p = 0 \<or> order a p \<noteq> 0)
\<lbrakk>degree ?p \<le> m; ?p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly ?p a = (0::'a). order a ?p) \<le> degree ?p
degree p \<le> Suc m
p \<noteq> 0
poly p a = (0::'a)
[PROOF STEP]
obtain n where orda: "order a p = Suc n"
[PROOF STATE]
proof (prove)
using this:
(poly p a = (0::'a)) = (p = 0 \<or> order a p \<noteq> 0)
\<lbrakk>degree ?p \<le> m; ?p \<noteq> 0\<rbrakk> \<Longrightarrow> (\<Sum>a | poly ?p a = (0::'a). order a ?p) \<le> degree ?p
degree p \<le> Suc m
p \<noteq> 0
poly p a = (0::'a)

goal (1 subgoal):
 1. (\<And>n. order a p = Suc n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "order a p", auto)
[PROOF STATE]
proof (state)
this:
order a p = Suc n

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
let ?a = "[: -a, 1 :] ^ Suc n"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
from order_decomp[OF \<open>p \<noteq> 0\<close>, of a, unfolded orda]
[PROOF STATE]
proof (chain)
picking this:
\<exists>q. p = [:- a, 1::'a:] ^ Suc n * q \<and> \<not> [:- a, 1::'a:] dvd q
[PROOF STEP]
obtain q where p: "p = ?a * q" and ndvd: "\<not> [:- a, 1:] dvd q"
[PROOF STATE]
proof (prove)
using this:
\<exists>q. p = [:- a, 1::'a:] ^ Suc n * q \<and> \<not> [:- a, 1::'a:] dvd q

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>p = [:- a, 1::'a:] ^ Suc n * q; \<not> [:- a, 1::'a:] dvd q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = [:- a, 1::'a:] ^ Suc n * q
\<not> [:- a, 1::'a:] dvd q

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
from \<open>p \<noteq> 0\<close>[unfolded p]
[PROOF STATE]
proof (chain)
picking this:
[:- a, 1::'a:] ^ Suc n * q \<noteq> 0
[PROOF STEP]
have nz: "?a \<noteq> 0" "q \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
[:- a, 1::'a:] ^ Suc n * q \<noteq> 0

goal (1 subgoal):
 1. [:- a, 1::'a:] ^ Suc n \<noteq> 0 &&& q \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[:- a, 1::'a:] ^ Suc n \<noteq> 0
q \<noteq> 0

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
hence deg: "degree p = degree ?a + degree q"
[PROOF STATE]
proof (prove)
using this:
[:- a, 1::'a:] ^ Suc n \<noteq> 0
q \<noteq> 0

goal (1 subgoal):
 1. degree p = degree ([:- a, 1::'a:] ^ Suc n) + degree q
[PROOF STEP]
unfolding p
[PROOF STATE]
proof (prove)
using this:
[:- a, 1::'a:] ^ Suc n \<noteq> 0
q \<noteq> 0

goal (1 subgoal):
 1. degree ([:- a, 1::'a:] ^ Suc n * q) = degree ([:- a, 1::'a:] ^ Suc n) + degree q
[PROOF STEP]
by (subst degree_mult_eq, auto)
[PROOF STATE]
proof (state)
this:
degree p = degree ([:- a, 1::'a:] ^ Suc n) + degree q

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
have ord: "\<And> a. order a p = order a ?a + order a q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa. order aa p = order aa ([:- a, 1::'a:] ^ Suc n) + order aa q
[PROOF STEP]
unfolding p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa. order aa ([:- a, 1::'a:] ^ Suc n * q) = order aa ([:- a, 1::'a:] ^ Suc n) + order aa q
[PROOF STEP]
by (subst order_mult, insert nz, auto)
[PROOF STATE]
proof (state)
this:
order ?a p = order ?a ([:- a, 1::'a:] ^ Suc n) + order ?a q

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
have roots: "{ a. poly p a = 0 } = insert a ({ a. poly q a = 0} - {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a. poly p a = (0::'a)} = insert a ({a. poly q a = (0::'a)} - {a})
[PROOF STEP]
using root
[PROOF STATE]
proof (prove)
using this:
poly p a = (0::'a)

goal (1 subgoal):
 1. {a. poly p a = (0::'a)} = insert a ({a. poly q a = (0::'a)} - {a})
[PROOF STEP]
unfolding p poly_mult
[PROOF STATE]
proof (prove)
using this:
poly ([:- a, 1::'a:] ^ Suc n) a * poly q a = (0::'a)

goal (1 subgoal):
 1. {aa. poly ([:- a, 1::'a:] ^ Suc n) aa * poly q aa = (0::'a)} = insert a ({a. poly q a = (0::'a)} - {a})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a. poly p a = (0::'a)} = insert a ({a. poly q a = (0::'a)} - {a})

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
have fin: "finite {a. poly q a = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {a. poly q a = (0::'a)}
[PROOF STEP]
by (rule poly_roots_finite[OF \<open>q \<noteq> 0\<close>])
[PROOF STATE]
proof (state)
this:
finite {a. poly q a = (0::'a)}

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
have "Suc n = order a p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n = order a p
[PROOF STEP]
using orda
[PROOF STATE]
proof (prove)
using this:
order a p = Suc n

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

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc n = order a p

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
have "\<dots> = Suc n + order a q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order a p = Suc n + order a q
[PROOF STEP]
unfolding ord order_linear_power'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if - a = - a then Suc n else 0) + order a q = Suc n + order a q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
order a p = Suc n + order a q

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Suc n = Suc n + order a q
[PROOF STEP]
have "order a q = 0"
[PROOF STATE]
proof (prove)
using this:
Suc n = Suc n + order a q

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

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
with order_root[of q a] \<open>q \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
(poly q a = (0::'a)) = (q = 0 \<or> order a q \<noteq> 0)
q \<noteq> 0
order a q = 0
[PROOF STEP]
have qa: "poly q a \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
(poly q a = (0::'a)) = (q = 0 \<or> order a q \<noteq> 0)
q \<noteq> 0
order a q = 0

goal (1 subgoal):
 1. poly q a \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly q a \<noteq> (0::'a)

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
have "(\<Sum>a\<in>{a. poly q a = 0} - {a}. order a p) = (\<Sum>a\<in>{a. poly q a = 0} - {a}. order a q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a p) = (\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a q)
[PROOF STEP]
proof (rule sum.cong[OF refl])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {a. poly q a = (0::'a)} - {a} \<Longrightarrow> order x p = order x q
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {a. poly q a = (0::'a)} - {a} \<Longrightarrow> order x p = order x q
[PROOF STEP]
assume "b \<in> {a. poly q a = 0} - {a}"
[PROOF STATE]
proof (state)
this:
b \<in> {a. poly q a = (0::'a)} - {a}

goal (1 subgoal):
 1. \<And>x. x \<in> {a. poly q a = (0::'a)} - {a} \<Longrightarrow> order x p = order x q
[PROOF STEP]
hence "b \<noteq> a"
[PROOF STATE]
proof (prove)
using this:
b \<in> {a. poly q a = (0::'a)} - {a}

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

goal (1 subgoal):
 1. \<And>x. x \<in> {a. poly q a = (0::'a)} - {a} \<Longrightarrow> order x p = order x q
[PROOF STEP]
hence "order b ?a = 0"
[PROOF STATE]
proof (prove)
using this:
b \<noteq> a

goal (1 subgoal):
 1. order b ([:- a, 1::'a:] ^ Suc n) = 0
[PROOF STEP]
unfolding order_linear_power'
[PROOF STATE]
proof (prove)
using this:
b \<noteq> a

goal (1 subgoal):
 1. (if - a = - b then Suc n else 0) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
order b ([:- a, 1::'a:] ^ Suc n) = 0

goal (1 subgoal):
 1. \<And>x. x \<in> {a. poly q a = (0::'a)} - {a} \<Longrightarrow> order x p = order x q
[PROOF STEP]
thus "order b p = order b q"
[PROOF STATE]
proof (prove)
using this:
order b ([:- a, 1::'a:] ^ Suc n) = 0

goal (1 subgoal):
 1. order b p = order b q
[PROOF STEP]
unfolding ord
[PROOF STATE]
proof (prove)
using this:
order b ([:- a, 1::'a:] ^ Suc n) = 0

goal (1 subgoal):
 1. order b ([:- a, 1::'a:] ^ Suc n) + order b q = order b q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
order b p = order b q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a p) = (\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a q)

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a p) = (\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a q)

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
have "\<dots> = (\<Sum>a\<in>{a. poly q a = 0}. order a q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a q) = (\<Sum>a | poly q a = (0::'a). order a q)
[PROOF STEP]
using qa
[PROOF STATE]
proof (prove)
using this:
poly q a \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a q) = (\<Sum>a | poly q a = (0::'a). order a q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a q) = (\<Sum>a | poly q a = (0::'a). order a q)

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a q) = (\<Sum>a | poly q a = (0::'a). order a q)

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
have "\<dots> \<le> degree q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a | poly q a = (0::'a). order a q) \<le> degree q
[PROOF STEP]
by (rule Suc(1)[OF _ \<open>q \<noteq> 0\<close>],
        insert deg[unfolded degree_linear_power] Suc(2), auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>a | poly q a = (0::'a). order a q) \<le> degree q

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a p) \<le> degree q
[PROOF STEP]
have "(\<Sum>a\<in>{a. poly q a = 0} - {a}. order a p) \<le> degree q"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a p) \<le> degree q

goal (1 subgoal):
 1. (\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a p) \<le> degree q
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a p) \<le> degree q

goal (2 subgoals):
 1. \<exists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
 2. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a p) \<le> degree q

goal (1 subgoal):
 1. (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
unfolding roots deg
[PROOF STATE]
proof (prove)
using this:
(\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a p) \<le> degree q

goal (1 subgoal):
 1. (\<Sum>a\<in>insert a ({a. poly q a = (0::'a)} - {a}). order a p) \<le> degree ([:- a, 1::'a:] ^ Suc n) + degree q
[PROOF STEP]
using fin
[PROOF STATE]
proof (prove)
using this:
(\<Sum>a\<in>{a. poly q a = (0::'a)} - {a}. order a p) \<le> degree q
finite {a. poly q a = (0::'a)}

goal (1 subgoal):
 1. (\<Sum>a\<in>insert a ({a. poly q a = (0::'a)} - {a}). order a p) \<le> degree ([:- a, 1::'a:] ^ Suc n) + degree q
[PROOF STEP]
by (subst sum.insert, simp_all only: degree_linear_power, auto simp: orda)
[PROOF STATE]
proof (state)
this:
(\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p

goal (1 subgoal):
 1. \<nexists>a. poly p a = (0::'a) \<Longrightarrow> (\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>a | poly p a = (0::'a). order a p) \<le> degree p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SA_poly_to_SA_fun_add_eval:
  assumes "f \<in> carrier (UP (SA n))"
  assumes "g \<in> carrier (UP (SA n))"
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>Suc n\<^esup>)"
  shows "SA_poly_to_SA_fun n (f \<oplus>\<^bsub>UP (SA n)\<^esub> g) a = SA_poly_to_SA_fun n f a \<oplus>\<^bsub>Q\<^sub>p\<^esub> SA_poly_to_SA_fun n g a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SA_poly_to_SA_fun n (f \<oplus>\<^bsub>UP (SA n)\<^esub> g) a = SA_poly_to_SA_fun n f a \<oplus> SA_poly_to_SA_fun n g a
[PROOF STEP]
unfolding SA_poly_to_SA_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a\<in>carrier (Q\<^sub>p\<^bsup>Suc n\<^esup>). SA_poly_to_Qp_poly n (tl a) (f \<oplus>\<^bsub>UP (SA n)\<^esub> g) \<bullet> lead_coeff a) a = (\<lambda>a\<in>carrier (Q\<^sub>p\<^bsup>Suc n\<^esup>). SA_poly_to_Qp_poly n (tl a) f \<bullet> lead_coeff a) a \<oplus> (\<lambda>a\<in>carrier (Q\<^sub>p\<^bsup>Suc n\<^esup>). SA_poly_to_Qp_poly n (tl a) g \<bullet> lead_coeff a) a
[PROOF STEP]
using assms SA_poly_to_Qp_poly_add[of "tl a" n f g]
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (UP (SA n))
g \<in> carrier (UP (SA n))
a \<in> carrier (Q\<^sub>p\<^bsup>Suc n\<^esup>)
\<lbrakk>tl a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>); f \<in> carrier (UP (SA n)); g \<in> carrier (UP (SA n))\<rbrakk> \<Longrightarrow> SA_poly_to_Qp_poly n (tl a) (f \<oplus>\<^bsub>UP (SA n)\<^esub> g) = SA_poly_to_Qp_poly n (tl a) f \<oplus>\<^bsub>UP Q\<^sub>p\<^esub> SA_poly_to_Qp_poly n (tl a) g

goal (1 subgoal):
 1. (\<lambda>a\<in>carrier (Q\<^sub>p\<^bsup>Suc n\<^esup>). SA_poly_to_Qp_poly n (tl a) (f \<oplus>\<^bsub>UP (SA n)\<^esub> g) \<bullet> lead_coeff a) a = (\<lambda>a\<in>carrier (Q\<^sub>p\<^bsup>Suc n\<^esup>). SA_poly_to_Qp_poly n (tl a) f \<bullet> lead_coeff a) a \<oplus> (\<lambda>a\<in>carrier (Q\<^sub>p\<^bsup>Suc n\<^esup>). SA_poly_to_Qp_poly n (tl a) g \<bullet> lead_coeff a) a
[PROOF STEP]
by (metis (no_types, lifting) SA_poly_to_Qp_poly_closed UPQ.to_fun_plus cartesian_power_head cartesian_power_tail restrict_apply')


[STATEMENT]
lemma vlrestriction_VLambda: "(\<lambda>a\<in>\<^sub>\<circ>A. f a) \<restriction>\<^sup>l\<^sub>\<circ> B = (\<lambda>a\<in>\<^sub>\<circ>A \<inter>\<^sub>\<circ> B. f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VLambda A f \<restriction>\<^sup>l\<^sub>\<circ> B = VLambda (A \<inter>\<^sub>\<circ> B) f
[PROOF STEP]
by auto


[STATEMENT]
lemma osum_cong:
  assumes "t =o u" and "r =o s"
  shows "t +o r =o u +o s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t +o r =o u +o s
[PROOF STEP]
using ordIso_transitive[OF osum_congL[OF assms(1)] osum_congR[OF assms(2)]]
  assms[unfolded ordIso_def]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Well_order r; Well_order u\<rbrakk> \<Longrightarrow> t +o r =o u +o s
(t, u) \<in> {(r, r'). Well_order r \<and> Well_order r' \<and> Ex (iso r r')}
(r, s) \<in> {(r, r'). Well_order r \<and> Well_order r' \<and> Ex (iso r r')}

goal (1 subgoal):
 1. t +o r =o u +o s
[PROOF STEP]
by auto


[STATEMENT]
lemma solves_Vagree_trans: "Uvariation (F(0)) \<omega> U \<Longrightarrow> solves_ODE I F x \<theta> \<Longrightarrow> Uvariation (F(\<zeta>)) \<omega> (U\<union>{RVar x,DVar x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Uvariation (F 0) \<omega> U; solves_ODE I F x \<theta>\<rbrakk> \<Longrightarrow> Uvariation (F \<zeta>) \<omega> (U \<union> {RVar x, DVar x})
[PROOF STEP]
using solves_Vagree Uvariation_Vagree solves_ODE_def
[PROOF STATE]
proof (prove)
using this:
solves_ODE ?I ?F ?x ?\<theta> \<Longrightarrow> Vagree (?F ?\<zeta>) (?F 0) (- {RVar ?x, DVar ?x})
Uvariation ?\<nu> ?\<nu>' (- ?V) = Vagree ?\<nu> ?\<nu>' ?V
solves_ODE ?I ?F ?x ?\<theta> \<equiv> \<forall>\<zeta>. Vagree (?F 0) (?F \<zeta>) (- {RVar ?x, DVar ?x}) \<and> ?F \<zeta> (DVar ?x) = deriv (\<lambda>t. ?F t (RVar ?x)) \<zeta> \<and> ?F \<zeta> (DVar ?x) = term_sem ?I ?\<theta> (?F \<zeta>)

goal (1 subgoal):
 1. \<lbrakk>Uvariation (F 0) \<omega> U; solves_ODE I F x \<theta>\<rbrakk> \<Longrightarrow> Uvariation (F \<zeta>) \<omega> (U \<union> {RVar x, DVar x})
[PROOF STEP]
by (metis Uvariation_sym_rel Uvariation_trans double_complement)


[STATEMENT]
lemma linf_norm_poly_greater_0 [simp]:
  fixes f :: "'a :: ordered_ab_group_add_abs poly"
  shows "\<parallel>f\<parallel>\<^sub>\<infinity> > 0 \<longleftrightarrow> f \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0::'a) < \<parallel>f\<parallel>\<^sub>\<infinity>) = (f \<noteq> 0)
[PROOF STEP]
by (induct f, auto simp: max_def)


[STATEMENT]
theorem Class_unit_normal_subgroup: "Class \<one> = K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Class \<one> = K
[PROOF STEP]
unfolding Class_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a\<in>G. {b \<in> G. (b, a) \<in> Congruence}) \<one> = K
[PROOF STEP]
unfolding Congruence_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a\<in>G. {b \<in> G. (b, a) \<in> {(a, b). a \<in> G \<and> b \<in> G \<and> inverse a \<cdot> b \<in> K}}) \<one> = K
[PROOF STEP]
using invertible_inverse_inverse submonoid_inverse_closed
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>invertible ?u; ?u \<in> G\<rbrakk> \<Longrightarrow> inverse (inverse ?u) = ?u
\<lbrakk>sub.invertible ?u; ?u \<in> K\<rbrakk> \<Longrightarrow> inverse ?u \<in> K

goal (1 subgoal):
 1. (\<lambda>a\<in>G. {b \<in> G. (b, a) \<in> {(a, b). a \<in> G \<and> b \<in> G \<and> inverse a \<cdot> b \<in> K}}) \<one> = K
[PROOF STEP]
by fastforce


[STATEMENT]
lemma mult_commute_abs: "(\<lambda>x. x * c) = (*) c"
  for c :: "'a::ab_semigroup_mult"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x * c) = (*) c
[PROOF STEP]
by (simp add: fun_eq_iff mult.commute)


[STATEMENT]
lemma lemma_3_10_ii_i:
  "H \<in> filters \<Longrightarrow>  (\<forall> a . {a} ** H = H ** {a}) \<Longrightarrow> H \<in> normalfilters"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<in> filters; \<forall>a. {a} ** H = H ** {a}\<rbrakk> \<Longrightarrow> H \<in> normalfilters
[PROOF STEP]
apply (rule lemma_3_10_iii_i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>H \<in> filters; \<forall>a. {a} ** H = H ** {a}\<rbrakk> \<Longrightarrow> H \<in> filters
 2. \<lbrakk>H \<in> filters; \<forall>a. {a} ** H = H ** {a}\<rbrakk> \<Longrightarrow> cong_r H = cong_l H
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<in> filters; \<forall>a. {a} ** H = H ** {a}\<rbrakk> \<Longrightarrow> cong_r H = cong_l H
[PROOF STEP]
apply (rule lemma_3_10_ii_iii)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>H \<in> filters; \<forall>a. {a} ** H = H ** {a}\<rbrakk> \<Longrightarrow> H \<in> filters
 2. \<lbrakk>H \<in> filters; \<forall>a. {a} ** H = H ** {a}\<rbrakk> \<Longrightarrow> \<forall>a. {a} ** H = H ** {a}
[PROOF STEP]
by simp_all


[STATEMENT]
lemma borel_measurable_bilinear:
  fixes h :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space \<Rightarrow> 'c::euclidean_space"
  assumes "bilinear h" "f \<in> borel_measurable (lebesgue_on S)" "g \<in> borel_measurable (lebesgue_on S)"
    and S: "S \<in> sets lebesgue"
  shows "(\<lambda>x. h (f x) (g x)) \<in> borel_measurable (lebesgue_on S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. h (f x) (g x)) \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
using assms measurable_on_bilinear [of h f S g]
[PROOF STATE]
proof (prove)
using this:
bilinear h
f \<in> borel_measurable (lebesgue_on S)
g \<in> borel_measurable (lebesgue_on S)
S \<in> sets lebesgue
\<lbrakk>bilinear h; f measurable_on S; g measurable_on S\<rbrakk> \<Longrightarrow> (\<lambda>x. h (f x) (g x)) measurable_on S

goal (1 subgoal):
 1. (\<lambda>x. h (f x) (g x)) \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
by (simp flip: measurable_on_iff_borel_measurable)


[STATEMENT]
lemma pp_arc_linorder_matrix_1:
  fixes f :: "('a::finite,'b::non_trivial_linorder_stone_relation_algebra_expansion) square"
  assumes "matrix_stone_relation_algebra.pp_arc f"
    shows "\<exists>e . f e \<noteq> bot \<and> (\<forall>d . e \<noteq> d \<longrightarrow> f d = bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
have "matrix_stone_relation_algebra.pp_point (f \<odot> mtop)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.pp_point (f \<odot> mtop)
[PROOF STEP]
by (simp add: assms matrix_bounded_idempotent_semiring.vector_mult_closed)
[PROOF STATE]
proof (state)
this:
matrix_stone_relation_algebra.pp_point (f \<odot> mtop)

goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
matrix_stone_relation_algebra.pp_point (f \<odot> mtop)
[PROOF STEP]
obtain i where 1: "\<forall>j . (f \<odot> mtop) (i,j) \<noteq> bot \<and> (\<forall>k . (f \<odot> mtop) (i,j) = (f \<odot> mtop) (i,k)) \<and> (\<forall>k . i \<noteq> k \<longrightarrow> (f \<odot> mtop) (k,j) = bot)"
[PROOF STATE]
proof (prove)
using this:
matrix_stone_relation_algebra.pp_point (f \<odot> mtop)

goal (1 subgoal):
 1. (\<And>i. \<forall>j. (f \<odot> mtop) (i, j) \<noteq> bot \<and> (\<forall>k. (f \<odot> mtop) (i, j) = (f \<odot> mtop) (i, k)) \<and> (\<forall>k. i \<noteq> k \<longrightarrow> (f \<odot> mtop) (k, j) = bot) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis pp_point_linorder_matrix)
[PROOF STATE]
proof (state)
this:
\<forall>j. (f \<odot> mtop) (i, j) \<noteq> bot \<and> (\<forall>k. (f \<odot> mtop) (i, j) = (f \<odot> mtop) (i, k)) \<and> (\<forall>k. i \<noteq> k \<longrightarrow> (f \<odot> mtop) (k, j) = bot)

goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
have "matrix_stone_relation_algebra.pp_point (f\<^sup>t \<odot> mtop)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.pp_point (f\<^sup>t \<odot> mtop)
[PROOF STEP]
by (simp add: assms matrix_bounded_idempotent_semiring.vector_mult_closed)
[PROOF STATE]
proof (state)
this:
matrix_stone_relation_algebra.pp_point (f\<^sup>t \<odot> mtop)

goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
matrix_stone_relation_algebra.pp_point (f\<^sup>t \<odot> mtop)
[PROOF STEP]
obtain j where "\<forall>i . (f\<^sup>t \<odot> mtop) (j,i) \<noteq> bot \<and> (\<forall>k . (f\<^sup>t \<odot> mtop) (j,i) = (f\<^sup>t \<odot> mtop) (j,k)) \<and> (\<forall>k . j \<noteq> k \<longrightarrow> (f\<^sup>t \<odot> mtop) (k,i) = bot)"
[PROOF STATE]
proof (prove)
using this:
matrix_stone_relation_algebra.pp_point (f\<^sup>t \<odot> mtop)

goal (1 subgoal):
 1. (\<And>j. \<forall>i. (f\<^sup>t \<odot> mtop) (j, i) \<noteq> bot \<and> (\<forall>k. (f\<^sup>t \<odot> mtop) (j, i) = (f\<^sup>t \<odot> mtop) (j, k)) \<and> (\<forall>k. j \<noteq> k \<longrightarrow> (f\<^sup>t \<odot> mtop) (k, i) = bot) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis pp_point_linorder_matrix)
[PROOF STATE]
proof (state)
this:
\<forall>i. (f\<^sup>t \<odot> mtop) (j, i) \<noteq> bot \<and> (\<forall>k. (f\<^sup>t \<odot> mtop) (j, i) = (f\<^sup>t \<odot> mtop) (j, k)) \<and> (\<forall>k. j \<noteq> k \<longrightarrow> (f\<^sup>t \<odot> mtop) (k, i) = bot)

goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
hence 2: "\<forall>i . (mtop \<odot> f) (i,j) \<noteq> bot \<and> (\<forall>k . (mtop \<odot> f) (i,j) = (mtop \<odot> f) (k,j)) \<and> (\<forall>k . j \<noteq> k \<longrightarrow> (mtop \<odot> f) (i,k) = bot)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. (f\<^sup>t \<odot> mtop) (j, i) \<noteq> bot \<and> (\<forall>k. (f\<^sup>t \<odot> mtop) (j, i) = (f\<^sup>t \<odot> mtop) (j, k)) \<and> (\<forall>k. j \<noteq> k \<longrightarrow> (f\<^sup>t \<odot> mtop) (k, i) = bot)

goal (1 subgoal):
 1. \<forall>i. (mtop \<odot> f) (i, j) \<noteq> bot \<and> (\<forall>k. (mtop \<odot> f) (i, j) = (mtop \<odot> f) (k, j)) \<and> (\<forall>k. j \<noteq> k \<longrightarrow> (mtop \<odot> f) (i, k) = bot)
[PROOF STEP]
by (metis (no_types) old.prod.case conv_matrix_def conv_def matrix_stone_relation_algebra.conv_dist_comp matrix_stone_relation_algebra.conv_top)
[PROOF STATE]
proof (state)
this:
\<forall>i. (mtop \<odot> f) (i, j) \<noteq> bot \<and> (\<forall>k. (mtop \<odot> f) (i, j) = (mtop \<odot> f) (k, j)) \<and> (\<forall>k. j \<noteq> k \<longrightarrow> (mtop \<odot> f) (i, k) = bot)

goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
have 3: "\<forall>i k . j \<noteq> k \<longrightarrow> f (i,k) = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i k. j \<noteq> k \<longrightarrow> f (i, k) = bot
[PROOF STEP]
proof (intro allI, rule impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i k. j \<noteq> k \<Longrightarrow> f (i, k) = bot
[PROOF STEP]
fix i k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i k. j \<noteq> k \<Longrightarrow> f (i, k) = bot
[PROOF STEP]
assume "j \<noteq> k"
[PROOF STATE]
proof (state)
this:
j \<noteq> k

goal (1 subgoal):
 1. \<And>i k. j \<noteq> k \<Longrightarrow> f (i, k) = bot
[PROOF STEP]
hence "(\<Squnion>\<^sub>l f (l,k)) = bot"
[PROOF STATE]
proof (prove)
using this:
j \<noteq> k

goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>l. f (l, k)) {l. True} = bot
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
j \<noteq> k
\<forall>i. (mtop \<odot> f) (i, j) \<noteq> bot \<and> (\<forall>k. (mtop \<odot> f) (i, j) = (mtop \<odot> f) (k, j)) \<and> (\<forall>k. j \<noteq> k \<longrightarrow> (mtop \<odot> f) (i, k) = bot)

goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>l. f (l, k)) {l. True} = bot
[PROOF STEP]
by (simp add: top_comp_linorder_matrix)
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>l. f (l, k)) {l. True} = bot

goal (1 subgoal):
 1. \<And>i k. j \<noteq> k \<Longrightarrow> f (i, k) = bot
[PROOF STEP]
thus "f (i,k) = bot"
[PROOF STATE]
proof (prove)
using this:
sup_monoid.sum (\<lambda>l. f (l, k)) {l. True} = bot

goal (1 subgoal):
 1. f (i, k) = bot
[PROOF STEP]
by (metis bot.extremum_uniqueI comp_inf.ub_sum)
[PROOF STATE]
proof (state)
this:
f (i, k) = bot

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i k. j \<noteq> k \<longrightarrow> f (i, k) = bot

goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
have "(\<Squnion>\<^sub>k f (i,k)) \<noteq> bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>k. f (i, k)) {k. True} \<noteq> bot
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
\<forall>j. (f \<odot> mtop) (i, j) \<noteq> bot \<and> (\<forall>k. (f \<odot> mtop) (i, j) = (f \<odot> mtop) (i, k)) \<and> (\<forall>k. i \<noteq> k \<longrightarrow> (f \<odot> mtop) (k, j) = bot)

goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>k. f (i, k)) {k. True} \<noteq> bot
[PROOF STEP]
by (simp add: comp_top_linorder_matrix)
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>k. f (i, k)) {k. True} \<noteq> bot

goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
hence 4: "f (i,j) \<noteq> bot"
[PROOF STATE]
proof (prove)
using this:
sup_monoid.sum (\<lambda>k. f (i, k)) {k. True} \<noteq> bot

goal (1 subgoal):
 1. f (i, j) \<noteq> bot
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
sup_monoid.sum (\<lambda>k. f (i, k)) {k. True} \<noteq> bot
\<forall>i k. j \<noteq> k \<longrightarrow> f (i, k) = bot

goal (1 subgoal):
 1. f (i, j) \<noteq> bot
[PROOF STEP]
by (metis linorder_finite_sup_selective)
[PROOF STATE]
proof (state)
this:
f (i, j) \<noteq> bot

goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
have "\<forall>k l . k \<noteq> i \<or> l \<noteq> j \<longrightarrow> f (k,l) = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k l. k \<noteq> i \<or> l \<noteq> j \<longrightarrow> f (k, l) = bot
[PROOF STEP]
proof (intro allI, unfold imp_disjL, rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>k l. k \<noteq> i \<longrightarrow> f (k, l) = bot
 2. \<And>k l. l \<noteq> j \<longrightarrow> f (k, l) = bot
[PROOF STEP]
fix k l
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>k l. k \<noteq> i \<longrightarrow> f (k, l) = bot
 2. \<And>k l. l \<noteq> j \<longrightarrow> f (k, l) = bot
[PROOF STEP]
show "k \<noteq> i \<longrightarrow> f (k,l) = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<noteq> i \<longrightarrow> f (k, l) = bot
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<noteq> i \<Longrightarrow> f (k, l) = bot
[PROOF STEP]
assume "k \<noteq> i"
[PROOF STATE]
proof (state)
this:
k \<noteq> i

goal (1 subgoal):
 1. k \<noteq> i \<Longrightarrow> f (k, l) = bot
[PROOF STEP]
hence "(\<Squnion>\<^sub>m f (k,m)) = bot"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> i

goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>m. f (k, m)) {m. True} = bot
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
k \<noteq> i
\<forall>j. (f \<odot> mtop) (i, j) \<noteq> bot \<and> (\<forall>k. (f \<odot> mtop) (i, j) = (f \<odot> mtop) (i, k)) \<and> (\<forall>k. i \<noteq> k \<longrightarrow> (f \<odot> mtop) (k, j) = bot)

goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>m. f (k, m)) {m. True} = bot
[PROOF STEP]
by (simp add: comp_top_linorder_matrix)
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>m. f (k, m)) {m. True} = bot

goal (1 subgoal):
 1. k \<noteq> i \<Longrightarrow> f (k, l) = bot
[PROOF STEP]
thus "f (k,l) = bot"
[PROOF STATE]
proof (prove)
using this:
sup_monoid.sum (\<lambda>m. f (k, m)) {m. True} = bot

goal (1 subgoal):
 1. f (k, l) = bot
[PROOF STEP]
by (metis bot.extremum_uniqueI comp_inf.ub_sum)
[PROOF STATE]
proof (state)
this:
f (k, l) = bot

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
k \<noteq> i \<longrightarrow> f (k, l) = bot

goal (1 subgoal):
 1. \<And>k l. l \<noteq> j \<longrightarrow> f (k, l) = bot
[PROOF STEP]
show "l \<noteq> j \<longrightarrow> f (k,l) = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<noteq> j \<longrightarrow> f (k, l) = bot
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
\<forall>i k. j \<noteq> k \<longrightarrow> f (i, k) = bot

goal (1 subgoal):
 1. l \<noteq> j \<longrightarrow> f (k, l) = bot
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
l \<noteq> j \<longrightarrow> f (k, l) = bot

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>k l. k \<noteq> i \<or> l \<noteq> j \<longrightarrow> f (k, l) = bot

goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>k l. k \<noteq> i \<or> l \<noteq> j \<longrightarrow> f (k, l) = bot

goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
using 4
[PROOF STATE]
proof (prove)
using this:
\<forall>k l. k \<noteq> i \<or> l \<noteq> j \<longrightarrow> f (k, l) = bot
f (i, j) \<noteq> bot

goal (1 subgoal):
 1. \<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
[PROOF STEP]
by (metis old.prod.exhaust)
[PROOF STATE]
proof (state)
this:
\<exists>e. f e \<noteq> bot \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sgn_zero_iff: "sgn x = 0 \<longleftrightarrow> x = 0"
  for x :: "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sgn x = (0::'a)) = (x = (0::'a))
[PROOF STEP]
by (simp add: sgn_div_norm)


[STATEMENT]
lemma refine_to_conj: "c \<sqsubseteq> d\<^sub>0 \<Longrightarrow> c \<sqsubseteq> d\<^sub>1 \<Longrightarrow> c \<sqsubseteq> d\<^sub>0 \<iinter> d\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c \<sqsubseteq> d\<^sub>0; c \<sqsubseteq> d\<^sub>1\<rbrakk> \<Longrightarrow> c \<sqsubseteq> d\<^sub>0 \<iinter> d\<^sub>1
variables:
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c, d\<^sub>0, d\<^sub>1 :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis conj_idem conj_mono)


[STATEMENT]
lemma sink_aux1: "\<not> (2*i \<le> length h) \<Longrightarrow> \<not>has_left h i \<and> \<not>has_right h i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 2 * i \<le> length h \<Longrightarrow> \<not> has_left h i \<and> \<not> has_right h i
[PROOF STEP]
unfolding valid_def left_def right_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 2 * i \<le> length h \<Longrightarrow> \<not> (0 < 2 * i \<and> 2 * i \<le> length h) \<and> \<not> (0 < 2 * i + 1 \<and> 2 * i + 1 \<le> length h)
[PROOF STEP]
by auto


[STATEMENT]
lemma twice_field_differentiable_at_compose:
  assumes "f twice_field_differentiable_at x"
      and "g twice_field_differentiable_at (f x)"
    shows "(\<lambda>x. g (f x)) twice_field_differentiable_at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
obtain S S'
   where Df_on_S:  "f field_differentiable_on S" and x_int_S: "x \<in> interior S"
     and Dg_on_S': "g field_differentiable_on S'" and fx_int_S': "f x \<in> interior S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S S'. \<lbrakk>f field_differentiable_on S; x \<in> interior S; g field_differentiable_on S'; f x \<in> interior S'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms twice_field_differentiable_at_def
[PROOF STATE]
proof (prove)
using this:
f twice_field_differentiable_at x
g twice_field_differentiable_at f x
?f twice_field_differentiable_at ?x \<equiv> \<exists>S. ?f field_differentiable_on S \<and> ?x \<in> interior S \<and> deriv ?f field_differentiable at ?x

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

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
let ?T = "{x \<in> interior S. f x \<in> interior S'}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
have "continuous_on (interior S) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (interior S) f
[PROOF STEP]
by (meson Df_on_S continuous_on_eq_continuous_within continuous_on_subset field_differentiable_imp_continuous_at
         field_differentiable_on_def interior_subset)
[PROOF STATE]
proof (state)
this:
continuous_on (interior S) f

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on (interior S) f
[PROOF STEP]
have "open (interior S \<inter> {x. f x \<in> interior S'})"
[PROOF STATE]
proof (prove)
using this:
continuous_on (interior S) f

goal (1 subgoal):
 1. open (interior S \<inter> {x. f x \<in> interior S'})
[PROOF STEP]
by (metis continuous_open_preimage open_interior vimage_def)
[PROOF STATE]
proof (state)
this:
open (interior S \<inter> {x. f x \<in> interior S'})

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open (interior S \<inter> {x. f x \<in> interior S'})
[PROOF STEP]
have x_int_T: "x \<in> interior ?T"
[PROOF STATE]
proof (prove)
using this:
open (interior S \<inter> {x. f x \<in> interior S'})

goal (1 subgoal):
 1. x \<in> interior {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
by (metis (no_types) Collect_conj_eq Collect_mem_eq Int_Collect fx_int_S' interior_eq x_int_S)
[PROOF STATE]
proof (state)
this:
x \<in> interior {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
have  Dg_on_fT: "g field_differentiable_on f`?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g field_differentiable_on f ` {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
by (metis (no_types, lifting) Dg_on_S' field_differentiable_on_subset image_Collect_subsetI interior_subset)
[PROOF STATE]
proof (state)
this:
g field_differentiable_on f ` {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
have Df_on_T: "f field_differentiable_on ?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f field_differentiable_on {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
using  field_differentiable_on_subset Df_on_S
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f field_differentiable_on ?S; ?T \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?f field_differentiable_on ?T
f field_differentiable_on S

goal (1 subgoal):
 1. f field_differentiable_on {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
by (metis Collect_subset interior_subset)
[PROOF STATE]
proof (state)
this:
f field_differentiable_on {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
have "(\<lambda>x. g (f x)) field_differentiable_on ?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. g (f x)) field_differentiable_on {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
unfolding field_differentiable_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{x \<in> interior S. f x \<in> interior S'}. (\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> (\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> (\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
assume x_int: "x \<in> {x \<in> interior S. f x \<in> interior S'}"
[PROOF STATE]
proof (state)
this:
x \<in> {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. \<And>x. x \<in> {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> (\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
have "f field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f field_differentiable at x
[PROOF STEP]
by (metis Df_on_S at_within_interior field_differentiable_on_def interior_subset mem_Collect_eq subsetD x_int)
[PROOF STATE]
proof (state)
this:
f field_differentiable at x

goal (1 subgoal):
 1. \<And>x. x \<in> {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> (\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f field_differentiable at x

goal (1 subgoal):
 1. \<And>x. x \<in> {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> (\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
have "g field_differentiable at (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g field_differentiable at (f x)
[PROOF STEP]
by (metis Dg_on_S' at_within_interior field_differentiable_on_def interior_subset mem_Collect_eq subsetD x_int)
[PROOF STATE]
proof (state)
this:
g field_differentiable at (f x)

goal (1 subgoal):
 1. \<And>x. x \<in> {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> (\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f field_differentiable at x
g field_differentiable at (f x)
[PROOF STEP]
have "(g \<circ> f) field_differentiable at x"
[PROOF STATE]
proof (prove)
using this:
f field_differentiable at x
g field_differentiable at (f x)

goal (1 subgoal):
 1. g \<circ> f field_differentiable at x
[PROOF STEP]
by (simp add: field_differentiable_compose)
[PROOF STATE]
proof (state)
this:
g \<circ> f field_differentiable at x

goal (1 subgoal):
 1. \<And>x. x \<in> {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> (\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g \<circ> f field_differentiable at x
[PROOF STEP]
have "(\<lambda>x. g (f x)) field_differentiable at x"
[PROOF STATE]
proof (prove)
using this:
g \<circ> f field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) field_differentiable at x
[PROOF STEP]
by (simp add: comp_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. g (f x)) field_differentiable at x

goal (1 subgoal):
 1. \<And>x. x \<in> {x \<in> interior S. f x \<in> interior S'} \<Longrightarrow> (\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. g (f x)) field_differentiable at x
[PROOF STEP]
show "(\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. g (f x)) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
using field_differentiable_at_within
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. g (f x)) field_differentiable at x
?f field_differentiable at ?x \<Longrightarrow> ?f field_differentiable at ?x within ?S

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>x. g (f x)) field_differentiable at x within {x \<in> interior S. f x \<in> interior S'}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. g (f x)) field_differentiable_on {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. g (f x)) field_differentiable_on {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
have "deriv (\<lambda>x. g (f x)) field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>x. g (f x)) field_differentiable at x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deriv (\<lambda>x. g (f x)) field_differentiable at x
[PROOF STEP]
have "(\<lambda>x. deriv g (f x)) field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. deriv g (f x)) field_differentiable at x
[PROOF STEP]
by (metis DERIV_chain2 assms deriv_field_differentiable_at field_differentiable_def once_field_differentiable_at)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. deriv g (f x)) field_differentiable at x

goal (1 subgoal):
 1. deriv (\<lambda>x. g (f x)) field_differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. deriv g (f x)) field_differentiable at x
[PROOF STEP]
have "(\<lambda>x. deriv g (f x) * deriv f x) field_differentiable at x"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. deriv g (f x)) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. deriv g (f x) * deriv f x) field_differentiable at x
[PROOF STEP]
using assms field_differentiable_mult[of "\<lambda>x. deriv g (f x)"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. deriv g (f x)) field_differentiable at x
f twice_field_differentiable_at x
g twice_field_differentiable_at f x
\<lbrakk>(\<lambda>x. deriv g (f x)) field_differentiable at ?a within ?S; ?g field_differentiable at ?a within ?S\<rbrakk> \<Longrightarrow> (\<lambda>z. deriv g (f z) * ?g z) field_differentiable at ?a within ?S

goal (1 subgoal):
 1. (\<lambda>x. deriv g (f x) * deriv f x) field_differentiable at x
[PROOF STEP]
by (simp add: deriv_field_differentiable_at)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. deriv g (f x) * deriv f x) field_differentiable at x

goal (1 subgoal):
 1. deriv (\<lambda>x. g (f x)) field_differentiable at x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. deriv g (f x) * deriv f x) field_differentiable at x

goal (1 subgoal):
 1. deriv (\<lambda>x. g (f x)) field_differentiable at x
[PROOF STEP]
have "deriv (deriv (\<lambda>x. g (f x))) x = deriv (\<lambda>x. deriv g (f x) * deriv f x) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (deriv (\<lambda>x. g (f x))) x = deriv (\<lambda>x. deriv g (f x) * deriv f x) x
[PROOF STEP]
using assms Df_on_S x_int_S deriv_cong_ev eventually_deriv_compose
[PROOF STATE]
proof (prove)
using this:
f twice_field_differentiable_at x
g twice_field_differentiable_at f x
f field_differentiable_on S
x \<in> interior S
\<lbrakk>\<forall>\<^sub>F x in nhds ?x. ?f x = ?g x; ?x = ?y\<rbrakk> \<Longrightarrow> deriv ?f ?x = deriv ?g ?y
\<lbrakk>\<exists>S. ?f field_differentiable_on S \<and> ?x \<in> interior S; ?g twice_field_differentiable_at ?f ?x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in nhds ?x. deriv (\<lambda>x. ?g (?f x)) x = deriv ?g (?f x) * deriv ?f x

goal (1 subgoal):
 1. deriv (deriv (\<lambda>x. g (f x))) x = deriv (\<lambda>x. deriv g (f x) * deriv f x) x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
deriv (deriv (\<lambda>x. g (f x))) x = deriv (\<lambda>x. deriv g (f x) * deriv f x) x

goal (1 subgoal):
 1. deriv (\<lambda>x. g (f x)) field_differentiable at x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. deriv g (f x) * deriv f x) field_differentiable at x
deriv (deriv (\<lambda>x. g (f x))) x = deriv (\<lambda>x. deriv g (f x) * deriv f x) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. deriv g (f x) * deriv f x) field_differentiable at x
deriv (deriv (\<lambda>x. g (f x))) x = deriv (\<lambda>x. deriv g (f x) * deriv f x) x

goal (1 subgoal):
 1. deriv (\<lambda>x. g (f x)) field_differentiable at x
[PROOF STEP]
using assms eventually_deriv_compose DERIV_deriv_iff_field_differentiable Df_on_S x_int_S
            DERIV_cong_ev[of x x "deriv (\<lambda>x. g (f x))" "\<lambda>x. deriv g (f x) * deriv f x"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. deriv g (f x) * deriv f x) field_differentiable at x
deriv (deriv (\<lambda>x. g (f x))) x = deriv (\<lambda>x. deriv g (f x) * deriv f x) x
f twice_field_differentiable_at x
g twice_field_differentiable_at f x
\<lbrakk>\<exists>S. ?f field_differentiable_on S \<and> ?x \<in> interior S; ?g twice_field_differentiable_at ?f ?x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in nhds ?x. deriv (\<lambda>x. ?g (?f x)) x = deriv ?g (?f x) * deriv ?f x
(?f has_field_derivative deriv ?f ?x) (at ?x) = (?f field_differentiable at ?x)
f field_differentiable_on S
x \<in> interior S
\<lbrakk>x = x; \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. g (f x)) x = deriv g (f x) * deriv f x; ?u = ?v\<rbrakk> \<Longrightarrow> (deriv (\<lambda>x. g (f x)) has_field_derivative ?u) (at x) = ((\<lambda>x. deriv g (f x) * deriv f x) has_field_derivative ?v) (at x)

goal (1 subgoal):
 1. deriv (\<lambda>x. g (f x)) field_differentiable at x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. g (f x)) field_differentiable at x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. g (f x)) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. g (f x)) field_differentiable_on {x \<in> interior S. f x \<in> interior S'}
deriv (\<lambda>x. g (f x)) field_differentiable at x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. g (f x)) field_differentiable_on {x \<in> interior S. f x \<in> interior S'}
deriv (\<lambda>x. g (f x)) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
using twice_field_differentiable_at_def x_int_T
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. g (f x)) field_differentiable_on {x \<in> interior S. f x \<in> interior S'}
deriv (\<lambda>x. g (f x)) field_differentiable at x
?f twice_field_differentiable_at ?x \<equiv> \<exists>S. ?f field_differentiable_on S \<and> ?x \<in> interior S \<and> deriv ?f field_differentiable at ?x
x \<in> interior {x \<in> interior S. f x \<in> interior S'}

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) twice_field_differentiable_at x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>x. g (f x)) twice_field_differentiable_at x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma well_order_on_singleton[simp]: "well_order_on {x} {(x, x)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. well_order_on {x} {(x, x)}
[PROOF STEP]
unfolding well_order_on_def linear_order_on_def partial_order_on_def preorder_on_def total_on_def
    Field_def refl_on_def trans_def antisym_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((({(x, x)} \<subseteq> {x} \<times> {x} \<and> (\<forall>xa\<in>{x}. (xa, xa) \<in> {(x, x)})) \<and> (\<forall>xa y z. (xa, y) \<in> {(x, x)} \<longrightarrow> (y, z) \<in> {(x, x)} \<longrightarrow> (xa, z) \<in> {(x, x)})) \<and> (\<forall>xa y. (xa, y) \<in> {(x, x)} \<longrightarrow> (y, xa) \<in> {(x, x)} \<longrightarrow> xa = y)) \<and> (\<forall>xa\<in>{x}. \<forall>y\<in>{x}. xa \<noteq> y \<longrightarrow> (xa, y) \<in> {(x, x)} \<or> (y, xa) \<in> {(x, x)})) \<and> wf ({(x, x)} - Id)
[PROOF STEP]
by auto


[STATEMENT]
lemma degree_ge_iff: "k > 0 \<Longrightarrow> MPoly_Type.degree p x \<ge> k \<longleftrightarrow> (\<exists>m\<in>monomials p. lookup m x \<ge> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> (k \<le> MPoly_Type.degree p x) = (\<exists>m\<in>monomials p. k \<le> lookup m x)
[PROOF STEP]
using Max_ge_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> (?x \<le> Max ?A) = (\<exists>a\<in>?A. ?x \<le> a)

goal (1 subgoal):
 1. 0 < k \<Longrightarrow> (k \<le> MPoly_Type.degree p x) = (\<exists>m\<in>monomials p. k \<le> lookup m x)
[PROOF STEP]
by (meson degree_less_iff not_less)


[STATEMENT]
lemma content_ff_0[simp]: "content_ff 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content_ff 0 = 0
[PROOF STEP]
using content_ff_iff[of 0 0]
[PROOF STATE]
proof (prove)
using this:
divides_ff 0 (content_ff 0) = (\<forall>c\<in>set (coeffs 0). divides_ff 0 c)

goal (1 subgoal):
 1. content_ff 0 = 0
[PROOF STEP]
by (auto simp: divides_ff_def)


[STATEMENT]
lemma
  assumes "p \<in> lotteries_on alts"
  shows   "\<exists>q\<in>lotteries_on alts. q \<succeq>[Pareto(SD\<circ>R)] p \<and> SD_efficient R q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q\<in>lotteries_on alts. Pareto (SD \<circ> R) p q \<and> SD_efficient R q
[PROOF STEP]
using SD_efficient_lottery_exists[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>q. \<lbrakk>q \<in> lotteries_on alts; Pareto (SD \<circ> R) p q; SD_efficient R q\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<exists>q\<in>lotteries_on alts. Pareto (SD \<circ> R) p q \<and> SD_efficient R q
[PROOF STEP]
by blast


[STATEMENT]
lemma connected_component_of_eq_overlap:
   "connected_component_of_set X x = connected_component_of_set X y \<longleftrightarrow>
      (x \<notin> topspace X) \<and> (y \<notin> topspace X) \<or>
      ~(connected_component_of_set X x \<inter> connected_component_of_set X y = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (connected_component_of_set X x = connected_component_of_set X y) = (x \<notin> topspace X \<and> y \<notin> topspace X \<or> connected_component_of_set X x \<inter> connected_component_of_set X y \<noteq> {})
[PROOF STEP]
using connected_component_of_equiv
[PROOF STATE]
proof (prove)
using this:
connected_component_of ?X ?x ?y = (?x \<in> topspace ?X \<and> ?y \<in> topspace ?X \<and> connected_component_of ?X ?x = connected_component_of ?X ?y)

goal (1 subgoal):
 1. (connected_component_of_set X x = connected_component_of_set X y) = (x \<notin> topspace X \<and> y \<notin> topspace X \<or> connected_component_of_set X x \<inter> connected_component_of_set X y \<noteq> {})
[PROOF STEP]
by fastforce


[STATEMENT]
lemma conjugate_scalar_prod_Re [simp]:
  "Re (v \<bullet>c v) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> Re (inner_prod v v)
[PROOF STEP]
by (simp add: scalar_prod_def conjugate_vec_def sum_nonneg)


[STATEMENT]
lemma stabilizer_sumset_disjoint:
  fixes S1 S2 :: "'a set"
  assumes "stabilizer S1 \<inter> stabilizer S2 = {\<zero>}" and "S1 \<subseteq> G" and "S2 \<subseteq> G"
    and "finite S1" and "finite S2" and "S1 \<noteq> {}" and "S2 \<noteq> {}"
  shows "card (sumset (stabilizer S1) (stabilizer S2)) =
    card (stabilizer S1) * card (stabilizer S2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (sumset (stabilizer S1) (stabilizer S2)) = card (stabilizer S1) * card (stabilizer S2)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (sumset (stabilizer S1) (stabilizer S2)) = card (stabilizer S1) * card (stabilizer S2)
[PROOF STEP]
have inj_on : "inj_on (\<lambda> (a, b). a \<oplus> b) (stabilizer S1 \<times> stabilizer S2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>(a, b). a \<oplus> b) (stabilizer S1 \<times> stabilizer S2)
[PROOF STEP]
proof(intro inj_onI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume "x \<in> stabilizer S1 \<times> stabilizer S2" and "y \<in> stabilizer S1 \<times> stabilizer S2" and
      "(case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)"
[PROOF STATE]
proof (state)
this:
x \<in> stabilizer S1 \<times> stabilizer S2
y \<in> stabilizer S1 \<times> stabilizer S2
(case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> stabilizer S1 \<times> stabilizer S2
y \<in> stabilizer S1 \<times> stabilizer S2
(case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)
[PROOF STEP]
obtain a b c d where hx: "x = (a, b)" and hy: "y = (c, d)" and ha: "a \<in> stabilizer S1" and
      hb: "b \<in> stabilizer S2" and hc: "c \<in> stabilizer S1" and hd: "d \<in> stabilizer S2" and
      habcd: "a \<oplus> b = c \<oplus> d"
[PROOF STATE]
proof (prove)
using this:
x \<in> stabilizer S1 \<times> stabilizer S2
y \<in> stabilizer S1 \<times> stabilizer S2
(case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)

goal (1 subgoal):
 1. (\<And>a b c d. \<lbrakk>x = (a, b); y = (c, d); a \<in> stabilizer S1; b \<in> stabilizer S2; c \<in> stabilizer S1; d \<in> stabilizer S2; a \<oplus> b = c \<oplus> d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = (a, b)
y = (c, d)
a \<in> stabilizer S1
b \<in> stabilizer S2
c \<in> stabilizer S1
d \<in> stabilizer S2
a \<oplus> b = c \<oplus> d

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = (a, b)
y = (c, d)
a \<in> stabilizer S1
b \<in> stabilizer S2
c \<in> stabilizer S1
d \<in> stabilizer S2
a \<oplus> b = c \<oplus> d
[PROOF STEP]
have haG: "a \<in> G"
[PROOF STATE]
proof (prove)
using this:
x = (a, b)
y = (c, d)
a \<in> stabilizer S1
b \<in> stabilizer S2
c \<in> stabilizer S1
d \<in> stabilizer S2
a \<oplus> b = c \<oplus> d

goal (1 subgoal):
 1. a \<in> G
[PROOF STEP]
using stabilizer_def
[PROOF STATE]
proof (prove)
using this:
x = (a, b)
y = (c, d)
a \<in> stabilizer S1
b \<in> stabilizer S2
c \<in> stabilizer S1
d \<in> stabilizer S2
a \<oplus> b = c \<oplus> d
stabilizer ?S \<equiv> {x \<in> G. sumset {x} (?S \<inter> G) = ?S \<inter> G}

goal (1 subgoal):
 1. a \<in> G
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<in> G

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have hbG: "b \<in> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> G
[PROOF STEP]
using hb stabilizer_def
[PROOF STATE]
proof (prove)
using this:
b \<in> stabilizer S2
stabilizer ?S \<equiv> {x \<in> G. sumset {x} (?S \<inter> G) = ?S \<inter> G}

goal (1 subgoal):
 1. b \<in> G
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b \<in> G

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have hcG: "c \<in> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> G
[PROOF STEP]
using hc stabilizer_def
[PROOF STATE]
proof (prove)
using this:
c \<in> stabilizer S1
stabilizer ?S \<equiv> {x \<in> G. sumset {x} (?S \<inter> G) = ?S \<inter> G}

goal (1 subgoal):
 1. c \<in> G
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
c \<in> G

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have hdG: "d \<in> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d \<in> G
[PROOF STEP]
using hd stabilizer_def
[PROOF STATE]
proof (prove)
using this:
d \<in> stabilizer S2
stabilizer ?S \<equiv> {x \<in> G. sumset {x} (?S \<inter> G) = ?S \<inter> G}

goal (1 subgoal):
 1. d \<in> G
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
d \<in> G

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d \<in> G
[PROOF STEP]
have "a \<ominus> c = d \<ominus> b"
[PROOF STATE]
proof (prove)
using this:
d \<in> G

goal (1 subgoal):
 1. a \<ominus> c = d \<ominus> b
[PROOF STEP]
using habcd haG hbG hcG hdG
[PROOF STATE]
proof (prove)
using this:
d \<in> G
a \<oplus> b = c \<oplus> d
a \<in> G
b \<in> G
c \<in> G
d \<in> G

goal (1 subgoal):
 1. a \<ominus> c = d \<ominus> b
[PROOF STEP]
by (metis (full_types) associative commutative composition_closed inverse_equality invertible
        invertible_def invertible_left_inverse2)
[PROOF STATE]
proof (state)
this:
a \<ominus> c = d \<ominus> b

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<ominus> c = d \<ominus> b

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have "a \<ominus> c \<in> stabilizer S1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<ominus> c \<in> stabilizer S1
[PROOF STEP]
using ha hc stabilizer_is_subgroup
      subgroup.axioms(1) submonoid.sub_composition_closed
[PROOF STATE]
proof (prove)
using this:
a \<in> stabilizer S1
c \<in> stabilizer S1
subgroup (stabilizer ?S) G (\<oplus>) \<zero>
subgroup ?G ?M ?composition ?unit \<Longrightarrow> submonoid ?G ?M ?composition ?unit
\<lbrakk>submonoid ?N ?M ?composition ?unit; ?a \<in> ?N; ?b \<in> ?N\<rbrakk> \<Longrightarrow> ?composition ?a ?b \<in> ?N

goal (1 subgoal):
 1. a \<ominus> c \<in> stabilizer S1
[PROOF STEP]
by (metis group.invertible group_axioms hcG subgroup.subgroup_inverse_iff)
[PROOF STATE]
proof (state)
this:
a \<ominus> c \<in> stabilizer S1

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<ominus> c \<in> stabilizer S1

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have "d \<ominus> b \<in> stabilizer S2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d \<ominus> b \<in> stabilizer S2
[PROOF STEP]
using hd hb  stabilizer_is_subgroup
      subgroup.axioms(1) submonoid.sub_composition_closed
[PROOF STATE]
proof (prove)
using this:
d \<in> stabilizer S2
b \<in> stabilizer S2
subgroup (stabilizer ?S) G (\<oplus>) \<zero>
subgroup ?G ?M ?composition ?unit \<Longrightarrow> submonoid ?G ?M ?composition ?unit
\<lbrakk>submonoid ?N ?M ?composition ?unit; ?a \<in> ?N; ?b \<in> ?N\<rbrakk> \<Longrightarrow> ?composition ?a ?b \<in> ?N

goal (1 subgoal):
 1. d \<ominus> b \<in> stabilizer S2
[PROOF STEP]
by (metis group.invertible group_axioms hbG subgroup.subgroup_inverse_iff)
[PROOF STATE]
proof (state)
this:
d \<ominus> b \<in> stabilizer S2

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a \<ominus> c = d \<ominus> b
a \<ominus> c \<in> stabilizer S1
d \<ominus> b \<in> stabilizer S2
[PROOF STEP]
have "a \<ominus> c = \<zero>" and "d \<ominus> b = \<zero>"
[PROOF STATE]
proof (prove)
using this:
a \<ominus> c = d \<ominus> b
a \<ominus> c \<in> stabilizer S1
d \<ominus> b \<in> stabilizer S2

goal (1 subgoal):
 1. a \<ominus> c = \<zero> &&& d \<ominus> b = \<zero>
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
a \<ominus> c = d \<ominus> b
a \<ominus> c \<in> stabilizer S1
d \<ominus> b \<in> stabilizer S2
stabilizer S1 \<inter> stabilizer S2 = {\<zero>}

goal (1 subgoal):
 1. a \<ominus> c = \<zero> &&& d \<ominus> b = \<zero>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<ominus> c = \<zero>
d \<ominus> b = \<zero>

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> stabilizer S1 \<times> stabilizer S2; y \<in> stabilizer S1 \<times> stabilizer S2; (case x of (a, b) \<Rightarrow> a \<oplus> b) = (case y of (a, b) \<Rightarrow> a \<oplus> b)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
thus "x = y"
[PROOF STATE]
proof (prove)
using this:
a \<ominus> c = \<zero>
d \<ominus> b = \<zero>

goal (1 subgoal):
 1. x = y
[PROOF STEP]
using hx hy haG hbG hcG hdG
[PROOF STATE]
proof (prove)
using this:
a \<ominus> c = \<zero>
d \<ominus> b = \<zero>
x = (a, b)
y = (c, d)
a \<in> G
b \<in> G
c \<in> G
d \<in> G

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (metis inverse_closed invertible invertible_right_cancel invertible_right_inverse)
[PROOF STATE]
proof (state)
this:
x = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>(a, b). a \<oplus> b) (stabilizer S1 \<times> stabilizer S2)

goal (1 subgoal):
 1. card (sumset (stabilizer S1) (stabilizer S2)) = card (stabilizer S1) * card (stabilizer S2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>(a, b). a \<oplus> b) (stabilizer S1 \<times> stabilizer S2)

goal (1 subgoal):
 1. card (sumset (stabilizer S1) (stabilizer S2)) = card (stabilizer S1) * card (stabilizer S2)
[PROOF STEP]
have himage : "(\<lambda> (a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2) =
    sumset (stabilizer S1) (stabilizer S2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2) = sumset (stabilizer S1) (stabilizer S2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2) \<subseteq> sumset (stabilizer S1) (stabilizer S2)
 2. sumset (stabilizer S1) (stabilizer S2) \<subseteq> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)
[PROOF STEP]
show "(\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2) \<subseteq> sumset (stabilizer S1) (stabilizer S2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2) \<subseteq> sumset (stabilizer S1) (stabilizer S2)
[PROOF STEP]
using stabilizer_subset_group
[PROOF STATE]
proof (prove)
using this:
stabilizer ?S \<subseteq> G

goal (1 subgoal):
 1. (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2) \<subseteq> sumset (stabilizer S1) (stabilizer S2)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2) \<subseteq> sumset (stabilizer S1) (stabilizer S2)

goal (1 subgoal):
 1. sumset (stabilizer S1) (stabilizer S2) \<subseteq> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sumset (stabilizer S1) (stabilizer S2) \<subseteq> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)
[PROOF STEP]
show "sumset (stabilizer S1) (stabilizer S2) \<subseteq> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset (stabilizer S1) (stabilizer S2) \<subseteq> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> sumset (stabilizer S1) (stabilizer S2) \<Longrightarrow> x \<in> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> sumset (stabilizer S1) (stabilizer S2) \<Longrightarrow> x \<in> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)
[PROOF STEP]
assume "x \<in> sumset (stabilizer S1) (stabilizer S2)"
[PROOF STATE]
proof (state)
this:
x \<in> sumset (stabilizer S1) (stabilizer S2)

goal (1 subgoal):
 1. \<And>x. x \<in> sumset (stabilizer S1) (stabilizer S2) \<Longrightarrow> x \<in> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> sumset (stabilizer S1) (stabilizer S2)
[PROOF STEP]
obtain s1 s2 where hs1: "s1 \<in> stabilizer S1" and hs2: "s2 \<in> stabilizer S2" and
        "x = s1 \<oplus> s2"
[PROOF STATE]
proof (prove)
using this:
x \<in> sumset (stabilizer S1) (stabilizer S2)

goal (1 subgoal):
 1. (\<And>s1 s2. \<lbrakk>s1 \<in> stabilizer S1; s2 \<in> stabilizer S2; x = s1 \<oplus> s2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson sumset.cases)
[PROOF STATE]
proof (state)
this:
s1 \<in> stabilizer S1
s2 \<in> stabilizer S2
x = s1 \<oplus> s2

goal (1 subgoal):
 1. \<And>x. x \<in> sumset (stabilizer S1) (stabilizer S2) \<Longrightarrow> x \<in> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)
[PROOF STEP]
thus "x \<in> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)"
[PROOF STATE]
proof (prove)
using this:
s1 \<in> stabilizer S1
s2 \<in> stabilizer S2
x = s1 \<oplus> s2

goal (1 subgoal):
 1. x \<in> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)
[PROOF STEP]
using hs1 hs2
[PROOF STATE]
proof (prove)
using this:
s1 \<in> stabilizer S1
s2 \<in> stabilizer S2
x = s1 \<oplus> s2
s1 \<in> stabilizer S1
s2 \<in> stabilizer S2

goal (1 subgoal):
 1. x \<in> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sumset (stabilizer S1) (stabilizer S2) \<subseteq> (\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2) = sumset (stabilizer S1) (stabilizer S2)

goal (1 subgoal):
 1. card (sumset (stabilizer S1) (stabilizer S2)) = card (stabilizer S1) * card (stabilizer S2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on (\<lambda>(a, b). a \<oplus> b) (stabilizer S1 \<times> stabilizer S2)
(\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2) = sumset (stabilizer S1) (stabilizer S2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>(a, b). a \<oplus> b) (stabilizer S1 \<times> stabilizer S2)
(\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2) = sumset (stabilizer S1) (stabilizer S2)

goal (1 subgoal):
 1. card (sumset (stabilizer S1) (stabilizer S2)) = card (stabilizer S1) * card (stabilizer S2)
[PROOF STEP]
using card_image card_cartesian_product
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>(a, b). a \<oplus> b) (stabilizer S1 \<times> stabilizer S2)
(\<lambda>(a, b). a \<oplus> b) ` (stabilizer S1 \<times> stabilizer S2) = sumset (stabilizer S1) (stabilizer S2)
inj_on ?f ?A \<Longrightarrow> card (?f ` ?A) = card ?A
card (?A \<times> ?B) = card ?A * card ?B

goal (1 subgoal):
 1. card (sumset (stabilizer S1) (stabilizer S2)) = card (stabilizer S1) * card (stabilizer S2)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
card (sumset (stabilizer S1) (stabilizer S2)) = card (stabilizer S1) * card (stabilizer S2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_root_le_mono: "0 < n \<Longrightarrow> x \<le> y \<Longrightarrow> root n x \<le> root n y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; x \<le> y\<rbrakk> \<Longrightarrow> root n x \<le> root n y
[PROOF STEP]
by (auto simp add: order_le_less real_root_less_mono)


[STATEMENT]
lemma ac_in_res_ring'[simp]:
  assumes "x \<in> carrier Q\<^sub>p"
  shows "ac n x \<in> carrier (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ac n x \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
apply(cases "x \<in> nonzero Q\<^sub>p")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> nonzero Q\<^sub>p \<Longrightarrow> ac n x \<in> carrier (residue_ring (p ^ n))
 2. x \<notin> nonzero Q\<^sub>p \<Longrightarrow> ac n x \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
using ac_in_res_ring
[PROOF STATE]
proof (prove)
using this:
?x \<in> nonzero Q\<^sub>p \<Longrightarrow> ac ?n ?x \<in> carrier (residue_ring (p ^ ?n))

goal (2 subgoals):
 1. x \<in> nonzero Q\<^sub>p \<Longrightarrow> ac n x \<in> carrier (residue_ring (p ^ n))
 2. x \<notin> nonzero Q\<^sub>p \<Longrightarrow> ac n x \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> nonzero Q\<^sub>p \<Longrightarrow> ac n x \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
by (metis Qp.nonzero_memI ac_def assms mod_0 mod_in_carrier p_res_ring_car p_residue_alt_def)


[STATEMENT]
lemma (in Corps) npowf_expTr1:"\<lbrakk>x \<in> carrier K; x \<noteq> \<zero>; 0 \<le> i; 0 \<le> j;
                 0 \<le> i - j\<rbrakk> \<Longrightarrow> x\<^bsub>K\<^esub>\<^bsup>(i - j)\<^esup> = x\<^bsub>K\<^esub>\<^bsup>i\<^esup> \<cdot>\<^sub>r x\<^bsub>K\<^esub>\<^bsup>(- j)\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier K; x \<noteq> \<zero>; 0 \<le> i; 0 \<le> j; 0 \<le> i - j\<rbrakk> \<Longrightarrow> x\<^bsub>K\<^esub>\<^bsup>(i - j)\<^esup> = x\<^bsub>K\<^esub>\<^bsup>i\<^esup> \<cdot>\<^sub>r x\<^bsub>K\<^esub>\<^bsup>- j\<^esup>
[PROOF STEP]
apply (simp add:npow_exp_minusTr2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier K; x \<noteq> \<zero>; 0 \<le> j; j \<le> i\<rbrakk> \<Longrightarrow> x^\<^bsup>K nat i\<^esup> \<cdot>\<^sub>r x\<^bsup>\<hyphen> K\<^esup>^\<^bsup>K nat j\<^esup> = x\<^bsub>K\<^esub>\<^bsup>i\<^esup> \<cdot>\<^sub>r x\<^bsub>K\<^esub>\<^bsup>- j\<^esup>
[PROOF STEP]
apply (simp add:npowf_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Min_false1[simp]: "\<lbrakk>\<not> Min {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<le> w;
       x \<le> w; 0 < rec_exec rf (xs @ [x])\<rbrakk>
      \<Longrightarrow>  False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> Min {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<le> w; x \<le> w; 0 < rec_exec rf (xs @ [x])\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply(subgoal_tac "finite {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])}")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<not> Min {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<le> w; x \<le> w; 0 < rec_exec rf (xs @ [x]); finite {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])}\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>\<not> Min {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<le> w; x \<le> w; 0 < rec_exec rf (xs @ [x])\<rbrakk> \<Longrightarrow> finite {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])}
[PROOF STEP]
apply(subgoal_tac "{uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<noteq> {}")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<not> Min {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<le> w; x \<le> w; 0 < rec_exec rf (xs @ [x]); finite {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])}; {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<noteq> {}\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>\<not> Min {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<le> w; x \<le> w; 0 < rec_exec rf (xs @ [x]); finite {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])}\<rbrakk> \<Longrightarrow> {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<noteq> {}
 3. \<lbrakk>\<not> Min {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<le> w; x \<le> w; 0 < rec_exec rf (xs @ [x])\<rbrakk> \<Longrightarrow> finite {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])}
[PROOF STEP]
apply(simp add: Min_le_iff, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<not> Min {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<le> w; x \<le> w; 0 < rec_exec rf (xs @ [x])\<rbrakk> \<Longrightarrow> \<exists>x\<le>w. 0 < rec_exec rf (xs @ [x])
 2. \<lbrakk>\<not> Min {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<le> w; x \<le> w; 0 < rec_exec rf (xs @ [x])\<rbrakk> \<Longrightarrow> finite {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])}
[PROOF STEP]
apply(rule_tac x = x in exI, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> Min {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])} \<le> w; x \<le> w; 0 < rec_exec rf (xs @ [x])\<rbrakk> \<Longrightarrow> finite {uu. uu \<le> w \<and> 0 < rec_exec rf (xs @ [uu])}
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done