[STATEMENT]
lemma cauchy_root_bound: fixes x :: "'a :: real_normed_field"
  assumes x: "poly p x = 0" and p: "p \<noteq> 0"
  shows "norm x \<le> 1 + max_list_non_empty (map (\<lambda> i. norm (coeff p i)) [0 ..< degree p])
    / norm (lead_coeff p)" (is "_ \<le> _ + ?max / ?nlc")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
let ?n = "degree p"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
let ?p = "coeff p"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
let ?lc = "lead_coeff p"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
define ml where "ml = ?max / ?nlc"
[PROOF STATE]
proof (state)
this:
ml = max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
from p
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[PROOF STEP]
have lc: "?lc \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

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

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
hence nlc: "norm ?lc > 0"
[PROOF STATE]
proof (prove)
using this:
lead_coeff p \<noteq> (0::'a)

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

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
from root_imp_deg_nonzero[OF p x]
[PROOF STATE]
proof (chain)
picking this:
degree p \<noteq> 0
[PROOF STEP]
have *: "0 \<in> set [0 ..< degree p]"
[PROOF STATE]
proof (prove)
using this:
degree p \<noteq> 0

goal (1 subgoal):
 1. 0 \<in> set [0..<degree p]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<in> set [0..<degree p]

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
have "0 \<le> norm (?p 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> norm (coeff p 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> norm (coeff p 0)

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 \<le> norm (coeff p 0)

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
have "\<dots> \<le> ?max"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (coeff p 0) \<le> max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p])
[PROOF STEP]
by (rule max_list_non_empty, insert *, auto)
[PROOF STATE]
proof (state)
this:
norm (coeff p 0) \<le> max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p])

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p])
[PROOF STEP]
have max0: "?max \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p])

goal (1 subgoal):
 1. 0 \<le> max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p])
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 \<le> max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p])

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
with nlc
[PROOF STATE]
proof (chain)
picking this:
0 < norm (lead_coeff p)
0 \<le> max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p])
[PROOF STEP]
have ml0: "ml \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 < norm (lead_coeff p)
0 \<le> max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p])

goal (1 subgoal):
 1. 0 \<le> ml
[PROOF STEP]
unfolding ml_def
[PROOF STATE]
proof (prove)
using this:
0 < norm (lead_coeff p)
0 \<le> max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p])

goal (1 subgoal):
 1. 0 \<le> max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> ml

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
hence easy: "norm x \<le> 1 \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
using this:
0 \<le> ml

goal (1 subgoal):
 1. norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
unfolding ml_def[symmetric]
[PROOF STATE]
proof (prove)
using this:
0 \<le> ml

goal (1 subgoal):
 1. norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + ml
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
proof (cases "norm x \<le> 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
 2. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
norm x \<le> 1

goal (2 subgoals):
 1. norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
 2. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
norm x \<le> 1

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
using easy
[PROOF STATE]
proof (prove)
using this:
norm x \<le> 1
norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> norm x \<le> 1

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
hence nx: "norm x > 1"
[PROOF STATE]
proof (prove)
using this:
\<not> norm x \<le> 1

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

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
hence x0: "x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
1 < norm x

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

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
hence xn0: "0 < norm x ^ ?n"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

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

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
from x[unfolded poly_altdef]
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>degree p. coeff p i * x ^ i) = (0::'a)
[PROOF STEP]
have "x ^ ?n * ?lc = x ^ ?n * ?lc - (\<Sum>i\<le>?n. x ^ i * ?p i)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>degree p. coeff p i * x ^ i) = (0::'a)

goal (1 subgoal):
 1. x ^ degree p * lead_coeff p = x ^ degree p * lead_coeff p - (\<Sum>i\<le>degree p. x ^ i * coeff p i)
[PROOF STEP]
unfolding poly_altdef
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>degree p. coeff p i * x ^ i) = (0::'a)

goal (1 subgoal):
 1. x ^ degree p * lead_coeff p = x ^ degree p * lead_coeff p - (\<Sum>i\<le>degree p. x ^ i * coeff p i)
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
x ^ degree p * lead_coeff p = x ^ degree p * lead_coeff p - (\<Sum>i\<le>degree p. x ^ i * coeff p i)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x ^ degree p * lead_coeff p = x ^ degree p * lead_coeff p - (\<Sum>i\<le>degree p. x ^ i * coeff p i)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
have "(\<Sum>i\<le>?n. x ^ i * ?p i) = x ^ ?n * ?lc + (\<Sum>i < ?n. x ^ i * ?p i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>degree p. x ^ i * coeff p i) = x ^ degree p * lead_coeff p + (\<Sum>i<degree p. x ^ i * coeff p i)
[PROOF STEP]
by (subst sum.remove[of _ ?n], auto intro: sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>degree p. x ^ i * coeff p i) = x ^ degree p * lead_coeff p + (\<Sum>i<degree p. x ^ i * coeff p i)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x ^ degree p * lead_coeff p = x ^ degree p * lead_coeff p - (x ^ degree p * lead_coeff p + (\<Sum>i<degree p. x ^ i * coeff p i))
[PROOF STEP]
have "x ^ ?n * ?lc = - (\<Sum>i < ?n. x ^ i * ?p i)"
[PROOF STATE]
proof (prove)
using this:
x ^ degree p * lead_coeff p = x ^ degree p * lead_coeff p - (x ^ degree p * lead_coeff p + (\<Sum>i<degree p. x ^ i * coeff p i))

goal (1 subgoal):
 1. x ^ degree p * lead_coeff p = - (\<Sum>i<degree p. x ^ i * coeff p i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x ^ degree p * lead_coeff p = - (\<Sum>i<degree p. x ^ i * coeff p i)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
with lc
[PROOF STATE]
proof (chain)
picking this:
lead_coeff p \<noteq> (0::'a)
x ^ degree p * lead_coeff p = - (\<Sum>i<degree p. x ^ i * coeff p i)
[PROOF STEP]
have "x ^ ?n = - (\<Sum>i < ?n. x ^ i * ?p i) / ?lc"
[PROOF STATE]
proof (prove)
using this:
lead_coeff p \<noteq> (0::'a)
x ^ degree p * lead_coeff p = - (\<Sum>i<degree p. x ^ i * coeff p i)

goal (1 subgoal):
 1. x ^ degree p = - (\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
x ^ degree p = - (\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
from arg_cong[OF this, of norm]
[PROOF STATE]
proof (chain)
picking this:
norm (x ^ degree p) = norm (- (\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p)
[PROOF STEP]
have "norm x ^ ?n = norm ((\<Sum>i < ?n. x ^ i * ?p i) / ?lc)"
[PROOF STATE]
proof (prove)
using this:
norm (x ^ degree p) = norm (- (\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p)

goal (1 subgoal):
 1. norm x ^ degree p = norm ((\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p)
[PROOF STEP]
unfolding norm_power
[PROOF STATE]
proof (prove)
using this:
norm x ^ degree p = norm (- (\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p)

goal (1 subgoal):
 1. norm x ^ degree p = norm ((\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm x ^ degree p = norm ((\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm x ^ degree p = norm ((\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
have "(\<Sum>i < ?n. x ^ i * ?p i) / ?lc = (\<Sum>i < ?n. x ^ i * ?p i / ?lc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p = (\<Sum>i<degree p. x ^ i * coeff p i / lead_coeff p)
[PROOF STEP]
by (rule sum_divide_distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p = (\<Sum>i<degree p. x ^ i * coeff p i / lead_coeff p)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<degree p. x ^ i * coeff p i) / lead_coeff p = (\<Sum>i<degree p. x ^ i * coeff p i / lead_coeff p)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
have "norm \<dots> \<le> (\<Sum>i < ?n. norm (x ^ i * (?p i / ?lc)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>i<degree p. x ^ i * coeff p i / lead_coeff p) \<le> (\<Sum>i<degree p. norm (x ^ i * (coeff p i / lead_coeff p)))
[PROOF STEP]
by (simp add: field_simps, rule norm_sum)
[PROOF STATE]
proof (state)
this:
norm (\<Sum>i<degree p. x ^ i * coeff p i / lead_coeff p) \<le> (\<Sum>i<degree p. norm (x ^ i * (coeff p i / lead_coeff p)))

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (\<Sum>i<degree p. x ^ i * coeff p i / lead_coeff p) \<le> (\<Sum>i<degree p. norm (x ^ i * (coeff p i / lead_coeff p)))

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
have "\<dots> = (\<Sum>i < ?n. norm x ^ i * norm (?p i / ?lc))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<degree p. norm (x ^ i * (coeff p i / lead_coeff p))) = (\<Sum>i<degree p. norm x ^ i * norm (coeff p i / lead_coeff p))
[PROOF STEP]
unfolding norm_mult norm_power
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<degree p. norm x ^ i * norm (coeff p i / lead_coeff p)) = (\<Sum>i<degree p. norm x ^ i * norm (coeff p i / lead_coeff p))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>i<degree p. norm (x ^ i * (coeff p i / lead_coeff p))) = (\<Sum>i<degree p. norm x ^ i * norm (coeff p i / lead_coeff p))

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<degree p. norm (x ^ i * (coeff p i / lead_coeff p))) = (\<Sum>i<degree p. norm x ^ i * norm (coeff p i / lead_coeff p))

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
have "\<dots> \<le> (\<Sum>i < ?n. norm x ^ i * ml)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<degree p. norm x ^ i * norm (coeff p i / lead_coeff p)) \<le> (\<Sum>i<degree p. norm x ^ i * ml)
[PROOF STEP]
proof (rule sum_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {..<degree p} \<Longrightarrow> norm x ^ i * norm (coeff p i / lead_coeff p) \<le> norm x ^ i * ml
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {..<degree p} \<Longrightarrow> norm x ^ i * norm (coeff p i / lead_coeff p) \<le> norm x ^ i * ml
[PROOF STEP]
assume "i \<in> {..<?n}"
[PROOF STATE]
proof (state)
this:
i \<in> {..<degree p}

goal (1 subgoal):
 1. \<And>i. i \<in> {..<degree p} \<Longrightarrow> norm x ^ i * norm (coeff p i / lead_coeff p) \<le> norm x ^ i * ml
[PROOF STEP]
hence i: "i < ?n"
[PROOF STATE]
proof (prove)
using this:
i \<in> {..<degree p}

goal (1 subgoal):
 1. i < degree p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i < degree p

goal (1 subgoal):
 1. \<And>i. i \<in> {..<degree p} \<Longrightarrow> norm x ^ i * norm (coeff p i / lead_coeff p) \<le> norm x ^ i * ml
[PROOF STEP]
show "norm x ^ i * norm (?p i / ?lc) \<le> norm x ^ i * ml"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x ^ i * norm (coeff p i / lead_coeff p) \<le> norm x ^ i * ml
[PROOF STEP]
proof (rule mult_left_mono)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. norm (coeff p i / lead_coeff p) \<le> ml
 2. 0 \<le> norm x ^ i
[PROOF STEP]
show "0 \<le> norm x ^ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> norm x ^ i
[PROOF STEP]
using nx
[PROOF STATE]
proof (prove)
using this:
1 < norm x

goal (1 subgoal):
 1. 0 \<le> norm x ^ i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> norm x ^ i

goal (1 subgoal):
 1. norm (coeff p i / lead_coeff p) \<le> ml
[PROOF STEP]
show "norm (?p i / ?lc) \<le> ml"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (coeff p i / lead_coeff p) \<le> ml
[PROOF STEP]
unfolding norm_divide ml_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (coeff p i) / norm (lead_coeff p) \<le> max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
by (rule divide_right_mono[OF max_list_non_empty], insert nlc i, auto)
[PROOF STATE]
proof (state)
this:
norm (coeff p i / lead_coeff p) \<le> ml

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
norm x ^ i * norm (coeff p i / lead_coeff p) \<le> norm x ^ i * ml

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i<degree p. norm x ^ i * norm (coeff p i / lead_coeff p)) \<le> (\<Sum>i<degree p. norm x ^ i * ml)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<degree p. norm x ^ i * norm (coeff p i / lead_coeff p)) \<le> (\<Sum>i<degree p. norm x ^ i * ml)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
have "\<dots> = ml * (\<Sum>i < ?n. norm x ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<degree p. norm x ^ i * ml) = ml * sum ((^) (norm x)) {..<degree p}
[PROOF STEP]
unfolding sum_distrib_right[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) (norm x)) {..<degree p} * ml = ml * sum ((^) (norm x)) {..<degree p}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<degree p. norm x ^ i * ml) = ml * sum ((^) (norm x)) {..<degree p}

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<degree p. norm x ^ i * ml) = ml * sum ((^) (norm x)) {..<degree p}

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
have "(\<Sum>i < ?n. norm x ^ i) = (norm x ^ ?n - 1) / (norm x - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) (norm x)) {..<degree p} = (norm x ^ degree p - 1) / (norm x - 1)
[PROOF STEP]
by (rule geometric_sum, insert nx, auto)
[PROOF STATE]
proof (state)
this:
sum ((^) (norm x)) {..<degree p} = (norm x ^ degree p - 1) / (norm x - 1)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm x ^ degree p \<le> ml * ((norm x ^ degree p - 1) / (norm x - 1))
[PROOF STEP]
have "norm x ^ ?n \<le> ml * (norm x ^ ?n - 1) / (norm x - 1)"
[PROOF STATE]
proof (prove)
using this:
norm x ^ degree p \<le> ml * ((norm x ^ degree p - 1) / (norm x - 1))

goal (1 subgoal):
 1. norm x ^ degree p \<le> ml * (norm x ^ degree p - 1) / (norm x - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm x ^ degree p \<le> ml * (norm x ^ degree p - 1) / (norm x - 1)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
from mult_left_mono[OF this, of "norm x - 1"]
[PROOF STATE]
proof (chain)
picking this:
0 \<le> norm x - 1 \<Longrightarrow> (norm x - 1) * norm x ^ degree p \<le> (norm x - 1) * (ml * (norm x ^ degree p - 1) / (norm x - 1))
[PROOF STEP]
have "(norm x - 1) * (norm x ^ ?n) \<le> ml * (norm x ^ ?n - 1)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> norm x - 1 \<Longrightarrow> (norm x - 1) * norm x ^ degree p \<le> (norm x - 1) * (ml * (norm x ^ degree p - 1) / (norm x - 1))

goal (1 subgoal):
 1. (norm x - 1) * norm x ^ degree p \<le> ml * (norm x ^ degree p - 1)
[PROOF STEP]
using nx
[PROOF STATE]
proof (prove)
using this:
0 \<le> norm x - 1 \<Longrightarrow> (norm x - 1) * norm x ^ degree p \<le> (norm x - 1) * (ml * (norm x ^ degree p - 1) / (norm x - 1))
1 < norm x

goal (1 subgoal):
 1. (norm x - 1) * norm x ^ degree p \<le> ml * (norm x ^ degree p - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(norm x - 1) * norm x ^ degree p \<le> ml * (norm x ^ degree p - 1)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm x - 1) * norm x ^ degree p \<le> ml * (norm x ^ degree p - 1)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
have "\<dots> = (ml * (1 - 1 / (norm x ^ ?n))) * norm x ^ ?n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ml * (norm x ^ degree p - 1) = ml * (1 - 1 / norm x ^ degree p) * norm x ^ degree p
[PROOF STEP]
using nx False x0
[PROOF STATE]
proof (prove)
using this:
1 < norm x
\<not> norm x \<le> 1
x \<noteq> (0::'a)

goal (1 subgoal):
 1. ml * (norm x ^ degree p - 1) = ml * (1 - 1 / norm x ^ degree p) * norm x ^ degree p
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
ml * (norm x ^ degree p - 1) = ml * (1 - 1 / norm x ^ degree p) * norm x ^ degree p

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(norm x - 1) * norm x ^ degree p \<le> ml * (1 - 1 / norm x ^ degree p) * norm x ^ degree p
[PROOF STEP]
have "(norm x - 1) * (norm x ^ ?n) \<le> (ml * (1 - 1 / (norm x ^ ?n))) * norm x ^ ?n"
[PROOF STATE]
proof (prove)
using this:
(norm x - 1) * norm x ^ degree p \<le> ml * (1 - 1 / norm x ^ degree p) * norm x ^ degree p

goal (1 subgoal):
 1. (norm x - 1) * norm x ^ degree p \<le> ml * (1 - 1 / norm x ^ degree p) * norm x ^ degree p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(norm x - 1) * norm x ^ degree p \<le> ml * (1 - 1 / norm x ^ degree p) * norm x ^ degree p

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
from mult_right_le_imp_le[OF this xn0]
[PROOF STATE]
proof (chain)
picking this:
norm x - 1 \<le> ml * (1 - 1 / norm x ^ degree p)
[PROOF STEP]
have "norm x - 1 \<le> ml * (1 - 1 / (norm x ^ ?n))"
[PROOF STATE]
proof (prove)
using this:
norm x - 1 \<le> ml * (1 - 1 / norm x ^ degree p)

goal (1 subgoal):
 1. norm x - 1 \<le> ml * (1 - 1 / norm x ^ degree p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm x - 1 \<le> ml * (1 - 1 / norm x ^ degree p)

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
hence "norm x \<le> 1 + ml - ml / (norm x ^ ?n)"
[PROOF STATE]
proof (prove)
using this:
norm x - 1 \<le> ml * (1 - 1 / norm x ^ degree p)

goal (1 subgoal):
 1. norm x \<le> 1 + ml - ml / norm x ^ degree p
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
norm x \<le> 1 + ml - ml / norm x ^ degree p

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm x \<le> 1 + ml - ml / norm x ^ degree p

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
have "\<dots> \<le> 1 + ml"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + ml - ml / norm x ^ degree p \<le> 1 + ml
[PROOF STEP]
using ml0 xn0
[PROOF STATE]
proof (prove)
using this:
0 \<le> ml
0 < norm x ^ degree p

goal (1 subgoal):
 1. 1 + ml - ml / norm x ^ degree p \<le> 1 + ml
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 + ml - ml / norm x ^ degree p \<le> 1 + ml

goal (1 subgoal):
 1. \<not> norm x \<le> 1 \<Longrightarrow> norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm x \<le> 1 + ml
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm x \<le> 1 + ml

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
unfolding ml_def
[PROOF STATE]
proof (prove)
using this:
norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)

goal (1 subgoal):
 1. norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
norm x \<le> 1 + max_list_non_empty (map (\<lambda>i. norm (coeff p i)) [0..<degree p]) / norm (lead_coeff p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Gromov_extension_isometry_inv:
  assumes "isometry f"
  shows "inv (Gromov_extension f) = Gromov_extension (inv f)"
        "bij (Gromov_extension f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (Gromov_extension f) = Gromov_extension (inv f) &&& bij (Gromov_extension f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inv (Gromov_extension f) = Gromov_extension (inv f)
 2. bij (Gromov_extension f)
[PROOF STEP]
have *: "(inv f) o f = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv f \<circ> f = id
[PROOF STEP]
using isometry_inverse(2)[OF assms]
[PROOF STATE]
proof (prove)
using this:
bij f

goal (1 subgoal):
 1. inv f \<circ> f = id
[PROOF STEP]
by (simp add: bij_is_inj)
[PROOF STATE]
proof (state)
this:
inv f \<circ> f = id

goal (2 subgoals):
 1. inv (Gromov_extension f) = Gromov_extension (inv f)
 2. bij (Gromov_extension f)
[PROOF STEP]
have "Gromov_extension ((inv f) o f) = Gromov_extension (inv f) o Gromov_extension f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_extension (inv f \<circ> f) = Gromov_extension (inv f) \<circ> Gromov_extension f
[PROOF STEP]
by (rule Gromov_extension_isometry_composition[OF assms isometry_inverse(1)[OF assms]])
[PROOF STATE]
proof (state)
this:
Gromov_extension (inv f \<circ> f) = Gromov_extension (inv f) \<circ> Gromov_extension f

goal (2 subgoals):
 1. inv (Gromov_extension f) = Gromov_extension (inv f)
 2. bij (Gromov_extension f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Gromov_extension (inv f \<circ> f) = Gromov_extension (inv f) \<circ> Gromov_extension f
[PROOF STEP]
have A: "Gromov_extension (inv f) o Gromov_extension f = id"
[PROOF STATE]
proof (prove)
using this:
Gromov_extension (inv f \<circ> f) = Gromov_extension (inv f) \<circ> Gromov_extension f

goal (1 subgoal):
 1. Gromov_extension (inv f) \<circ> Gromov_extension f = id
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
Gromov_extension id = Gromov_extension (inv f) \<circ> Gromov_extension f

goal (1 subgoal):
 1. Gromov_extension (inv f) \<circ> Gromov_extension f = id
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_extension (inv f) \<circ> Gromov_extension f = id

goal (2 subgoals):
 1. inv (Gromov_extension f) = Gromov_extension (inv f)
 2. bij (Gromov_extension f)
[PROOF STEP]
have *: "f o (inv f) = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> inv f = id
[PROOF STEP]
using isometry_inverse(2)[OF assms]
[PROOF STATE]
proof (prove)
using this:
bij f

goal (1 subgoal):
 1. f \<circ> inv f = id
[PROOF STEP]
by (meson bij_is_surj surj_iff)
[PROOF STATE]
proof (state)
this:
f \<circ> inv f = id

goal (2 subgoals):
 1. inv (Gromov_extension f) = Gromov_extension (inv f)
 2. bij (Gromov_extension f)
[PROOF STEP]
have "Gromov_extension (f o (inv f)) = Gromov_extension f o Gromov_extension (inv f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_extension (f \<circ> inv f) = Gromov_extension f \<circ> Gromov_extension (inv f)
[PROOF STEP]
by (rule Gromov_extension_isometry_composition[OF isometry_inverse(1)[OF assms] assms])
[PROOF STATE]
proof (state)
this:
Gromov_extension (f \<circ> inv f) = Gromov_extension f \<circ> Gromov_extension (inv f)

goal (2 subgoals):
 1. inv (Gromov_extension f) = Gromov_extension (inv f)
 2. bij (Gromov_extension f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Gromov_extension (f \<circ> inv f) = Gromov_extension f \<circ> Gromov_extension (inv f)
[PROOF STEP]
have B: "Gromov_extension f o Gromov_extension (inv f) = id"
[PROOF STATE]
proof (prove)
using this:
Gromov_extension (f \<circ> inv f) = Gromov_extension f \<circ> Gromov_extension (inv f)

goal (1 subgoal):
 1. Gromov_extension f \<circ> Gromov_extension (inv f) = id
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
Gromov_extension id = Gromov_extension f \<circ> Gromov_extension (inv f)

goal (1 subgoal):
 1. Gromov_extension f \<circ> Gromov_extension (inv f) = id
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_extension f \<circ> Gromov_extension (inv f) = id

goal (2 subgoals):
 1. inv (Gromov_extension f) = Gromov_extension (inv f)
 2. bij (Gromov_extension f)
[PROOF STEP]
show "bij (Gromov_extension f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij (Gromov_extension f)
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
Gromov_extension (inv f) \<circ> Gromov_extension f = id
Gromov_extension f \<circ> Gromov_extension (inv f) = id

goal (1 subgoal):
 1. bij (Gromov_extension f)
[PROOF STEP]
unfolding bij_def
[PROOF STATE]
proof (prove)
using this:
Gromov_extension (inv f) \<circ> Gromov_extension f = id
Gromov_extension f \<circ> Gromov_extension (inv f) = id

goal (1 subgoal):
 1. inj (Gromov_extension f) \<and> surj (Gromov_extension f)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Gromov_extension (inv f) \<circ> Gromov_extension f = id; Gromov_extension f \<circ> Gromov_extension (inv f) = id\<rbrakk> \<Longrightarrow> inj (Gromov_extension f)
 2. \<And>x. \<lbrakk>Gromov_extension (inv f) \<circ> Gromov_extension f = id; Gromov_extension f \<circ> Gromov_extension (inv f) = id\<rbrakk> \<Longrightarrow> x \<in> range (Gromov_extension f)
[PROOF STEP]
by (metis inj_on_id inj_on_imageI2, metis B comp_apply id_def rangeI)
[PROOF STATE]
proof (state)
this:
bij (Gromov_extension f)

goal (1 subgoal):
 1. inv (Gromov_extension f) = Gromov_extension (inv f)
[PROOF STEP]
show "inv (Gromov_extension f) = Gromov_extension (inv f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (Gromov_extension f) = Gromov_extension (inv f)
[PROOF STEP]
using B \<open>bij (Gromov_extension f)\<close> bij_is_inj inv_o_cancel left_right_inverse_eq
[PROOF STATE]
proof (prove)
using this:
Gromov_extension f \<circ> Gromov_extension (inv f) = id
bij (Gromov_extension f)
bij ?f \<Longrightarrow> inj ?f
inj ?f \<Longrightarrow> inv ?f \<circ> ?f = id
\<lbrakk>?f \<circ> ?g = id; ?g \<circ> ?h = id\<rbrakk> \<Longrightarrow> ?f = ?h

goal (1 subgoal):
 1. inv (Gromov_extension f) = Gromov_extension (inv f)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inv (Gromov_extension f) = Gromov_extension (inv f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exhaustive_above_iff:
  "\<lbrakk> sorted xs; distinct xs; \<forall>x'\<in>set xs. x < x' \<rbrakk> \<Longrightarrow> exhaustive_above x xs \<longleftrightarrow> set xs = {z. z > x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted xs; distinct xs; \<forall>x'\<in>set xs. x < x'\<rbrakk> \<Longrightarrow> exhaustive_above x xs = (set xs = {z. x < z})
[PROOF STEP]
proof(induction x xs rule: exhaustive_above.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>sorted []; distinct []; Ball (set []) ((<) x)\<rbrakk> \<Longrightarrow> exhaustive_above x [] = (set [] = Collect ((<) x))
 2. \<And>x y ys. \<lbrakk>\<lbrakk>sorted ys; distinct ys; Ball (set ys) ((<) y)\<rbrakk> \<Longrightarrow> exhaustive_above y ys = (set ys = Collect ((<) y)); sorted (y # ys); distinct (y # ys); Ball (set (y # ys)) ((<) x)\<rbrakk> \<Longrightarrow> exhaustive_above x (y # ys) = (set (y # ys) = Collect ((<) x))
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
sorted []
distinct []
\<forall>a\<in>set []. x_ < a

goal (2 subgoals):
 1. \<And>x. \<lbrakk>sorted []; distinct []; Ball (set []) ((<) x)\<rbrakk> \<Longrightarrow> exhaustive_above x [] = (set [] = Collect ((<) x))
 2. \<And>x y ys. \<lbrakk>\<lbrakk>sorted ys; distinct ys; Ball (set ys) ((<) y)\<rbrakk> \<Longrightarrow> exhaustive_above y ys = (set ys = Collect ((<) y)); sorted (y # ys); distinct (y # ys); Ball (set (y # ys)) ((<) x)\<rbrakk> \<Longrightarrow> exhaustive_above x (y # ys) = (set (y # ys) = Collect ((<) x))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
sorted []
distinct []
\<forall>a\<in>set []. x_ < a

goal (1 subgoal):
 1. exhaustive_above x_ [] = (set [] = {a. x_ < a})
[PROOF STEP]
by(simp add: proper_interval_simps)
[PROOF STATE]
proof (state)
this:
exhaustive_above x_ [] = (set [] = {a. x_ < a})

goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>sorted ys; distinct ys; Ball (set ys) ((<) y)\<rbrakk> \<Longrightarrow> exhaustive_above y ys = (set ys = Collect ((<) y)); sorted (y # ys); distinct (y # ys); Ball (set (y # ys)) ((<) x)\<rbrakk> \<Longrightarrow> exhaustive_above x (y # ys) = (set (y # ys) = Collect ((<) x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>sorted ys; distinct ys; Ball (set ys) ((<) y)\<rbrakk> \<Longrightarrow> exhaustive_above y ys = (set ys = Collect ((<) y)); sorted (y # ys); distinct (y # ys); Ball (set (y # ys)) ((<) x)\<rbrakk> \<Longrightarrow> exhaustive_above x (y # ys) = (set (y # ys) = Collect ((<) x))
[PROOF STEP]
case (2 x y ys)
[PROOF STATE]
proof (state)
this:
\<lbrakk>sorted ys; distinct ys; \<forall>a\<in>set ys. y < a\<rbrakk> \<Longrightarrow> exhaustive_above y ys = (set ys = {a. y < a})
sorted (y # ys)
distinct (y # ys)
\<forall>a\<in>set (y # ys). x < a

goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>sorted ys; distinct ys; Ball (set ys) ((<) y)\<rbrakk> \<Longrightarrow> exhaustive_above y ys = (set ys = Collect ((<) y)); sorted (y # ys); distinct (y # ys); Ball (set (y # ys)) ((<) x)\<rbrakk> \<Longrightarrow> exhaustive_above x (y # ys) = (set (y # ys) = Collect ((<) x))
[PROOF STEP]
from \<open>sorted (y # ys)\<close> \<open>distinct (y # ys)\<close>
[PROOF STATE]
proof (chain)
picking this:
sorted (y # ys)
distinct (y # ys)
[PROOF STEP]
have ys: "sorted ys" "distinct ys" and y: "\<forall>y'\<in>set ys. y < y'"
[PROOF STATE]
proof (prove)
using this:
sorted (y # ys)
distinct (y # ys)

goal (1 subgoal):
 1. (sorted ys &&& distinct ys) &&& \<forall>y'\<in>set ys. y < y'
[PROOF STEP]
by(auto simp add: less_le)
[PROOF STATE]
proof (state)
this:
sorted ys
distinct ys
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>sorted ys; distinct ys; Ball (set ys) ((<) y)\<rbrakk> \<Longrightarrow> exhaustive_above y ys = (set ys = Collect ((<) y)); sorted (y # ys); distinct (y # ys); Ball (set (y # ys)) ((<) x)\<rbrakk> \<Longrightarrow> exhaustive_above x (y # ys) = (set (y # ys) = Collect ((<) x))
[PROOF STEP]
hence "exhaustive_above y ys = (set ys = {z. y < z})"
[PROOF STATE]
proof (prove)
using this:
sorted ys
distinct ys
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. exhaustive_above y ys = (set ys = {z. y < z})
[PROOF STEP]
by(rule "2.IH")
[PROOF STATE]
proof (state)
this:
exhaustive_above y ys = (set ys = {z. y < z})

goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>sorted ys; distinct ys; Ball (set ys) ((<) y)\<rbrakk> \<Longrightarrow> exhaustive_above y ys = (set ys = Collect ((<) y)); sorted (y # ys); distinct (y # ys); Ball (set (y # ys)) ((<) x)\<rbrakk> \<Longrightarrow> exhaustive_above x (y # ys) = (set (y # ys) = Collect ((<) x))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
exhaustive_above y ys = (set ys = {z. y < z})

goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>sorted ys; distinct ys; Ball (set ys) ((<) y)\<rbrakk> \<Longrightarrow> exhaustive_above y ys = (set ys = Collect ((<) y)); sorted (y # ys); distinct (y # ys); Ball (set (y # ys)) ((<) x)\<rbrakk> \<Longrightarrow> exhaustive_above x (y # ys) = (set (y # ys) = Collect ((<) x))
[PROOF STEP]
from \<open>\<forall>y'\<in>set (y # ys). x < y'\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>y'\<in>set (y # ys). x < y'
[PROOF STEP]
have "x < y"
[PROOF STATE]
proof (prove)
using this:
\<forall>y'\<in>set (y # ys). x < y'

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

goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>sorted ys; distinct ys; Ball (set ys) ((<) y)\<rbrakk> \<Longrightarrow> exhaustive_above y ys = (set ys = Collect ((<) y)); sorted (y # ys); distinct (y # ys); Ball (set (y # ys)) ((<) x)\<rbrakk> \<Longrightarrow> exhaustive_above x (y # ys) = (set (y # ys) = Collect ((<) x))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
exhaustive_above y ys = (set ys = {z. y < z})
x < y
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
exhaustive_above y ys = (set ys = {z. y < z})
x < y

goal (1 subgoal):
 1. exhaustive_above x (y # ys) = (set (y # ys) = {a. x < a})
[PROOF STEP]
using y
[PROOF STATE]
proof (prove)
using this:
exhaustive_above y ys = (set ys = {z. y < z})
x < y
\<forall>y'\<in>set ys. y < y'

goal (1 subgoal):
 1. exhaustive_above x (y # ys) = (set (y # ys) = {a. x < a})
[PROOF STEP]
by(fastforce simp add: proper_interval_simps)
[PROOF STATE]
proof (state)
this:
exhaustive_above x (y # ys) = (set (y # ys) = {a. x < a})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_diff_therm_dyn: "0 < a \<Longrightarrow> \<parallel>f a L s\<^sub>1 - f a L s\<^sub>2\<parallel> = \<bar>a\<bar> * \<bar>s\<^sub>1$1 - s\<^sub>2$1\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<parallel>f a L s\<^sub>1 - f a L s\<^sub>2\<parallel> = \<bar>a\<bar> \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
proof(simp add: norm_vec_def L2_set_def, unfold UNIV_4, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
assume a1: "0 < a"
[PROOF STATE]
proof (state)
this:
0 < a

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
have f2: "\<And>r ra. \<bar>(r::real) + - ra\<bar> = \<bar>ra + - r\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r ra. \<bar>r + - ra\<bar> = \<bar>ra + - r\<bar>
[PROOF STEP]
by (metis abs_minus_commute minus_real_def)
[PROOF STATE]
proof (state)
this:
\<bar>?r + - ?ra\<bar> = \<bar>?ra + - ?r\<bar>

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
have "\<And>r ra rb. (r::real) * ra + - (r * rb) = r * (ra + - rb)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r ra rb. r \<cdot> ra + - (r \<cdot> rb) = r \<cdot> (ra + - rb)
[PROOF STEP]
by (metis minus_real_def right_diff_distrib)
[PROOF STATE]
proof (state)
this:
?r \<cdot> ?ra + - (?r \<cdot> ?rb) = ?r \<cdot> (?ra + - ?rb)

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
hence "\<bar>a * (s\<^sub>1$1 + - L) + - (a * (s\<^sub>2$1 + - L))\<bar> = a * \<bar>s\<^sub>1$1 + - s\<^sub>2$1\<bar>"
[PROOF STATE]
proof (prove)
using this:
?r \<cdot> ?ra + - (?r \<cdot> ?rb) = ?r \<cdot> (?ra + - ?rb)

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
?r \<cdot> ?ra + - (?r \<cdot> ?rb) = ?r \<cdot> (?ra + - ?rb)
0 < a

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
by (simp add: abs_mult)
[PROOF STATE]
proof (state)
this:
\<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
thus "\<bar>a * (s\<^sub>2$1 - L) - a * (s\<^sub>1$1 - L)\<bar> = a * \<bar>s\<^sub>1$1 - s\<^sub>2$1\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
using f2 minus_real_def
[PROOF STATE]
proof (prove)
using this:
\<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>
\<bar>?r + - ?ra\<bar> = \<bar>?ra + - ?r\<bar>
?x - ?y = ?x + - ?y

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_list_all2:
assumes "\<And>x. x \<in> set xs \<Longrightarrow> \<exists>y. f x y"
shows "\<exists> ys. list_all2 f xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ys. list_all2 f xs ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> set xs \<Longrightarrow> \<exists>y. f ?x y

goal (1 subgoal):
 1. \<exists>ys. list_all2 f xs ys
[PROOF STEP]
apply(induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> Ex (f x)) \<Longrightarrow> Ex (list_all2 f [])
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> Ex (f x)) \<Longrightarrow> Ex (list_all2 f xs); \<And>x. x \<in> set (a # xs) \<Longrightarrow> Ex (f x)\<rbrakk> \<Longrightarrow> Ex (list_all2 f (a # xs))
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> Ex (f x)) \<Longrightarrow> Ex (list_all2 f xs); \<And>x. x \<in> set (a # xs) \<Longrightarrow> Ex (f x)\<rbrakk> \<Longrightarrow> Ex (list_all2 f (a # xs))
[PROOF STEP]
by (metis set_simps insertCI list_all2_Cons)


[STATEMENT]
lemma merge_sorted:
  assumes "sorted xs" "sorted ys"
  shows "sorted (merge xs ys) \<and> set (merge xs ys) = set xs \<union> set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (merge xs ys) \<and> set (merge xs ys) = set xs \<union> set ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sorted xs
sorted ys

goal (1 subgoal):
 1. sorted (merge xs ys) \<and> set (merge xs ys) = set xs \<union> set ys
[PROOF STEP]
apply (induction xs ys rule: merge.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ys. \<lbrakk>sorted []; sorted ys\<rbrakk> \<Longrightarrow> sorted (merge [] ys) \<and> set (merge [] ys) = set [] \<union> set ys
 2. \<And>v va. \<lbrakk>sorted (v # va); sorted []\<rbrakk> \<Longrightarrow> sorted (merge (v # va) []) \<and> set (merge (v # va) []) = set (v # va) \<union> set []
 3. \<And>x xs y ys. \<lbrakk>\<lbrakk>x < y; sorted xs; sorted (y # ys)\<rbrakk> \<Longrightarrow> sorted (merge xs (y # ys)) \<and> set (merge xs (y # ys)) = set xs \<union> set (y # ys); \<lbrakk>\<not> x < y; sorted (x # xs); sorted ys\<rbrakk> \<Longrightarrow> sorted (merge (x # xs) ys) \<and> set (merge (x # xs) ys) = set (x # xs) \<union> set ys; sorted (x # xs); sorted (y # ys)\<rbrakk> \<Longrightarrow> sorted (merge (x # xs) (y # ys)) \<and> set (merge (x # xs) (y # ys)) = set (x # xs) \<union> set (y # ys)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mono_inc_bdd_above_has_limit_at_topI:
  fixes f::"real \<Rightarrow> real"
  assumes "mono f"
  assumes "\<And>x. f x \<le> u"
  shows "\<exists>l. (f \<longlongrightarrow> l) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. (f \<longlongrightarrow> l) at_top
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>l. (f \<longlongrightarrow> l) at_top
[PROOF STEP]
define l where "l = Sup (range (\<lambda>n. f (real n)))"
[PROOF STATE]
proof (state)
this:
l = (SUP n. f (real n))

goal (1 subgoal):
 1. \<exists>l. (f \<longlongrightarrow> l) at_top
[PROOF STEP]
have t:"(\<lambda>n. f (real n)) \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f (real n)) \<longlonglongrightarrow> l
[PROOF STEP]
unfolding l_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f (real n)) \<longlonglongrightarrow> (SUP n. f (real n))
[PROOF STEP]
apply (rule LIMSEQ_incseq_SUP)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. bdd_above (range (\<lambda>n. f (real n)))
 2. incseq (\<lambda>n. f (real n))
[PROOF STEP]
apply (meson assms(2) bdd_aboveI2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (\<lambda>n. f (real n))
[PROOF STEP]
by (meson assms(1) mono_def of_nat_mono)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. f (real n)) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. \<exists>l. (f \<longlongrightarrow> l) at_top
[PROOF STEP]
from tendsto_at_topI_sequentially_real[OF assms(1) t]
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> l) at_top
[PROOF STEP]
have "(f \<longlongrightarrow> l) at_top"
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> l) at_top

goal (1 subgoal):
 1. (f \<longlongrightarrow> l) at_top
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> l) at_top

goal (1 subgoal):
 1. \<exists>l. (f \<longlongrightarrow> l) at_top
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> l) at_top

goal (1 subgoal):
 1. \<exists>l. (f \<longlongrightarrow> l) at_top
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>l. (f \<longlongrightarrow> l) at_top

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NEQ_DEP_IMP_IN_DOM_i:
  fixes a v
  assumes "a \<in> PROB" "v \<in> fmdom' (fst a)"
  shows "v \<in> prob_dom PROB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> prob_dom PROB
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<in> prob_dom PROB
[PROOF STEP]
have "v \<in> fmdom' (fst a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> fmdom' (fst a)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
v \<in> fmdom' (fst a)

goal (1 subgoal):
 1. v \<in> fmdom' (fst a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<in> fmdom' (fst a)

goal (1 subgoal):
 1. v \<in> prob_dom PROB
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v \<in> fmdom' (fst a)

goal (1 subgoal):
 1. v \<in> prob_dom PROB
[PROOF STEP]
have "fmdom' (fst a) \<subseteq> prob_dom PROB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom' (fst a) \<subseteq> prob_dom PROB
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
a \<in> PROB

goal (1 subgoal):
 1. fmdom' (fst a) \<subseteq> prob_dom PROB
[PROOF STEP]
unfolding prob_dom_def action_dom_def
[PROOF STATE]
proof (prove)
using this:
a \<in> PROB

goal (1 subgoal):
 1. fmdom' (fst a) \<subseteq> (\<Union>(s1, s2)\<in>PROB. fmdom' s1 \<union> fmdom' s2)
[PROOF STEP]
using case_prod_beta'
[PROOF STATE]
proof (prove)
using this:
a \<in> PROB
(\<lambda>(x, y). ?f x y) = (\<lambda>x. ?f (fst x) (snd x))

goal (1 subgoal):
 1. fmdom' (fst a) \<subseteq> (\<Union>(s1, s2)\<in>PROB. fmdom' s1 \<union> fmdom' s2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fmdom' (fst a) \<subseteq> prob_dom PROB

goal (1 subgoal):
 1. v \<in> prob_dom PROB
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v \<in> fmdom' (fst a)
fmdom' (fst a) \<subseteq> prob_dom PROB
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<in> fmdom' (fst a)
fmdom' (fst a) \<subseteq> prob_dom PROB

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

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>NOTE added lemma.\<close>


[STATEMENT]
lemma HNatInfinite_FreeUltrafilterNat_eventually:
  assumes "\<And>k::nat. eventually (\<lambda>n. f n \<noteq> k) \<U>"
  shows "eventually (\<lambda>n. m < f n) \<U>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in \<U>. m < f n
[PROOF STEP]
proof (induct m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F n in \<U>. 0 < f n
 2. \<And>m. \<forall>\<^sub>F n in \<U>. m < f n \<Longrightarrow> \<forall>\<^sub>F n in \<U>. Suc m < f n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<forall>\<^sub>F n in \<U>. 0 < f n
 2. \<And>m. \<forall>\<^sub>F n in \<U>. m < f n \<Longrightarrow> \<forall>\<^sub>F n in \<U>. Suc m < f n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in \<U>. 0 < f n
[PROOF STEP]
using assms eventually_mono
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in \<U>. f n \<noteq> ?k
\<lbrakk>eventually ?P ?F; \<And>x. ?P x \<Longrightarrow> ?Q x\<rbrakk> \<Longrightarrow> eventually ?Q ?F

goal (1 subgoal):
 1. \<forall>\<^sub>F n in \<U>. 0 < f n
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in \<U>. 0 < f n

goal (1 subgoal):
 1. \<And>m. \<forall>\<^sub>F n in \<U>. m < f n \<Longrightarrow> \<forall>\<^sub>F n in \<U>. Suc m < f n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. \<forall>\<^sub>F n in \<U>. m < f n \<Longrightarrow> \<forall>\<^sub>F n in \<U>. Suc m < f n
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in \<U>. m < f n

goal (1 subgoal):
 1. \<And>m. \<forall>\<^sub>F n in \<U>. m < f n \<Longrightarrow> \<forall>\<^sub>F n in \<U>. Suc m < f n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in \<U>. m < f n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in \<U>. m < f n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in \<U>. Suc m < f n
[PROOF STEP]
using assms [of "Suc m"] eventually_elim2
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in \<U>. m < f n
\<forall>\<^sub>F n in \<U>. f n \<noteq> Suc m
\<lbrakk>eventually ?P ?F; eventually ?Q ?F; \<And>i. \<lbrakk>?P i; ?Q i\<rbrakk> \<Longrightarrow> ?R i\<rbrakk> \<Longrightarrow> eventually ?R ?F

goal (1 subgoal):
 1. \<forall>\<^sub>F n in \<U>. Suc m < f n
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in \<U>. Suc m < f n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma simply_connected_eq_homotopic_circlemaps3:
  fixes h :: "complex \<Rightarrow> 'a::real_normed_vector"
  assumes "path_connected S"
      and hom: "\<And>f::complex \<Rightarrow> 'a.
                  \<lbrakk>continuous_on (sphere 0 1) f; f `(sphere 0 1) \<subseteq> S\<rbrakk>
                  \<Longrightarrow> \<exists>a. homotopic_with_canon (\<lambda>h. True) (sphere 0 1) S f (\<lambda>x. a)"
    shows "simply_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simply_connected S
[PROOF STEP]
proof (clarsimp simp add: simply_connected_eq_contractible_loop_some assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>path p; path_image p \<subseteq> S; pathfinish p = pathstart p\<rbrakk> \<Longrightarrow> \<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>path p; path_image p \<subseteq> S; pathfinish p = pathstart p\<rbrakk> \<Longrightarrow> \<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)
[PROOF STEP]
assume p: "path p" "path_image p \<subseteq> S" "pathfinish p = pathstart p"
[PROOF STATE]
proof (state)
this:
path p
path_image p \<subseteq> S
pathfinish p = pathstart p

goal (1 subgoal):
 1. \<And>p. \<lbrakk>path p; path_image p \<subseteq> S; pathfinish p = pathstart p\<rbrakk> \<Longrightarrow> \<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path p
path_image p \<subseteq> S
pathfinish p = pathstart p
[PROOF STEP]
have "homotopic_loops S p p"
[PROOF STATE]
proof (prove)
using this:
path p
path_image p \<subseteq> S
pathfinish p = pathstart p

goal (1 subgoal):
 1. homotopic_loops S p p
[PROOF STEP]
by (simp add: homotopic_loops_refl)
[PROOF STATE]
proof (state)
this:
homotopic_loops S p p

goal (1 subgoal):
 1. \<And>p. \<lbrakk>path p; path_image p \<subseteq> S; pathfinish p = pathstart p\<rbrakk> \<Longrightarrow> \<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_loops S p p
[PROOF STEP]
obtain a where homp: "homotopic_with_canon (\<lambda>h. True) (sphere 0 1) S (p \<circ> (\<lambda>z. Arg2pi z / (2 * pi))) (\<lambda>x. a)"
[PROOF STATE]
proof (prove)
using this:
homotopic_loops S p p

goal (1 subgoal):
 1. (\<And>a. homotopic_with_canon (\<lambda>h. True) (sphere 0 1) S (p \<circ> (\<lambda>z. Arg2pi z / (2 * pi))) (\<lambda>x. a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis homotopic_with_imp_subset2 homotopic_loops_imp_homotopic_circlemaps homotopic_with_imp_continuous hom)
[PROOF STATE]
proof (state)
this:
homotopic_with_canon (\<lambda>h. True) (sphere 0 1) S (p \<circ> (\<lambda>z. Arg2pi z / (2 * pi))) (\<lambda>x. a)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>path p; path_image p \<subseteq> S; pathfinish p = pathstart p\<rbrakk> \<Longrightarrow> \<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)
[PROOF STEP]
show "\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)
[PROOF STEP]
proof (intro exI conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?a \<in> S
 2. homotopic_loops S p (linepath ?a ?a)
[PROOF STEP]
show "a \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> S
[PROOF STEP]
using homotopic_with_imp_subset2 [OF homp]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a) ` sphere 0 1 \<subseteq> S

goal (1 subgoal):
 1. a \<in> S
[PROOF STEP]
by (metis dist_0_norm image_subset_iff mem_sphere norm_one)
[PROOF STATE]
proof (state)
this:
a \<in> S

goal (1 subgoal):
 1. homotopic_loops S p (linepath a a)
[PROOF STEP]
have teq: "\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk>
               \<Longrightarrow> t = Arg2pi (exp (2 * of_real pi * of_real t * \<i>)) / (2 * pi) \<or> t=1 \<and> Arg2pi (exp (2 * of_real pi * of_real t * \<i>)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> t = Arg2pi (exp (2 * complex_of_real pi * complex_of_real t * \<i>)) / (2 * pi) \<or> t = 1 \<and> Arg2pi (exp (2 * complex_of_real pi * complex_of_real t * \<i>)) = 0
[PROOF STEP]
using Arg2pi_of_real [of 1]
[PROOF STATE]
proof (prove)
using this:
Arg2pi (complex_of_real 1) = (if 1 < 0 then pi else 0)

goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> t = Arg2pi (exp (2 * complex_of_real pi * complex_of_real t * \<i>)) / (2 * pi) \<or> t = 1 \<and> Arg2pi (exp (2 * complex_of_real pi * complex_of_real t * \<i>)) = 0
[PROOF STEP]
by (force simp: Arg2pi_exp)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?t; ?t \<le> 1\<rbrakk> \<Longrightarrow> ?t = Arg2pi (exp (2 * complex_of_real pi * complex_of_real ?t * \<i>)) / (2 * pi) \<or> ?t = 1 \<and> Arg2pi (exp (2 * complex_of_real pi * complex_of_real ?t * \<i>)) = 0

goal (1 subgoal):
 1. homotopic_loops S p (linepath a a)
[PROOF STEP]
have "homotopic_loops S p (p \<circ> (\<lambda>z. Arg2pi z / (2 * pi)) \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_loops S p (p \<circ> (\<lambda>z. Arg2pi z / (2 * pi)) \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
using p teq
[PROOF STATE]
proof (prove)
using this:
path p
path_image p \<subseteq> S
pathfinish p = pathstart p
\<lbrakk>0 \<le> ?t; ?t \<le> 1\<rbrakk> \<Longrightarrow> ?t = Arg2pi (exp (2 * complex_of_real pi * complex_of_real ?t * \<i>)) / (2 * pi) \<or> ?t = 1 \<and> Arg2pi (exp (2 * complex_of_real pi * complex_of_real ?t * \<i>)) = 0

goal (1 subgoal):
 1. homotopic_loops S p (p \<circ> (\<lambda>z. Arg2pi z / (2 * pi)) \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
by (fastforce simp: pathfinish_def pathstart_def intro: homotopic_loops_eq [OF p])
[PROOF STATE]
proof (state)
this:
homotopic_loops S p (p \<circ> (\<lambda>z. Arg2pi z / (2 * pi)) \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))

goal (1 subgoal):
 1. homotopic_loops S p (linepath a a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_loops S p (p \<circ> (\<lambda>z. Arg2pi z / (2 * pi)) \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
show "homotopic_loops S p (linepath a a)"
[PROOF STATE]
proof (prove)
using this:
homotopic_loops S p (p \<circ> (\<lambda>z. Arg2pi z / (2 * pi)) \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))

goal (1 subgoal):
 1. homotopic_loops S p (linepath a a)
[PROOF STEP]
by (simp add: linepath_refl  homotopic_loops_trans [OF _ homotopic_circlemaps_imp_homotopic_loops [OF homp, simplified K_record_comp]])
[PROOF STATE]
proof (state)
this:
homotopic_loops S p (linepath a a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma row_space_is_preserved:
  assumes inv_P: "invertible_mat P" and P: "P \<in> carrier_mat m m" and A: "A \<in> carrier_mat m n"
  shows "row_space (P*A) = row_space A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_space (P * A) = row_space A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. row_space (P * A) = row_space A
[PROOF STEP]
have At: "A\<^sup>T \<in> carrier_mat n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T \<in> carrier_mat n m
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat m n

goal (1 subgoal):
 1. A\<^sup>T \<in> carrier_mat n m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A\<^sup>T \<in> carrier_mat n m

goal (1 subgoal):
 1. row_space (P * A) = row_space A
[PROOF STEP]
have Pt: "P\<^sup>T \<in> carrier_mat m m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P\<^sup>T \<in> carrier_mat m m
[PROOF STEP]
using P
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier_mat m m

goal (1 subgoal):
 1. P\<^sup>T \<in> carrier_mat m m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P\<^sup>T \<in> carrier_mat m m

goal (1 subgoal):
 1. row_space (P * A) = row_space A
[PROOF STEP]
have PA: "P*A \<in> carrier_mat m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * A \<in> carrier_mat m n
[PROOF STEP]
using P A
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier_mat m m
A \<in> carrier_mat m n

goal (1 subgoal):
 1. P * A \<in> carrier_mat m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P * A \<in> carrier_mat m n

goal (1 subgoal):
 1. row_space (P * A) = row_space A
[PROOF STEP]
have "w \<in> row_space A" if w: "w \<in> row_space (P*A)" for w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> row_space A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<in> row_space A
[PROOF STEP]
have w_carrier: "w \<in> carrier_vec (dim_col (P*A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> carrier_vec (dim_col (P * A))
[PROOF STEP]
using w mult_carrier_mat[OF P A] row_space_eq
[PROOF STATE]
proof (prove)
using this:
w \<in> row_space (P * A)
P * A \<in> carrier_mat m n
?A \<in> carrier_mat ?nr n \<Longrightarrow> row_space ?A = {w \<in> carrier_vec (dim_col ?A). \<exists>y\<in>carrier_vec (dim_row ?A). ?A\<^sup>T *\<^sub>v y = w}

goal (1 subgoal):
 1. w \<in> carrier_vec (dim_col (P * A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> carrier_vec (dim_col (P * A))

goal (1 subgoal):
 1. w \<in> row_space A
[PROOF STEP]
from that and this
[PROOF STATE]
proof (chain)
picking this:
w \<in> row_space (P * A)
w \<in> carrier_vec (dim_col (P * A))
[PROOF STEP]
obtain y where y: "y \<in> carrier_vec (dim_row (P * A))"
      and w_By: "w = (P*A)\<^sup>T *\<^sub>v y"
[PROOF STATE]
proof (prove)
using this:
w \<in> row_space (P * A)
w \<in> carrier_vec (dim_col (P * A))

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> carrier_vec (dim_row (P * A)); w = (P * A)\<^sup>T *\<^sub>v y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding row_space_eq[OF PA]
[PROOF STATE]
proof (prove)
using this:
w \<in> {w \<in> carrier_vec (dim_col (P * A)). \<exists>y\<in>carrier_vec (dim_row (P * A)). (P * A)\<^sup>T *\<^sub>v y = w}
w \<in> carrier_vec (dim_col (P * A))

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> carrier_vec (dim_row (P * A)); w = (P * A)\<^sup>T *\<^sub>v y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in> carrier_vec (dim_row (P * A))
w = (P * A)\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space A
[PROOF STEP]
have ym: "y \<in> carrier_vec m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> carrier_vec m
[PROOF STEP]
using y Pt
[PROOF STATE]
proof (prove)
using this:
y \<in> carrier_vec (dim_row (P * A))
P\<^sup>T \<in> carrier_mat m m

goal (1 subgoal):
 1. y \<in> carrier_vec m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> carrier_vec m

goal (1 subgoal):
 1. w \<in> row_space A
[PROOF STEP]
have "w=((P*A)\<^sup>T) *\<^sub>v y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w = (P * A)\<^sup>T *\<^sub>v y
[PROOF STEP]
using w_By
[PROOF STATE]
proof (prove)
using this:
w = (P * A)\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w = (P * A)\<^sup>T *\<^sub>v y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
w = (P * A)\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
w = (P * A)\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space A
[PROOF STEP]
have "... = (A\<^sup>T * P\<^sup>T) *\<^sub>v y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P * A)\<^sup>T *\<^sub>v y = A\<^sup>T * P\<^sup>T *\<^sub>v y
[PROOF STEP]
using transpose_mult[OF P A]
[PROOF STATE]
proof (prove)
using this:
(P * A)\<^sup>T = A\<^sup>T * P\<^sup>T

goal (1 subgoal):
 1. (P * A)\<^sup>T *\<^sub>v y = A\<^sup>T * P\<^sup>T *\<^sub>v y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(P * A)\<^sup>T *\<^sub>v y = A\<^sup>T * P\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(P * A)\<^sup>T *\<^sub>v y = A\<^sup>T * P\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space A
[PROOF STEP]
have "... = A\<^sup>T *\<^sub>v (P\<^sup>T *\<^sub>v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T * P\<^sup>T *\<^sub>v y = A\<^sup>T *\<^sub>v (P\<^sup>T *\<^sub>v y)
[PROOF STEP]
by (rule assoc_mult_mat_vec[OF At Pt], insert Pt y, auto)
[PROOF STATE]
proof (state)
this:
A\<^sup>T * P\<^sup>T *\<^sub>v y = A\<^sup>T *\<^sub>v (P\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. w \<in> row_space A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
w = A\<^sup>T *\<^sub>v (P\<^sup>T *\<^sub>v y)
[PROOF STEP]
show "w \<in> row_space A"
[PROOF STATE]
proof (prove)
using this:
w = A\<^sup>T *\<^sub>v (P\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. w \<in> row_space A
[PROOF STEP]
unfolding row_space_eq[OF A]
[PROOF STATE]
proof (prove)
using this:
w = A\<^sup>T *\<^sub>v (P\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. w \<in> {w \<in> carrier_vec (dim_col A). \<exists>y\<in>carrier_vec (dim_row A). A\<^sup>T *\<^sub>v y = w}
[PROOF STEP]
using At Pt ym
[PROOF STATE]
proof (prove)
using this:
w = A\<^sup>T *\<^sub>v (P\<^sup>T *\<^sub>v y)
A\<^sup>T \<in> carrier_mat n m
P\<^sup>T \<in> carrier_mat m m
y \<in> carrier_vec m

goal (1 subgoal):
 1. w \<in> {w \<in> carrier_vec (dim_col A). \<exists>y\<in>carrier_vec (dim_row A). A\<^sup>T *\<^sub>v y = w}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> row_space A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?w1 \<in> row_space (P * A) \<Longrightarrow> ?w1 \<in> row_space A

goal (1 subgoal):
 1. row_space (P * A) = row_space A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?w1 \<in> row_space (P * A) \<Longrightarrow> ?w1 \<in> row_space A

goal (1 subgoal):
 1. row_space (P * A) = row_space A
[PROOF STEP]
have "w \<in> row_space (P*A)" if w: "w \<in> row_space A" for w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
have w_carrier: "w \<in> carrier_vec (dim_col A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> carrier_vec (dim_col A)
[PROOF STEP]
using w A
[PROOF STATE]
proof (prove)
using this:
w \<in> row_space A
A \<in> carrier_mat m n

goal (1 subgoal):
 1. w \<in> carrier_vec (dim_col A)
[PROOF STEP]
unfolding row_space_eq[OF A]
[PROOF STATE]
proof (prove)
using this:
w \<in> {w \<in> carrier_vec (dim_col A). \<exists>y\<in>carrier_vec (dim_row A). A\<^sup>T *\<^sub>v y = w}
A \<in> carrier_mat m n

goal (1 subgoal):
 1. w \<in> carrier_vec (dim_col A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> carrier_vec (dim_col A)

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
obtain P' where PP': "inverts_mat P P'" and P'P: "inverts_mat P' P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P'. \<lbrakk>inverts_mat P P'; inverts_mat P' P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inv_P P
[PROOF STATE]
proof (prove)
using this:
invertible_mat P
P \<in> carrier_mat m m

goal (1 subgoal):
 1. (\<And>P'. \<lbrakk>inverts_mat P P'; inverts_mat P' P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding invertible_mat_def
[PROOF STATE]
proof (prove)
using this:
square_mat P \<and> (\<exists>B. inverts_mat P B \<and> inverts_mat B P)
P \<in> carrier_mat m m

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

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
have P': "P' \<in> carrier_mat m m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' \<in> carrier_mat m m
[PROOF STEP]
using PP' P'P P
[PROOF STATE]
proof (prove)
using this:
inverts_mat P P'
inverts_mat P' P
P \<in> carrier_mat m m

goal (1 subgoal):
 1. P' \<in> carrier_mat m m
[PROOF STEP]
unfolding inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
P * P' = 1\<^sub>m (dim_row P)
P' * P = 1\<^sub>m (dim_row P')
P \<in> carrier_mat m m

goal (1 subgoal):
 1. P' \<in> carrier_mat m m
[PROOF STEP]
by (metis carrier_matD(1) carrier_matD(2) carrier_mat_triv index_mult_mat(3) index_one_mat(3))
[PROOF STATE]
proof (state)
this:
P' \<in> carrier_mat m m

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
w \<in> row_space A
[PROOF STEP]
obtain y where y: "y \<in> carrier_vec (dim_row A)" and
        w_Ay: "w = A\<^sup>T *\<^sub>v y"
[PROOF STATE]
proof (prove)
using this:
w \<in> row_space A

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> carrier_vec (dim_row A); w = A\<^sup>T *\<^sub>v y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding row_space_eq[OF A]
[PROOF STATE]
proof (prove)
using this:
w \<in> {w \<in> carrier_vec (dim_col A). \<exists>y\<in>carrier_vec (dim_row A). A\<^sup>T *\<^sub>v y = w}

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> carrier_vec (dim_row A); w = A\<^sup>T *\<^sub>v y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in> carrier_vec (dim_row A)
w = A\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
have Py: "(P'\<^sup>T *\<^sub>v y) \<in> carrier_vec m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P'\<^sup>T *\<^sub>v y \<in> carrier_vec m
[PROOF STEP]
using P' y A
[PROOF STATE]
proof (prove)
using this:
P' \<in> carrier_mat m m
y \<in> carrier_vec (dim_row A)
A \<in> carrier_mat m n

goal (1 subgoal):
 1. P'\<^sup>T *\<^sub>v y \<in> carrier_vec m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P'\<^sup>T *\<^sub>v y \<in> carrier_vec m

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
have "w = A\<^sup>T *\<^sub>v y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w = A\<^sup>T *\<^sub>v y
[PROOF STEP]
using w_Ay
[PROOF STATE]
proof (prove)
using this:
w = A\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w = A\<^sup>T *\<^sub>v y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
w = A\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
w = A\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
have "... = ((P' * P)*A)\<^sup>T *\<^sub>v y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v y = (P' * P * A)\<^sup>T *\<^sub>v y
[PROOF STEP]
using P'P left_mult_one_mat A P'
[PROOF STATE]
proof (prove)
using this:
inverts_mat P' P
?A \<in> carrier_mat ?nr ?nc \<Longrightarrow> 1\<^sub>m ?nr * ?A = ?A
A \<in> carrier_mat m n
P' \<in> carrier_mat m m

goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v y = (P' * P * A)\<^sup>T *\<^sub>v y
[PROOF STEP]
unfolding inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
P' * P = 1\<^sub>m (dim_row P')
?A \<in> carrier_mat ?nr ?nc \<Longrightarrow> 1\<^sub>m ?nr * ?A = ?A
A \<in> carrier_mat m n
P' \<in> carrier_mat m m

goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v y = (P' * P * A)\<^sup>T *\<^sub>v y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v y = (P' * P * A)\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v y = (P' * P * A)\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
have "... = ((P' * (P*A))\<^sup>T) *\<^sub>v y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P' * P * A)\<^sup>T *\<^sub>v y = (P' * (P * A))\<^sup>T *\<^sub>v y
[PROOF STEP]
using assoc_mult_mat_vec P' P A
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> carrier_mat ?n\<^sub>1 ?n\<^sub>2; ?B \<in> carrier_mat ?n\<^sub>2 ?n\<^sub>3; ?v \<in> carrier_vec ?n\<^sub>3\<rbrakk> \<Longrightarrow> ?A * ?B *\<^sub>v ?v = ?A *\<^sub>v (?B *\<^sub>v ?v)
P' \<in> carrier_mat m m
P \<in> carrier_mat m m
A \<in> carrier_mat m n

goal (1 subgoal):
 1. (P' * P * A)\<^sup>T *\<^sub>v y = (P' * (P * A))\<^sup>T *\<^sub>v y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(P' * P * A)\<^sup>T *\<^sub>v y = (P' * (P * A))\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(P' * P * A)\<^sup>T *\<^sub>v y = (P' * (P * A))\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
have "... = ((P*A)\<^sup>T * P'\<^sup>T) *\<^sub>v y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P' * (P * A))\<^sup>T *\<^sub>v y = (P * A)\<^sup>T * P'\<^sup>T *\<^sub>v y
[PROOF STEP]
using transpose_mult P A P' mult_carrier_mat
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> carrier_mat ?nr ?n; ?B \<in> carrier_mat ?n ?nc\<rbrakk> \<Longrightarrow> (?A * ?B)\<^sup>T = ?B\<^sup>T * ?A\<^sup>T
P \<in> carrier_mat m m
A \<in> carrier_mat m n
P' \<in> carrier_mat m m
\<lbrakk>?A \<in> carrier_mat ?nr ?n; ?B \<in> carrier_mat ?n ?nc\<rbrakk> \<Longrightarrow> ?A * ?B \<in> carrier_mat ?nr ?nc

goal (1 subgoal):
 1. (P' * (P * A))\<^sup>T *\<^sub>v y = (P * A)\<^sup>T * P'\<^sup>T *\<^sub>v y
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(P' * (P * A))\<^sup>T *\<^sub>v y = (P * A)\<^sup>T * P'\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(P' * (P * A))\<^sup>T *\<^sub>v y = (P * A)\<^sup>T * P'\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
have "... = (P*A)\<^sup>T *\<^sub>v (P'\<^sup>T *\<^sub>v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P * A)\<^sup>T * P'\<^sup>T *\<^sub>v y = (P * A)\<^sup>T *\<^sub>v (P'\<^sup>T *\<^sub>v y)
[PROOF STEP]
using assoc_mult_mat_vec A P P' y mult_carrier_mat
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> carrier_mat ?n\<^sub>1 ?n\<^sub>2; ?B \<in> carrier_mat ?n\<^sub>2 ?n\<^sub>3; ?v \<in> carrier_vec ?n\<^sub>3\<rbrakk> \<Longrightarrow> ?A * ?B *\<^sub>v ?v = ?A *\<^sub>v (?B *\<^sub>v ?v)
A \<in> carrier_mat m n
P \<in> carrier_mat m m
P' \<in> carrier_mat m m
y \<in> carrier_vec (dim_row A)
\<lbrakk>?A \<in> carrier_mat ?nr ?n; ?B \<in> carrier_mat ?n ?nc\<rbrakk> \<Longrightarrow> ?A * ?B \<in> carrier_mat ?nr ?nc

goal (1 subgoal):
 1. (P * A)\<^sup>T * P'\<^sup>T *\<^sub>v y = (P * A)\<^sup>T *\<^sub>v (P'\<^sup>T *\<^sub>v y)
[PROOF STEP]
by (smt carrier_matD(1) transpose_carrier_mat)
[PROOF STATE]
proof (state)
this:
(P * A)\<^sup>T * P'\<^sup>T *\<^sub>v y = (P * A)\<^sup>T *\<^sub>v (P'\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
w = (P * A)\<^sup>T *\<^sub>v (P'\<^sup>T *\<^sub>v y)
[PROOF STEP]
show "w \<in> row_space (P*A)"
[PROOF STATE]
proof (prove)
using this:
w = (P * A)\<^sup>T *\<^sub>v (P'\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. w \<in> row_space (P * A)
[PROOF STEP]
unfolding row_space_eq[OF PA]
[PROOF STATE]
proof (prove)
using this:
w = (P * A)\<^sup>T *\<^sub>v (P'\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. w \<in> {w \<in> carrier_vec (dim_col (P * A)). \<exists>y\<in>carrier_vec (dim_row (P * A)). (P * A)\<^sup>T *\<^sub>v y = w}
[PROOF STEP]
using Py w_carrier A P
[PROOF STATE]
proof (prove)
using this:
w = (P * A)\<^sup>T *\<^sub>v (P'\<^sup>T *\<^sub>v y)
P'\<^sup>T *\<^sub>v y \<in> carrier_vec m
w \<in> carrier_vec (dim_col A)
A \<in> carrier_mat m n
P \<in> carrier_mat m m

goal (1 subgoal):
 1. w \<in> {w \<in> carrier_vec (dim_col (P * A)). \<exists>y\<in>carrier_vec (dim_row (P * A)). (P * A)\<^sup>T *\<^sub>v y = w}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
w \<in> row_space (P * A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?w1 \<in> row_space A \<Longrightarrow> ?w1 \<in> row_space (P * A)

goal (1 subgoal):
 1. row_space (P * A) = row_space A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?w1 \<in> row_space (P * A) \<Longrightarrow> ?w1 \<in> row_space A
?w1 \<in> row_space A \<Longrightarrow> ?w1 \<in> row_space (P * A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?w1 \<in> row_space (P * A) \<Longrightarrow> ?w1 \<in> row_space A
?w1 \<in> row_space A \<Longrightarrow> ?w1 \<in> row_space (P * A)

goal (1 subgoal):
 1. row_space (P * A) = row_space A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row_space (P * A) = row_space A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isin_bst:
  assumes "bst t"
  shows   "isin t x \<longleftrightarrow> x \<in> set_tree t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isin t x = (x \<in> set_tree t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bst t

goal (1 subgoal):
 1. isin t x = (x \<in> set_tree t)
[PROOF STEP]
by (subst isin_set) (auto simp: bst_iff_sorted_wrt_less)


[STATEMENT]
lemma rat_of_int_div_dvd: "d dvd n \<Longrightarrow> rat_of_int (n div d) = rat_of_int n / rat_of_int d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d dvd n \<Longrightarrow> rat_of_int (n div d) = rat_of_int n / rat_of_int d
[PROOF STEP]
by auto


[STATEMENT]
lemma isCont_eq_Lb:
  fixes f :: "real \<Rightarrow> 'a::linorder_topology"
  shows "a \<le> b \<Longrightarrow> \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x \<Longrightarrow>
    \<exists>M. (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> M \<le> f x) \<and> (\<exists>x. a \<le> x \<and> x \<le> b \<and> f x = M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x\<rbrakk> \<Longrightarrow> \<exists>M. (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> M \<le> f x) \<and> (\<exists>x\<ge>a. x \<le> b \<and> f x = M)
[PROOF STEP]
using continuous_attains_inf[of "{a..b}" f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>compact {a..b}; {a..b} \<noteq> {}; continuous_on {a..b} f\<rbrakk> \<Longrightarrow> \<exists>x\<in>{a..b}. \<forall>y\<in>{a..b}. f x \<le> f y

goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x\<rbrakk> \<Longrightarrow> \<exists>M. (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> M \<le> f x) \<and> (\<exists>x\<ge>a. x \<le> b \<and> f x = M)
[PROOF STEP]
by (auto simp: continuous_at_imp_continuous_on Ball_def Bex_def)


[STATEMENT]
lemma fds_nth_shift [simp]: "fds_nth (fds_shift c f) n = fds_nth f n * nat_power n c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (fds_shift c f) n = fds_nth f n * nat_power n c
[PROOF STEP]
by (simp add: fds_shift_def fds_nth_fds)


[STATEMENT]
lemma eval_fps_exp [simp]:
  fixes c :: "'a :: {banach, real_normed_field}"
  shows "eval_fps (fps_exp c) z = exp (c * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fps (fps_exp c) z = exp (c * z)
[PROOF STEP]
unfolding eval_fps_def exp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. fps_nth (fps_exp c) n * z ^ n) = (\<Sum>n. (c * z) ^ n /\<^sub>R fact n)
[PROOF STEP]
by (simp add: eval_fps_def exp_def scaleR_conv_of_real field_split_simps)


[STATEMENT]
lemma has_vderiv_on_compose:
  assumes "(f has_vderiv_on f') (g ` T)"
  assumes "(g has_vderiv_on g') T"
  shows "(f o g has_vderiv_on (\<lambda>x. g' x *\<^sub>R f' (g x))) T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<circ> g has_vderiv_on (\<lambda>x. g' x *\<^sub>R f' (g x))) T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_vderiv_on f') (g ` T)
(g has_vderiv_on g') T

goal (1 subgoal):
 1. (f \<circ> g has_vderiv_on (\<lambda>x. g' x *\<^sub>R f' (g x))) T
[PROOF STEP]
unfolding has_vderiv_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>g ` T. (f has_vector_derivative f' x) (at x within g ` T)
\<forall>x\<in>T. (g has_vector_derivative g' x) (at x within T)

goal (1 subgoal):
 1. \<forall>x\<in>T. (f \<circ> g has_vector_derivative g' x *\<^sub>R f' (g x)) (at x within T)
[PROOF STEP]
by (auto intro!: vector_diff_chain_within)


[STATEMENT]
lemma  Domain_nodes_connected: "Domain {(x, y) |x y. nodes_connected G x y} = V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domain {(x, y) |x y. nodes_connected G x y} = V
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> \<exists>y. nodes_connected G x y
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> \<exists>y. nodes_connected G x y
[PROOF STEP]
apply(rule exI[where x=x])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> nodes_connected G x x
[PROOF STEP]
apply(rule exI[where x="[]"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> V \<Longrightarrow> is_path_undir G x [] x
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma homeomorphic_space_singleton_product:
   "product_topology X {k} homeomorphic_space (X k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_topology X {k} homeomorphic_space X k
[PROOF STEP]
unfolding homeomorphic_space
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ex (homeomorphic_map (product_topology X {k}) (X k))
[PROOF STEP]
apply (rule_tac x="\<lambda>x. x k" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_map (product_topology X {k}) (X k) (\<lambda>x. x k)
[PROOF STEP]
apply (rule bijective_open_imp_homeomorphic_map)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. continuous_map (product_topology X {k}) (X k) (\<lambda>x. x k)
 2. open_map (product_topology X {k}) (X k) (\<lambda>x. x k)
 3. (\<lambda>x. x k) ` topspace (product_topology X {k}) = topspace (X k)
 4. inj_on (\<lambda>x. x k) (topspace (product_topology X {k}))
[PROOF STEP]
apply (simp_all add: continuous_map_product_projection open_map_product_projection)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. x k) ` (\<Pi>\<^sub>E i\<in>{k}. topspace (X i)) = topspace (X k)
 2. inj_on (\<lambda>x. x k) (\<Pi>\<^sub>E i\<in>{k}. topspace (X i))
[PROOF STEP]
unfolding PiE_over_singleton_iff
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. x k) ` (\<Union>b\<in>topspace (X k). {\<lambda>x\<in>{k}. b}) = topspace (X k)
 2. inj_on (\<lambda>x. x k) (\<Union>b\<in>topspace (X k). {\<lambda>x\<in>{k}. b})
[PROOF STEP]
apply (auto simp: image_iff inj_on_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma matrix_to_iarray_plus[code_unfold]: "matrix_to_iarray (A + B) = (matrix_to_iarray A) + (matrix_to_iarray B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (A + B) = matrix_to_iarray A + matrix_to_iarray B
[PROOF STEP]
unfolding matrix_to_iarray_def o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray (map (\<lambda>x. vec_to_iarray ((A + B) $ mod_type_class.from_nat x)) [0..<CARD('c)]) = IArray (map (\<lambda>x. vec_to_iarray (A $ mod_type_class.from_nat x)) [0..<CARD('c)]) + IArray (map (\<lambda>x. vec_to_iarray (B $ mod_type_class.from_nat x)) [0..<CARD('c)])
[PROOF STEP]
by (simp add: plus_iarray_def vec_to_iarray_plus)


[STATEMENT]
lemma theorem24xxiii:
  "x * y \<sqinter> -(x * z) = x * (y \<sqinter> -z) \<sqinter> -(x * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * y \<sqinter> - (x * z) = x * (y \<sqinter> - z) \<sqinter> - (x * z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * y \<sqinter> - (x * z) = x * (y \<sqinter> - z) \<sqinter> - (x * z)
[PROOF STEP]
have "x * y \<sqinter> -(x * z) \<le> x * (y \<sqinter> (x\<^sup>T * -(x * z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * y \<sqinter> - (x * z) \<le> x * (y \<sqinter> x\<^sup>T * - (x * z))
[PROOF STEP]
by (simp add: dedekind_1)
[PROOF STATE]
proof (state)
this:
x * y \<sqinter> - (x * z) \<le> x * (y \<sqinter> x\<^sup>T * - (x * z))

goal (1 subgoal):
 1. x * y \<sqinter> - (x * z) = x * (y \<sqinter> - z) \<sqinter> - (x * z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * y \<sqinter> - (x * z) \<le> x * (y \<sqinter> x\<^sup>T * - (x * z))

goal (1 subgoal):
 1. x * y \<sqinter> - (x * z) = x * (y \<sqinter> - z) \<sqinter> - (x * z)
[PROOF STEP]
have "... \<le> x * (y \<sqinter> -z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * (y \<sqinter> x\<^sup>T * - (x * z)) \<le> x * (y \<sqinter> - z)
[PROOF STEP]
using comp_right_isotone conv_complement_sub_leq inf.sup_right_isotone
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<Longrightarrow> ?z * ?x \<le> ?z * ?y
?x\<^sup>T * - (?x * ?y) \<le> - ?y
?y \<le> ?x \<Longrightarrow> ?z \<sqinter> ?y \<le> ?z \<sqinter> ?x

goal (1 subgoal):
 1. x * (y \<sqinter> x\<^sup>T * - (x * z)) \<le> x * (y \<sqinter> - z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x * (y \<sqinter> x\<^sup>T * - (x * z)) \<le> x * (y \<sqinter> - z)

goal (1 subgoal):
 1. x * y \<sqinter> - (x * z) = x * (y \<sqinter> - z) \<sqinter> - (x * z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x * y \<sqinter> - (x * z) \<le> x * (y \<sqinter> - z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x * y \<sqinter> - (x * z) \<le> x * (y \<sqinter> - z)

goal (1 subgoal):
 1. x * y \<sqinter> - (x * z) = x * (y \<sqinter> - z) \<sqinter> - (x * z)
[PROOF STEP]
using comp_right_subdist_inf order.antisym inf.coboundedI2 inf.commute
[PROOF STATE]
proof (prove)
using this:
x * y \<sqinter> - (x * z) \<le> x * (y \<sqinter> - z)
?x * (?y \<sqinter> ?z) \<le> ?x * ?y \<sqinter> ?x * ?z
\<lbrakk>?a \<le> ?b; ?b \<le> ?a\<rbrakk> \<Longrightarrow> ?a = ?b
?b \<le> ?c \<Longrightarrow> ?a \<sqinter> ?b \<le> ?c
?a \<sqinter> ?b = ?b \<sqinter> ?a

goal (1 subgoal):
 1. x * y \<sqinter> - (x * z) = x * (y \<sqinter> - z) \<sqinter> - (x * z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x * y \<sqinter> - (x * z) = x * (y \<sqinter> - z) \<sqinter> - (x * z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rhombus__coplanar:
  assumes "Rhombus A B C D"
  shows "Coplanar A B C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
using Rhombus_def assms plg__coplanar
[PROOF STATE]
proof (prove)
using this:
Rhombus ?A ?B ?C ?D \<equiv> Plg ?A ?B ?C ?D \<and> Cong ?A ?B ?B ?C
Rhombus A B C D
Plg ?A ?B ?C ?D \<Longrightarrow> Coplanar ?A ?B ?C ?D

goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
by blast


[STATEMENT]
lemma surj_comp_pres_iso:
  fixes f :: "'a::quantale_with_dual \<Rightarrow> 'b::quantale_with_dual"
  assumes "f \<in> quantale_homset"
  shows "f ((radj f \<circ> f) (x \<cdot> y)) = f x \<cdot> f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ((radj f \<circ> f) (x \<cdot> y)) = f x \<cdot> f y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f ((radj f \<circ> f) (x \<cdot> y)) = f x \<cdot> f y
[PROOF STEP]
have "f \<stileturn> (radj f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<stileturn> radj f
[PROOF STEP]
by (simp add: assms quantale_hom_radj)
[PROOF STATE]
proof (state)
this:
f \<stileturn> radj f

goal (1 subgoal):
 1. f ((radj f \<circ> f) (x \<cdot> y)) = f x \<cdot> f y
[PROOF STEP]
hence "f ((radj f \<circ> f) (x \<cdot> y)) = f (x \<cdot> y)"
[PROOF STATE]
proof (prove)
using this:
f \<stileturn> radj f

goal (1 subgoal):
 1. f ((radj f \<circ> f) (x \<cdot> y)) = f (x \<cdot> y)
[PROOF STEP]
by (metis adj_cancel_eq1 comp_eq_dest_lhs)
[PROOF STATE]
proof (state)
this:
f ((radj f \<circ> f) (x \<cdot> y)) = f (x \<cdot> y)

goal (1 subgoal):
 1. f ((radj f \<circ> f) (x \<cdot> y)) = f x \<cdot> f y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f ((radj f \<circ> f) (x \<cdot> y)) = f (x \<cdot> y)

goal (1 subgoal):
 1. f ((radj f \<circ> f) (x \<cdot> y)) = f x \<cdot> f y
[PROOF STEP]
using assms quantale_homset_iff
[PROOF STATE]
proof (prove)
using this:
f ((radj f \<circ> f) (x \<cdot> y)) = f (x \<cdot> y)
f \<in> quantale_homset
(?f \<in> quantale_homset) = (comp_pres ?f \<and> Sup_pres ?f)

goal (1 subgoal):
 1. f ((radj f \<circ> f) (x \<cdot> y)) = f x \<cdot> f y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ((radj f \<circ> f) (x \<cdot> y)) = f x \<cdot> f y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transp_tllist_all2: "\<lbrakk> transp R; transp S \<rbrakk> \<Longrightarrow> transp (tllist_all2 R S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>transp R; transp S\<rbrakk> \<Longrightarrow> transp (tllist_all2 R S)
[PROOF STEP]
by (rule transpI) (rule tllist_all2_trans)


[STATEMENT]
lemma getRel_dom:
  assumes "graph G"
  shows "(a,b) \<in> getRel l G \<Longrightarrow> a \<in> vertices G"
        "(a,b) \<in> getRel l G \<Longrightarrow> b \<in> vertices G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((a, b) \<in> getRel l G \<Longrightarrow> a \<in> vertices G) &&& ((a, b) \<in> getRel l G \<Longrightarrow> b \<in> vertices G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
graph G

goal (1 subgoal):
 1. ((a, b) \<in> getRel l G \<Longrightarrow> a \<in> vertices G) &&& ((a, b) \<in> getRel l G \<Longrightarrow> b \<in> vertices G)
[PROOF STEP]
unfolding getRel_def
[PROOF STATE]
proof (prove)
using this:
graph G

goal (1 subgoal):
 1. ((a, b) \<in> {(x, y). (l, x, y) \<in> edges G} \<Longrightarrow> a \<in> vertices G) &&& ((a, b) \<in> {(x, y). (l, x, y) \<in> edges G} \<Longrightarrow> b \<in> vertices G)
[PROOF STEP]
by auto


[STATEMENT]
lemma expand_list_eq: "
  \<And>ys. (xs = ys) = (length xs = length ys \<and> (\<forall>i<length xs. xs ! i = ys ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ys. (xs = ys) = (length xs = length ys \<and> (\<forall>i<length xs. xs ! i = ys ! i))
[PROOF STEP]
by (rule list_eq_iff_nth_eq)


[STATEMENT]
lemma emeasure_add_AE:
  assumes [measurable]: "A \<in> sets M" "B \<in> sets M" "C \<in> sets M"
  assumes 1: "AE x in M. x \<in> C \<longleftrightarrow> x \<in> A \<or> x \<in> B"
  assumes 2: "AE x in M. \<not> (x \<in> A \<and> x \<in> B)"
  shows "emeasure M C = emeasure M A + emeasure M B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M C = emeasure M A + emeasure M B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure M C = emeasure M A + emeasure M B
[PROOF STEP]
have "emeasure M C = emeasure M (A \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M C = emeasure M (A \<union> B)
[PROOF STEP]
by (rule emeasure_eq_AE) (insert 1, auto)
[PROOF STATE]
proof (state)
this:
emeasure M C = emeasure M (A \<union> B)

goal (1 subgoal):
 1. emeasure M C = emeasure M A + emeasure M B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M C = emeasure M (A \<union> B)

goal (1 subgoal):
 1. emeasure M C = emeasure M A + emeasure M B
[PROOF STEP]
have "\<dots> = emeasure M A + emeasure M (B - A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (A \<union> B) = emeasure M A + emeasure M (B - A)
[PROOF STEP]
by (subst plus_emeasure) auto
[PROOF STATE]
proof (state)
this:
emeasure M (A \<union> B) = emeasure M A + emeasure M (B - A)

goal (1 subgoal):
 1. emeasure M C = emeasure M A + emeasure M B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M (A \<union> B) = emeasure M A + emeasure M (B - A)

goal (1 subgoal):
 1. emeasure M C = emeasure M A + emeasure M B
[PROOF STEP]
have "emeasure M (B - A) = emeasure M B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (B - A) = emeasure M B
[PROOF STEP]
by (rule emeasure_eq_AE) (insert 2, auto)
[PROOF STATE]
proof (state)
this:
emeasure M (B - A) = emeasure M B

goal (1 subgoal):
 1. emeasure M C = emeasure M A + emeasure M B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure M C = emeasure M A + emeasure M B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure M C = emeasure M A + emeasure M B

goal (1 subgoal):
 1. emeasure M C = emeasure M A + emeasure M B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure M C = emeasure M A + emeasure M B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aux2_digit_gen_sum_repr:
  assumes "n < b^c" "r < c"
  shows "nth_digit (a*b^c+n) r b = nth_digit n r b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_digit (a * b ^ c + n) r b = nth_digit n r b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nth_digit (a * b ^ c + n) r b = nth_digit n r b
[PROOF STEP]
have [simp]: \<open>a*b ^ c div b ^ r = a*b ^ (c - r)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * b ^ c div b ^ r = a * b ^ (c - r)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
r < c

goal (1 subgoal):
 1. a * b ^ c div b ^ r = a * b ^ (c - r)
[PROOF STEP]
by (auto simp: less_iff_Suc_add
          monoid_mult_class.power_add ac_simps)
[PROOF STATE]
proof (state)
this:
a * b ^ c div b ^ r = a * b ^ (c - r)

goal (1 subgoal):
 1. nth_digit (a * b ^ c + n) r b = nth_digit n r b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_digit (a * b ^ c + n) r b = nth_digit n r b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n < b ^ c
r < c

goal (1 subgoal):
 1. nth_digit (a * b ^ c + n) r b = nth_digit n r b
[PROOF STEP]
by (auto simp add: nth_digit_def
            div_plus_div_distrib_dvd_left
            le_imp_power_dvd
          simp flip: mod_add_left_eq)
[PROOF STATE]
proof (state)
this:
nth_digit (a * b ^ c + n) r b = nth_digit n r b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma locally_connected:
  "locally connected S \<longleftrightarrow>
   (\<forall>v x. openin (top_of_set S) v \<and> x \<in> v
          \<longrightarrow> (\<exists>u. openin (top_of_set S) u \<and> connected u \<and> x \<in> u \<and> u \<subseteq> v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally connected S = (\<forall>v x. openin (top_of_set S) v \<and> x \<in> v \<longrightarrow> (\<exists>u. openin (top_of_set S) u \<and> connected u \<and> x \<in> u \<and> u \<subseteq> v))
[PROOF STEP]
by (metis locally_connected_1 locally_connected_2 locally_connected_3)


[STATEMENT]
lemma size_le_1: "size f \<le> 1 = (f = {||} \<or> (\<exists>e. f = {|e|}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (size f \<le> 1) = (f = {||} \<or> (\<exists>e. f = {|e|}))
[PROOF STEP]
apply standard
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. size f \<le> 1 \<Longrightarrow> f = {||} \<or> (\<exists>e. f = {|e|})
 2. f = {||} \<or> (\<exists>e. f = {|e|}) \<Longrightarrow> size f \<le> 1
[PROOF STEP]
apply (metis bot.not_eq_extremum gr_implies_not0 le_neq_implies_less less_one size_fsingleton size_fsubset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = {||} \<or> (\<exists>e. f = {|e|}) \<Longrightarrow> size f \<le> 1
[PROOF STEP]
by auto


[STATEMENT]
lemma pcompose_smult: "pcompose (smult a p) r = smult a (pcompose p r)"
  for p r :: "'a::comm_semiring_0 poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult a p \<circ>\<^sub>p r = smult a (p \<circ>\<^sub>p r)
[PROOF STEP]
by (induct p) (simp_all add: pcompose_pCons pcompose_add smult_add_right)