[STATEMENT]
lemma contraction_dist:
  fixes C :: "'b :: complete_space \<Rightarrow> 'b"
  assumes "\<And>v u. dist (C v) (C u) \<le> c  * dist v u"
  assumes "0 \<le> c" "c < 1"
  shows "(1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
have "is_contraction C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_contraction C
[PROOF STEP]
unfolding is_contraction_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l\<ge>0. l < 1 \<and> (\<forall>v u. dist (C v) (C u) \<le> l * dist v u)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dist (C ?v) (C ?u) \<le> c * dist ?v ?u
0 \<le> c
c < 1

goal (1 subgoal):
 1. \<exists>l\<ge>0. l < 1 \<and> (\<forall>v u. dist (C v) (C u) \<le> l * dist v u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_contraction C

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_contraction C
[PROOF STEP]
obtain v_fix where v_fix: "v_fix = (THE v. C v = v)"
[PROOF STATE]
proof (prove)
using this:
is_contraction C

goal (1 subgoal):
 1. (\<And>v_fix. v_fix = (THE v. C v = v) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using the1_equality
[PROOF STATE]
proof (prove)
using this:
is_contraction C
\<lbrakk>\<exists>!x. ?P x; ?P ?a\<rbrakk> \<Longrightarrow> (THE x. ?P x) = ?a

goal (1 subgoal):
 1. (\<And>v_fix. v_fix = (THE v. C v = v) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
v_fix = (THE v. C v = v)

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
hence "(\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> v_fix"
[PROOF STATE]
proof (prove)
using this:
v_fix = (THE v. C v = v)

goal (1 subgoal):
 1. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> v_fix
[PROOF STEP]
using banach'[OF \<open>is_contraction C\<close>]
[PROOF STATE]
proof (prove)
using this:
v_fix = (THE v. C v = v)
\<exists>!v. C v = v
(\<lambda>n. (C ^^ n) ?v) \<longlonglongrightarrow> (THE v. C v = v)

goal (1 subgoal):
 1. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> v_fix
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> v_fix

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
have dist_contr_le_pow: "\<And>n. dist ((C ^^ n) v) ((C ^^ Suc n) v) \<le> c ^ n * dist v (C v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. dist ((C ^^ n) v) ((C ^^ Suc n) v) \<le> c ^ n * dist v (C v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. dist ((C ^^ n) v) ((C ^^ Suc n) v) \<le> c ^ n * dist v (C v)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. dist ((C ^^ n) v) ((C ^^ Suc n) v) \<le> c ^ n * dist v (C v)
[PROOF STEP]
show "dist ((C ^^ n) v) ((C ^^ Suc n) v) \<le> c ^ n * dist v (C v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist ((C ^^ n) v) ((C ^^ Suc n) v) \<le> c ^ n * dist v (C v)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dist (C ?v) (C ?u) \<le> c * dist ?v ?u
0 \<le> c
c < 1

goal (1 subgoal):
 1. dist ((C ^^ n) v) ((C ^^ Suc n) v) \<le> c ^ n * dist v (C v)
[PROOF STEP]
by (induction n) (auto simp: algebra_simps intro!: order.trans[OF assms(1)] mult_left_mono)
[PROOF STATE]
proof (state)
this:
dist ((C ^^ n) v) ((C ^^ Suc n) v) \<le> c ^ n * dist v (C v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dist ((C ^^ ?n) v) ((C ^^ Suc ?n) v) \<le> c ^ ?n * dist v (C v)

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
have summable_C: "summable (\<lambda>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
using dist_contr_le_pow assms summable_powser_const
[PROOF STATE]
proof (prove)
using this:
dist ((C ^^ ?n) v) ((C ^^ Suc ?n) v) \<le> c ^ ?n * dist v (C v)
dist (C ?v) (C ?u) \<le> c * dist ?v ?u
0 \<le> c
c < 1
\<bar>?c\<bar> < 1 \<Longrightarrow> summable (\<lambda>n. ?c ^ n * ?x)

goal (1 subgoal):
 1. summable (\<lambda>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
by (intro summable_comparison_test[of "(\<lambda>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))" "\<lambda>i. c^i * dist v (C v)"])
          auto
[PROOF STATE]
proof (state)
this:
summable (\<lambda>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
have "\<forall>e > 0. dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ (Suc i)) v)) + e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e>0. dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
fix e ::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
assume "0 < e"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. dist ((C^^n) v) v_fix < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. dist ((C ^^ n) v) v_fix < e
[PROOF STEP]
using \<open>(\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> v_fix\<close> \<open>0 < e\<close> tendsto_iff
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> v_fix
0 < e
(?f \<longlongrightarrow> ?l) ?F = (\<forall>e>0. \<forall>\<^sub>F x in ?F. dist (?f x) ?l < e)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. dist ((C ^^ n) v) v_fix < e
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. dist ((C ^^ n) v) v_fix < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. dist ((C ^^ n) v) v_fix < e
[PROOF STEP]
obtain N where "dist ((C^^N) v) v_fix < e"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. dist ((C ^^ n) v) v_fix < e

goal (1 subgoal):
 1. (\<And>N. dist ((C ^^ N) v) v_fix < e \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
dist ((C ^^ N) v) v_fix < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
hence *: "dist v v_fix \<le> dist v ((C^^N) v) + e"
[PROOF STATE]
proof (prove)
using this:
dist ((C ^^ N) v) v_fix < e

goal (1 subgoal):
 1. dist v v_fix \<le> dist v ((C ^^ N) v) + e
[PROOF STEP]
by (metis add_le_cancel_left dist_commute dist_triangle_le less_eq_real_def)
[PROOF STATE]
proof (state)
this:
dist v v_fix \<le> dist v ((C ^^ N) v) + e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
have "dist v ((C^^N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ (Suc i)) v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
proof (induction N arbitrary: v)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>v. dist v ((C ^^ 0) v) \<le> (\<Sum>i\<le>0. dist ((C ^^ i) v) ((C ^^ Suc i) v))
 2. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>v. dist v ((C ^^ 0) v) \<le> (\<Sum>i\<le>0. dist ((C ^^ i) v) ((C ^^ Suc i) v))
 2. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist v ((C ^^ 0) v) \<le> (\<Sum>i\<le>0. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist v ((C ^^ 0) v) \<le> (\<Sum>i\<le>0. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
case (Suc N)
[PROOF STATE]
proof (state)
this:
dist ?v ((C ^^ N) ?v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) ?v) ((C ^^ Suc i) ?v))

goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
have "dist v ((C ^^ Suc N) v) \<le> dist v (C v) + dist (C v) ((C^^(Suc N)) v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist v ((C ^^ Suc N) v) \<le> dist v (C v) + dist (C v) ((C ^^ Suc N) v)
[PROOF STEP]
by metric
[PROOF STATE]
proof (state)
this:
dist v ((C ^^ Suc N) v) \<le> dist v (C v) + dist (C v) ((C ^^ Suc N) v)

goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist v ((C ^^ Suc N) v) \<le> dist v (C v) + dist (C v) ((C ^^ Suc N) v)

goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
have "\<dots> =  dist v (C v) + dist (C v) ((C^^N) (C v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist v (C v) + dist (C v) ((C ^^ Suc N) v) = dist v (C v) + dist (C v) ((C ^^ N) (C v))
[PROOF STEP]
by (metis funpow_simps_right(2) o_def)
[PROOF STATE]
proof (state)
this:
dist v (C v) + dist (C v) ((C ^^ Suc N) v) = dist v (C v) + dist (C v) ((C ^^ N) (C v))

goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist v (C v) + dist (C v) ((C ^^ Suc N) v) = dist v (C v) + dist (C v) ((C ^^ N) (C v))

goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
have "\<dots> \<le> dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ i) (C v)) ((C ^^ Suc i) (C v)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist v (C v) + dist (C v) ((C ^^ N) (C v)) \<le> dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ i) (C v)) ((C ^^ Suc i) (C v)))
[PROOF STEP]
using Suc.IH add_le_cancel_left
[PROOF STATE]
proof (prove)
using this:
dist ?v ((C ^^ N) ?v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) ?v) ((C ^^ Suc i) ?v))
(?c + ?a \<le> ?c + ?b) = (?a \<le> ?b)

goal (1 subgoal):
 1. dist v (C v) + dist (C v) ((C ^^ N) (C v)) \<le> dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ i) (C v)) ((C ^^ Suc i) (C v)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
dist v (C v) + dist (C v) ((C ^^ N) (C v)) \<le> dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ i) (C v)) ((C ^^ Suc i) (C v)))

goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist v (C v) + dist (C v) ((C ^^ N) (C v)) \<le> dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ i) (C v)) ((C ^^ Suc i) (C v)))

goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
have "\<dots> \<le> dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^Suc i) v) ((C ^^ (Suc (Suc i))) v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ i) (C v)) ((C ^^ Suc i) (C v))) \<le> dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ Suc i) v) ((C ^^ Suc (Suc i)) v))
[PROOF STEP]
by (simp only: funpow_simps_right(2) o_def)
[PROOF STATE]
proof (state)
this:
dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ i) (C v)) ((C ^^ Suc i) (C v))) \<le> dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ Suc i) v) ((C ^^ Suc (Suc i)) v))

goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ i) (C v)) ((C ^^ Suc i) (C v))) \<le> dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ Suc i) v) ((C ^^ Suc (Suc i)) v))

goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
have "\<dots> \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ (Suc i)) v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ Suc i) v) ((C ^^ Suc (Suc i)) v)) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
by (subst sum.atMost_Suc_shift) simp
[PROOF STATE]
proof (state)
this:
dist v (C v) + (\<Sum>i\<le>N. dist ((C ^^ Suc i) v) ((C ^^ Suc (Suc i)) v)) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. \<And>N v. (\<And>v. dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))) \<Longrightarrow> dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
show "dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))"
[PROOF STATE]
proof (prove)
using this:
dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dist v ((C ^^ Suc N) v) \<le> (\<Sum>i\<le>Suc N. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
have
      "(\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v)) \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ (Suc i)) v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v)) \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
using summable_C
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v)) \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
by (auto intro: sum_le_suminf)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v)) \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
(\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v)) \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
have "dist v ((C^^N) v) \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ (Suc i)) v))"
[PROOF STATE]
proof (prove)
using this:
dist v ((C ^^ N) v) \<le> (\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v))
(\<Sum>i\<le>N. dist ((C ^^ i) v) ((C ^^ Suc i) v)) \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. dist v ((C ^^ N) v) \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
dist v ((C ^^ N) v) \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
thus "dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e"
[PROOF STATE]
proof (prove)
using this:
dist v ((C ^^ N) v) \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
dist v ((C ^^ N) v) \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))
dist v v_fix \<le> dist v ((C ^^ N) v) + e

goal (1 subgoal):
 1. dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>e>0. dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
hence le_suminf: "dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))"
[PROOF STATE]
proof (prove)
using this:
\<forall>e>0. dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e

goal (1 subgoal):
 1. dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
using field_le_epsilon
[PROOF STATE]
proof (prove)
using this:
\<forall>e>0. dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v)) + e
(\<And>e. (0::?'a) < e \<Longrightarrow> ?x \<le> ?y + e) \<Longrightarrow> ?x \<le> ?y

goal (1 subgoal):
 1. dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
dist v v_fix \<le> (\<Sum>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
have "dist v v_fix \<le> (\<Sum>i. c ^ i * dist v (C v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist v v_fix \<le> (\<Sum>i. c ^ i * dist v (C v))
[PROOF STEP]
using dist_contr_le_pow summable_C assms summable_powser_const
[PROOF STATE]
proof (prove)
using this:
dist ((C ^^ ?n) v) ((C ^^ Suc ?n) v) \<le> c ^ ?n * dist v (C v)
summable (\<lambda>i. dist ((C ^^ i) v) ((C ^^ Suc i) v))
dist (C ?v) (C ?u) \<le> c * dist ?v ?u
0 \<le> c
c < 1
\<bar>?c\<bar> < 1 \<Longrightarrow> summable (\<lambda>n. ?c ^ n * ?x)

goal (1 subgoal):
 1. dist v v_fix \<le> (\<Sum>i. c ^ i * dist v (C v))
[PROOF STEP]
by (auto intro!: order_trans[OF le_suminf] suminf_le)
[PROOF STATE]
proof (state)
this:
dist v v_fix \<le> (\<Sum>i. c ^ i * dist v (C v))

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
hence "dist v v_fix \<le> dist v (C v) / (1 - c)"
[PROOF STATE]
proof (prove)
using this:
dist v v_fix \<le> (\<Sum>i. c ^ i * dist v (C v))

goal (1 subgoal):
 1. dist v v_fix \<le> dist v (C v) / (1 - c)
[PROOF STEP]
using sum_disc_lim
[PROOF STATE]
proof (prove)
using this:
dist v v_fix \<le> (\<Sum>i. c ^ i * dist v (C v))
\<bar>?c\<bar> < 1 \<Longrightarrow> (\<Sum>x. ?c ^ x * ?B) = ?B / (1 - ?c)

goal (1 subgoal):
 1. dist v v_fix \<le> dist v (C v) / (1 - c)
[PROOF STEP]
by (metis sum_disc_lim abs_of_nonneg assms(2) assms(3))
[PROOF STATE]
proof (state)
this:
dist v v_fix \<le> dist v (C v) / (1 - c)

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
hence "(1 - c) * dist v v_fix \<le> dist v (C v)"
[PROOF STATE]
proof (prove)
using this:
dist v v_fix \<le> dist v (C v) / (1 - c)

goal (1 subgoal):
 1. (1 - c) * dist v v_fix \<le> dist v (C v)
[PROOF STEP]
using assms(3) mult.commute pos_le_divide_eq
[PROOF STATE]
proof (prove)
using this:
dist v v_fix \<le> dist v (C v) / (1 - c)
c < 1
?a * ?b = ?b * ?a
(0::?'a) < ?c \<Longrightarrow> (?a \<le> ?b / ?c) = (?a * ?c \<le> ?b)

goal (1 subgoal):
 1. (1 - c) * dist v v_fix \<le> dist v (C v)
[PROOF STEP]
by (metis diff_gt_0_iff_gt)
[PROOF STATE]
proof (state)
this:
(1 - c) * dist v v_fix \<le> dist v (C v)

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(1 - c) * dist v v_fix \<le> dist v (C v)

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
using v_fix
[PROOF STATE]
proof (prove)
using this:
(1 - c) * dist v v_fix \<le> dist v (C v)
v_fix = (THE v. C v = v)

goal (1 subgoal):
 1. (1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(1 - c) * dist v (THE v. C v = v) \<le> dist v (C v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ap_spmf_C: "return_spmf (\<lambda>f x y. f y x) \<diamondop> f \<diamondop> x \<diamondop> y = f \<diamondop> y \<diamondop> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. return_spmf (\<lambda>f x y. f y x) \<diamondop> f \<diamondop> x \<diamondop> y = f \<diamondop> y \<diamondop> x
[PROOF STEP]
apply(simp add: ap_spmf_def pair_map_spmf1 spmf.map_comp pair_spmf_return_spmf1 pair_pair_spmf o_def split_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf (\<lambda>x. fst x (snd (snd x)) (fst (snd x))) (pair_spmf f (pair_spmf x y)) = map_spmf (\<lambda>x. fst x (fst (snd x)) (snd (snd x))) (pair_spmf f (pair_spmf y x))
[PROOF STEP]
apply(subst (2) pair_commute_spmf)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf (\<lambda>x. fst x (snd (snd x)) (fst (snd x))) (pair_spmf f (map_spmf (\<lambda>(y, x). (x, y)) (pair_spmf y x))) = map_spmf (\<lambda>x. fst x (fst (snd x)) (snd (snd x))) (pair_spmf f (pair_spmf y x))
[PROOF STEP]
apply(simp add: pair_map_spmf2 spmf.map_comp o_def split_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fcomp_vsubset_vtimes:
  assumes "r \<subseteq>\<^sub>\<circ> B \<times>\<^sub>\<bullet> C" and "s \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<bullet> B"
  shows "r \<circ>\<^sub>\<bullet> s \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<bullet> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<circ>\<^sub>\<bullet> s \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<bullet> C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r \<subseteq>\<^sub>\<circ> B \<times>\<^sub>\<bullet> C
s \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<bullet> B

goal (1 subgoal):
 1. r \<circ>\<^sub>\<bullet> s \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<bullet> C
[PROOF STEP]
by blast


[STATEMENT]
lemma ttree_restr_nxt_subset2: "x \<notin> S \<Longrightarrow> paths (ttree_restr S (nxt t x)) \<subseteq> paths (ttree_restr S t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> S \<Longrightarrow> paths (ttree_restr S (nxt t x)) \<subseteq> paths (ttree_restr S t)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x S t. \<lbrakk>x \<notin> S; [] \<in> t \<and> downset t\<rbrakk> \<Longrightarrow> filter (\<lambda>x'. x' \<in> S) ` insert [] {xs |xs. x # xs \<in> t} \<subseteq> filter (\<lambda>x'. x' \<in> S) ` t
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x S t. \<lbrakk>x \<notin> S; [] \<in> t; downset t\<rbrakk> \<Longrightarrow> [] \<in> filter (\<lambda>x'. x' \<in> S) ` t
 2. \<And>x S t xb. \<lbrakk>x \<notin> S; [] \<in> t; downset t; x # xb \<in> t\<rbrakk> \<Longrightarrow> filter (\<lambda>x'. x' \<in> S) xb \<in> filter (\<lambda>x'. x' \<in> S) ` t
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x S t xb. \<lbrakk>x \<notin> S; [] \<in> t; downset t; x # xb \<in> t\<rbrakk> \<Longrightarrow> filter (\<lambda>x'. x' \<in> S) xb \<in> filter (\<lambda>x'. x' \<in> S) ` t
[PROOF STEP]
by (metis filter.simps(2) imageI)


[STATEMENT]
lemma normalize_eigen_vector: assumes "eigen_vector (A :: 'a :: real_normed_field ^ 'n ^ 'n) v ev"
  shows "eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev" "norm1 ((1 / norm1 v) *\<^sub>R v) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev &&& norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
 2. norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
let ?v = "(1 / norm1 v) *\<^sub>R v"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
 2. norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
from assms[unfolded eigen_vector_def]
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0 \<and> A *v v = ev *s v
[PROOF STEP]
have nz: "v \<noteq> 0" and id: "A *v v = ev *s v"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0 \<and> A *v v = ev *s v

goal (1 subgoal):
 1. v \<noteq> 0 &&& A *v v = ev *s v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> 0
A *v v = ev *s v

goal (2 subgoals):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
 2. norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
from nz
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0
[PROOF STEP]
have norm1: "norm1 v \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0

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

goal (2 subgoals):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
 2. norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
thus "norm1 ?v = 1"
[PROOF STATE]
proof (prove)
using this:
norm1 v \<noteq> 0

goal (1 subgoal):
 1. norm1 ((1 / norm1 v) *\<^sub>R v) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm1 ((1 / norm1 v) *\<^sub>R v) = 1

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
from norm1 nz
[PROOF STATE]
proof (chain)
picking this:
norm1 v \<noteq> 0
v \<noteq> 0
[PROOF STEP]
have nz: "?v \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
norm1 v \<noteq> 0
v \<noteq> 0

goal (1 subgoal):
 1. (1 / norm1 v) *\<^sub>R v \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1 / norm1 v) *\<^sub>R v \<noteq> 0

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
have "A *v ?v = (1 / norm1 v) *\<^sub>R (A *v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v (1 / norm1 v) *\<^sub>R v = (1 / norm1 v) *\<^sub>R (A *v v)
[PROOF STEP]
by (auto simp: vec_eq_iff matrix_vector_mult_def real_vector.scale_sum_right)
[PROOF STATE]
proof (state)
this:
A *v (1 / norm1 v) *\<^sub>R v = (1 / norm1 v) *\<^sub>R (A *v v)

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *v (1 / norm1 v) *\<^sub>R v = (1 / norm1 v) *\<^sub>R (A *v v)

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
have "A *v v = ev *s v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v v = ev *s v
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ev *s v = ev *s v
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A *v v = ev *s v

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *v v = ev *s v

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
have "(1 / norm1 v) *\<^sub>R (ev *s v) = ev *s ?v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / norm1 v) *\<^sub>R (ev *s v) = ev *s (1 / norm1 v) *\<^sub>R v
[PROOF STEP]
by (auto simp: vec_eq_iff)
[PROOF STATE]
proof (state)
this:
(1 / norm1 v) *\<^sub>R (ev *s v) = ev *s (1 / norm1 v) *\<^sub>R v

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A *v (1 / norm1 v) *\<^sub>R v = ev *s (1 / norm1 v) *\<^sub>R v
[PROOF STEP]
show "eigen_vector A ?v ev"
[PROOF STATE]
proof (prove)
using this:
A *v (1 / norm1 v) *\<^sub>R v = ev *s (1 / norm1 v) *\<^sub>R v

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
using nz
[PROOF STATE]
proof (prove)
using this:
A *v (1 / norm1 v) *\<^sub>R v = ev *s (1 / norm1 v) *\<^sub>R v
(1 / norm1 v) *\<^sub>R v \<noteq> 0

goal (1 subgoal):
 1. eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev
[PROOF STEP]
unfolding eigen_vector_def
[PROOF STATE]
proof (prove)
using this:
A *v (1 / norm1 v) *\<^sub>R v = ev *s (1 / norm1 v) *\<^sub>R v
(1 / norm1 v) *\<^sub>R v \<noteq> 0

goal (1 subgoal):
 1. (1 / norm1 v) *\<^sub>R v \<noteq> 0 \<and> A *v (1 / norm1 v) *\<^sub>R v = ev *s (1 / norm1 v) *\<^sub>R v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eigen_vector A ((1 / norm1 v) *\<^sub>R v) ev

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma least_nth_least[simp]:
    assumes "A \<noteq> {}" "\<And> i. i \<in> A \<Longrightarrow> enat i < esize B"
    shows "least (nth_least B ` A) = nth_least B (least A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. least (nth_least B ` A) = nth_least B (least A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
?i \<in> A \<Longrightarrow> enat ?i < esize B

goal (1 subgoal):
 1. least (nth_least B ` A) = nth_least B (least A)
[PROOF STEP]
by simp


[STATEMENT]
lemma empty_in_lift_profile_iff [simp]: "{} \<in># lift_profile A \<longleftrightarrow> {} \<in># A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({} \<in># lift_profile A) = ({} \<in># A)
[PROOF STEP]
by (auto simp: lift_profile_def)


[STATEMENT]
lemma selectlike_equal_cocond_corule: "(\<And>\<mu>. Uvariation \<mu> \<nu> V \<Longrightarrow> (\<mu>\<in>X) = (\<mu>\<in>Y))
  \<Longrightarrow> (selectlike X \<nu> (-V) = selectlike Y \<nu> (-V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<mu>. Uvariation \<mu> \<nu> V \<Longrightarrow> (\<mu> \<in> X) = (\<mu> \<in> Y)) \<Longrightarrow> selectlike X \<nu> (- V) = selectlike Y \<nu> (- V)
[PROOF STEP]
using selectlike_equal_cond[where V=\<open>-V\<close>]
[PROOF STATE]
proof (prove)
using this:
(selectlike ?X ?\<nu> (- V) = selectlike ?Y ?\<nu> (- V)) = (\<forall>\<mu>. Uvariation \<mu> ?\<nu> (- (- V)) \<longrightarrow> (\<mu> \<in> ?X) = (\<mu> \<in> ?Y))

goal (1 subgoal):
 1. (\<And>\<mu>. Uvariation \<mu> \<nu> V \<Longrightarrow> (\<mu> \<in> X) = (\<mu> \<in> Y)) \<Longrightarrow> selectlike X \<nu> (- V) = selectlike Y \<nu> (- V)
[PROOF STEP]
by simp


[STATEMENT]
lemma sq_mtx_inv_one[simp]: "1\<^sup>-\<^sup>1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sup>-\<^sup>1 = 1
[PROOF STEP]
by (simp add: sq_mtx_inv_unique)


[STATEMENT]
lemma max_idx_vars: "pre_wf_formula n \<phi> \<Longrightarrow> \<forall>p \<in> FOV \<phi> \<union> SOV \<phi>. p < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_wf_formula n \<phi> \<Longrightarrow> \<forall>p\<in>FOV \<phi> \<union> SOV \<phi>. p < n
[PROOF STEP]
by (induct \<phi> arbitrary: n)
   (auto split: if_split_asm, (metis Un_iff diff_Suc_less less_SucE less_imp_diff_less)+)


[STATEMENT]
lemma isGlb_unique: "[| isGlb R S x; isGlb R S y |] ==> x = (y::'a::linorder)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isGlb R S x; isGlb R S y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (frule isGlb_isLb)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isGlb R S x; isGlb R S y; isLb R S x\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (frule_tac x = y in isGlb_isLb)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isGlb R S x; isGlb R S y; isLb R S x; isLb R S y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (blast intro!: order_antisym dest!: isGlb_le_isLb)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma push_bit_Suc_minus_numeral [simp]:
  \<open>push_bit (Suc n) (- numeral k) = push_bit n (- numeral (Num.Bit0 k))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit (Suc n) (- numeral k) = push_bit n (- numeral (num.Bit0 k))
[PROOF STEP]
apply (simp only: numeral_Bit0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit (Suc n) (- numeral k) = push_bit n (- (numeral k + numeral k))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit n (- numeral (k * num.Bit0 num.One)) = push_bit n (- numeral (k + k))
[PROOF STEP]
apply (simp only: numeral_mult mult_2_right numeral_add)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma absolute_retract_Un:
  fixes S :: "'a::euclidean_space set"
  shows "\<lbrakk>S retract_of UNIV; T retract_of UNIV; (S \<inter> T) retract_of UNIV\<rbrakk>
         \<Longrightarrow> (S \<union> T) retract_of UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S retract_of UNIV; T retract_of UNIV; S \<inter> T retract_of UNIV\<rbrakk> \<Longrightarrow> S \<union> T retract_of UNIV
[PROOF STEP]
by (meson AR_closed_Un_local_aux closed_subset retract_of_UNIV retract_of_imp_subset)


[STATEMENT]
lemma prv_imp_imp_com:
assumes "\<phi> \<in> fmla" and "\<chi> \<in> fmla" and "\<psi> \<in> fmla"
shows
"prv (imp (imp \<phi> (imp \<chi> \<psi>))
          (imp \<chi> (imp \<phi> \<psi>)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (imp \<phi> (imp \<chi> \<psi>)) (imp \<chi> (imp \<phi> \<psi>)))
[PROOF STEP]
by (metis (no_types) assms
   prv_prv_imp_trans prv_imp_com prv_imp_imp_triv prv_imp_trans imp)


[STATEMENT]
lemma less_is_drop_replicate:
  fixes x::"'a::len word"
  assumes lt: "x < 2 ^ n"
  shows   "to_bl x = replicate (LENGTH('a) - n) False @ drop (LENGTH('a) - n) (to_bl x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl x = replicate (LENGTH('a) - n) False @ drop (LENGTH('a) - n) (to_bl x)
[PROOF STEP]
by (metis assms bl_and_mask' less_mask_eq)


[STATEMENT]
lemma Mid_cases:
  assumes "A Midpoint B C \<or> A Midpoint C B"
  shows "A Midpoint B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A Midpoint B C
[PROOF STEP]
using assms l7_2
[PROOF STATE]
proof (prove)
using this:
A Midpoint B C \<or> A Midpoint C B
?M Midpoint ?A ?B \<Longrightarrow> ?M Midpoint ?B ?A

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


[STATEMENT]
lemma pdivmod_via_pseudo_divmod:
  \<open>(f div g, f mod g) =
    (if g = 0 then (0, f)
     else
      let
        ilc = inverse (lead_coeff g);
        h = smult ilc g;
        (q,r) = pseudo_divmod f h
      in (smult ilc q, r))\<close>
  (is \<open>?l = ?r\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
proof (cases \<open>g = 0\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. g = 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
 2. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
g = 0

goal (2 subgoals):
 1. g = 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
 2. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g = 0

goal (1 subgoal):
 1. (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
g \<noteq> 0

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
define ilc where \<open>ilc = inverse (lead_coeff g)\<close>
[PROOF STATE]
proof (state)
this:
ilc = inverse (lead_coeff g)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
define h where \<open>h = smult ilc g\<close>
[PROOF STATE]
proof (state)
this:
h = smult ilc g

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
g \<noteq> 0
[PROOF STEP]
have \<open>lead_coeff h = 1\<close>
    and \<open>ilc \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
g \<noteq> 0

goal (1 subgoal):
 1. lead_coeff h = (1::'a) &&& ilc \<noteq> (0::'a)
[PROOF STEP]
by (auto simp: h_def ilc_def)
[PROOF STATE]
proof (state)
this:
lead_coeff h = (1::'a)
ilc \<noteq> (0::'a)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
define q r where \<open>q = f div h\<close> and \<open>r = f mod h\<close>
[PROOF STATE]
proof (state)
this:
q = f div h
r = f mod h

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
with \<open>lead_coeff h = 1\<close>
[PROOF STATE]
proof (chain)
picking this:
lead_coeff h = (1::'a)
q = f div h
r = f mod h
[PROOF STEP]
have p: \<open>pseudo_divmod f h = (q, r)\<close>
[PROOF STATE]
proof (prove)
using this:
lead_coeff h = (1::'a)
q = f div h
r = f mod h

goal (1 subgoal):
 1. pseudo_divmod f h = (q, r)
[PROOF STEP]
by (simp add: pseudo_divmod_eq_div_mod)
[PROOF STATE]
proof (state)
this:
pseudo_divmod f h = (q, r)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
from \<open>ilc \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
ilc \<noteq> (0::'a)
[PROOF STEP]
have \<open>(f div g, f mod g) = (smult ilc q, r)\<close>
[PROOF STATE]
proof (prove)
using this:
ilc \<noteq> (0::'a)

goal (1 subgoal):
 1. (f div g, f mod g) = (smult ilc q, r)
[PROOF STEP]
by (auto simp: h_def div_smult_right mod_smult_right q_def r_def)
[PROOF STATE]
proof (state)
this:
(f div g, f mod g) = (smult ilc q, r)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f div g, f mod g) = (smult ilc q, r)

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
have \<open>(smult ilc q, r) = ?r\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (smult ilc q, r) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
using \<open>g \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
g \<noteq> 0

goal (1 subgoal):
 1. (smult ilc q, r) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
by (auto simp: Let_def p simp flip: h_def ilc_def)
[PROOF STATE]
proof (state)
this:
(smult ilc q, r) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))

goal (1 subgoal):
 1. g \<noteq> 0 \<Longrightarrow> (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))

goal (1 subgoal):
 1. (f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f div g, f mod g) = (if g = 0 then (0, f) else let ilc = inverse (lead_coeff g); h = smult ilc g; (q, r) = pseudo_divmod f h in (smult ilc q, r))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma RepFun_hadd_cancel: "RepFun y (\<lambda>z. x @+ z) = RepFun z (\<lambda>z. x @+ z) \<longleftrightarrow> y=z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (RepFun y ((@+) x) = RepFun z ((@+) x)) = (y = z)
[PROOF STEP]
by (metis hadd hadd_cancel_right)


[STATEMENT]
lemma sum_sum_distl_fun:
  fixes f g :: "'a \<Rightarrow> 'b::dioid_one_zero"
  fixes h :: "'a \<Rightarrow> 'a set"
  assumes "\<And>x. finite (h x)"
  and "finite X"
  shows "\<Sum>((\<lambda>x. f x \<cdot> \<Sum>(g ` h x)) ` X) = \<Sum>{\<Sum> {f x \<cdot> g y |y. y \<in> h x} |x. x \<in> X}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f x \<cdot> \<Sum> (g ` h x)) ` X) = \<Sum> {\<Sum> {f x \<cdot> g y |y. y \<in> h x} |x. x \<in> X}
[PROOF STEP]
by (auto simp add: sum_fun_distl assms fset_to_im)


[STATEMENT]
lemma lsl_Inf_closed_var [simp]: "\<nu> (\<Sqinter>x \<in> X. \<nu> x) = (\<Sqinter>x \<in> X.  \<nu> (x::'a::unital_quantale))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu> (\<Sqinter> (\<nu> ` X)) = \<Sqinter> (\<nu> ` X)
[PROOF STEP]
by (metis (no_types, opaque_lifting) INF_image lsided_def3 lsu_Inf_pres lsu_lsl_prop_eq o_apply)


[STATEMENT]
lemma not_in_member[rule_format]: "member a b \<longrightarrow> x \<notin> dom (C b) \<longrightarrow> x \<notin> dom (C a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. member a b \<longrightarrow> x \<notin> dom (C b) \<longrightarrow> x \<notin> dom (C a)
[PROOF STEP]
by (induct b) (simp_all add: dom_def C.simps)


[STATEMENT]
lemma timestamps_zmset_of[simp]: "timestamps (zmset_of M) = zmset_of {# t. (p,t) \<in># M #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. timestamps (zmset_of M) = zmset_of {#t. (p, t) \<in># M#}
[PROOF STEP]
by (induct M) auto


[STATEMENT]
lemma dual_anti: "x \<le> y \<Longrightarrow> \<partial> y \<le> \<partial> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> \<partial> y \<le> \<partial> x
[PROOF STEP]
by (simp add: dual_inj less_eq_dual_def the_inv_f_f)


[STATEMENT]
lemma iexec_offset_aux:
 "(i :: int) + 1 - j = i - j + 1 \<and> i + j - k + 1 = i - k + j + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i + 1 - j = i - j + 1 \<and> i + j - k + 1 = i - k + j + 1
[PROOF STEP]
by simp


[STATEMENT]
lemma pickT_pred_pickT_unique:
assumes P: "\<And> n. n < length cl \<Longrightarrow> part {..< brn (cl!n)} (P n) \<and> {} \<notin> P n"
and "pickT_pred cl P II n"
shows "n = pickT cl P II"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = pickT cl P II
[PROOF STEP]
unfolding pickT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = (SOME n. pickT_pred cl P II n)
[PROOF STEP]
apply(rule sym, rule some_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. pickT_pred cl P II n
 2. \<And>na. pickT_pred cl P II na \<Longrightarrow> na = n
[PROOF STEP]
using assms pickT_pred_unique[of cl P II]
[PROOF STATE]
proof (prove)
using this:
?n1 < length cl \<Longrightarrow> part {..<brn (cl ! ?n1)} (P ?n1) \<and> {} \<notin> P ?n1
pickT_pred cl P II n
\<lbrakk>\<And>n. n < length cl \<Longrightarrow> part {..<brn (cl ! n)} (P n) \<and> {} \<notin> P n; pickT_pred cl P II ?n1.0; pickT_pred cl P II ?n2.0\<rbrakk> \<Longrightarrow> ?n1.0 = ?n2.0

goal (2 subgoals):
 1. pickT_pred cl P II n
 2. \<And>na. pickT_pred cl P II na \<Longrightarrow> na = n
[PROOF STEP]
by auto


[STATEMENT]
lemma rfb_inj_iff: "(fb\<^sub>\<R> R = fb\<^sub>\<R> S) = (R = S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fb\<^sub>\<R> R = fb\<^sub>\<R> S) = (R = S)
[PROOF STEP]
by (simp add: rfb_inj inj_eq)


[STATEMENT]
lemma singular_chain_empty:
   "topspace X = {} \<Longrightarrow> singular_chain p X c \<longleftrightarrow> c = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace X = {} \<Longrightarrow> singular_chain p X c = (c = 0)
[PROOF STEP]
by (auto simp: singular_chain_def singular_simplex_empty subset_eq poly_mapping_eqI)


[STATEMENT]
lemma d_IN_cmult: "d_IN (\<lambda>e. c * f e) x = c * d_IN f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>e. c * f e) x = c * d_IN f x
[PROOF STEP]
by(simp add: d_IN_def nn_integral_cmult)


[STATEMENT]
theorem (in field) interpolating_polynomials_card:
  assumes "finite K"
  assumes "K \<subseteq> carrier R"
  assumes "f ` K \<subseteq> carrier R"
  shows "card {\<omega> \<in> bounded_degree_polynomials R (card K + n). (\<forall>k \<in> K. eval \<omega> k = f k)} = card (carrier R)^n"
    (is "card ?A = ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
define z where "z = restrict f K"
[PROOF STATE]
proof (state)
this:
z = restrict f K

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
define M where "M = {f. range f \<subseteq> carrier R \<and> (\<forall>k \<ge> n. f k = \<zero>)}"
[PROOF STATE]
proof (state)
this:
M = {f. range f \<subseteq> carrier R \<and> (\<forall>k\<ge>n. f k = \<zero>)}

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
hence inj_on_bounded: "inj_on (split_poly K) (carrier (poly_ring R))"
[PROOF STATE]
proof (prove)
using this:
M = {f. range f \<subseteq> carrier R \<and> (\<forall>k\<ge>n. f k = \<zero>)}

goal (1 subgoal):
 1. inj_on (split_poly K) (carrier (poly_ring R))
[PROOF STEP]
using split_poly_inj[OF assms(1) assms(2)]
[PROOF STATE]
proof (prove)
using this:
M = {f. range f \<subseteq> carrier R \<and> (\<forall>k\<ge>n. f k = \<zero>)}
inj_on (split_poly K) (carrier (poly_ring R))

goal (1 subgoal):
 1. inj_on (split_poly K) (carrier (poly_ring R))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on (split_poly K) (carrier (poly_ring R))

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "?A \<subseteq> split_poly K -` ({z} \<times> M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M)
[PROOF STEP]
unfolding split_poly_def z_def M_def bounded_degree_polynomials_length
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<omega> \<in> {x \<in> carrier (poly_ring R). length x \<le> card K + n}. \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> (\<lambda>p. (restrict (local.eval p) K, \<lambda>k. local.coeff p (k + card K))) -` ({restrict f K} \<times> {f. range f \<subseteq> carrier R \<and> (\<forall>k\<ge>n. f k = \<zero>)})
[PROOF STEP]
by (rule subsetI, auto intro!:coeff_in_carrier coeff_length)
[PROOF STATE]
proof (state)
this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "?A \<subseteq> carrier (poly_ring R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> carrier (poly_ring R)
[PROOF STEP]
unfolding bounded_degree_polynomials_length
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<omega> \<in> {x \<in> carrier (poly_ring R). length x \<le> card K + n}. \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> carrier (poly_ring R)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> carrier (poly_ring R)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M)
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> carrier (poly_ring R)
[PROOF STEP]
have a:"?A \<subseteq> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)"
[PROOF STATE]
proof (prove)
using this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M)
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> carrier (poly_ring R)

goal (1 subgoal):
 1. {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} \<subseteq> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "\<And>x k . (\<lambda>k. coeff x (k + card K)) \<in> M \<Longrightarrow> k \<ge> n + card K \<Longrightarrow> coeff x k = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x k. \<lbrakk>(\<lambda>k. local.coeff x (k + card K)) \<in> M; n + card K \<le> k\<rbrakk> \<Longrightarrow> local.coeff x k = \<zero>
[PROOF STEP]
by (simp add:M_def, metis Nat.le_diff_conv2 Nat.le_imp_diff_is_add add_leD2)
[PROOF STATE]
proof (state)
this:
\<lbrakk>(\<lambda>k. local.coeff ?x (k + card K)) \<in> M; n + card K \<le> ?k\<rbrakk> \<Longrightarrow> local.coeff ?x ?k = \<zero>

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
hence "split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>k. local.coeff ?x (k + card K)) \<in> M; n + card K \<le> ?k\<rbrakk> \<Longrightarrow> local.coeff ?x ?k = \<zero>

goal (1 subgoal):
 1. split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)
[PROOF STEP]
unfolding split_poly_def z_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>k. local.coeff ?x (k + card K)) \<in> M; n + card K \<le> ?k\<rbrakk> \<Longrightarrow> local.coeff ?x ?k = \<zero>

goal (1 subgoal):
 1. (\<lambda>p. (restrict (local.eval p) K, \<lambda>k. local.coeff p (k + card K))) -` ({restrict f K} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)
[PROOF STEP]
using poly_degree_bound_from_coeff_1 inv_subsetI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>k. local.coeff ?x (k + card K)) \<in> M; n + card K \<le> ?k\<rbrakk> \<Longrightarrow> local.coeff ?x ?k = \<zero>
\<lbrakk>?x \<in> carrier (poly_ring R); \<And>k. ?n \<le> k \<Longrightarrow> local.coeff ?x k = \<zero>\<rbrakk> \<Longrightarrow> ?x \<in> bounded_degree_polynomials R ?n
(\<And>x. \<lbrakk>x \<in> ?A; ?f x \<in> ?B\<rbrakk> \<Longrightarrow> x \<in> ?C) \<Longrightarrow> ?f -` ?B \<inter> ?A \<subseteq> ?C

goal (1 subgoal):
 1. (\<lambda>p. (restrict (local.eval p) K, \<lambda>k. local.coeff p (k + card K))) -` ({restrict f K} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "\<And>\<omega> k. \<omega> \<in> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<Longrightarrow> k \<in> K \<Longrightarrow> eval \<omega> k = f k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<omega> k. \<lbrakk>\<omega> \<in> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R); k \<in> K\<rbrakk> \<Longrightarrow> local.eval \<omega> k = f k
[PROOF STEP]
unfolding split_poly_def z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<omega> k. \<lbrakk>\<omega> \<in> (\<lambda>p. (restrict (local.eval p) K, \<lambda>k. local.coeff p (k + card K))) -` ({restrict f K} \<times> M) \<inter> carrier (poly_ring R); k \<in> K\<rbrakk> \<Longrightarrow> local.eval \<omega> k = f k
[PROOF STEP]
using restrict_eq_imp
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>restrict ?f ?A = restrict ?g ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> ?f ?x = ?g ?x

goal (1 subgoal):
 1. \<And>\<omega> k. \<lbrakk>\<omega> \<in> (\<lambda>p. (restrict (local.eval p) K, \<lambda>k. local.coeff p (k + card K))) -` ({restrict f K} \<times> M) \<inter> carrier (poly_ring R); k \<in> K\<rbrakk> \<Longrightarrow> local.eval \<omega> k = f k
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<lbrakk>?\<omega> \<in> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R); ?k \<in> K\<rbrakk> \<Longrightarrow> local.eval ?\<omega> ?k = f ?k

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)
\<lbrakk>?\<omega> \<in> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R); ?k \<in> K\<rbrakk> \<Longrightarrow> local.eval ?\<omega> ?k = f ?k
[PROOF STEP]
have b:"split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> ?A"
[PROOF STATE]
proof (prove)
using this:
split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> bounded_degree_polynomials R (card K + n)
\<lbrakk>?\<omega> \<in> split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R); ?k \<in> K\<rbrakk> \<Longrightarrow> local.eval ?\<omega> ?k = f ?k

goal (1 subgoal):
 1. split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R) \<subseteq> {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k}

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "z \<in> K \<rightarrow>\<^sub>E carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> K \<rightarrow>\<^sub>E carrier R
[PROOF STEP]
unfolding z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict f K \<in> K \<rightarrow>\<^sub>E carrier R
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
f ` K \<subseteq> carrier R

goal (1 subgoal):
 1. restrict f K \<in> K \<rightarrow>\<^sub>E carrier R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<in> K \<rightarrow>\<^sub>E carrier R

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<in> K \<rightarrow>\<^sub>E carrier R

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. (\<forall>k \<ge> n. f k = \<zero>))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. range f \<subseteq> carrier R \<and> (\<forall>k\<ge>n. f k = \<zero>)} \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<in> K \<rightarrow>\<^sub>E carrier R
M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}
[PROOF STEP]
have c:"{z} \<times> M \<subseteq> split_poly K ` carrier (poly_ring R)"
[PROOF STATE]
proof (prove)
using this:
z \<in> K \<rightarrow>\<^sub>E carrier R
M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}

goal (1 subgoal):
 1. {z} \<times> M \<subseteq> split_poly K ` carrier (poly_ring R)
[PROOF STEP]
using split_poly_image[OF assms(1) assms(2)]
[PROOF STATE]
proof (prove)
using this:
z \<in> K \<rightarrow>\<^sub>E carrier R
M \<subseteq> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)}
(K \<rightarrow>\<^sub>E carrier R) \<times> {f. range f \<subseteq> carrier R \<and> (\<exists>n. \<forall>k\<ge>n. f k = \<zero>)} \<subseteq> split_poly K ` carrier (poly_ring R)

goal (1 subgoal):
 1. {z} \<times> M \<subseteq> split_poly K ` carrier (poly_ring R)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
{z} \<times> M \<subseteq> split_poly K ` carrier (poly_ring R)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "card ?A = card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R))
[PROOF STEP]
using order_antisym[OF a b]
[PROOF STATE]
proof (prove)
using this:
{\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R))

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R))

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "... = card ({z} \<times> M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)) = card ({z} \<times> M)
[PROOF STEP]
using card_vimage_inj_on[OF inj_on_bounded] c
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> split_poly K ` carrier (poly_ring R) \<Longrightarrow> card (split_poly K -` ?A \<inter> carrier (poly_ring R)) = card ?A
{z} \<times> M \<subseteq> split_poly K ` carrier (poly_ring R)

goal (1 subgoal):
 1. card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)) = card ({z} \<times> M)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)) = card ({z} \<times> M)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (split_poly K -` ({z} \<times> M) \<inter> carrier (poly_ring R)) = card ({z} \<times> M)

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
have "... = card (carrier R)^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({z} \<times> M) = card (carrier R) ^ n
[PROOF STEP]
by (simp add:card_cartesian_product M_def card_mostly_constant_maps)
[PROOF STATE]
proof (state)
this:
card ({z} \<times> M) = card (carrier R) ^ n

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {\<omega> \<in> bounded_degree_polynomials R (card K + n). \<forall>k\<in>K. local.eval \<omega> k = f k} = card (carrier R) ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ideal_implies_subset:
  assumes "ideal A R add mult zero unit"
  shows "A \<subseteq> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> R
[PROOF STEP]
by (meson assms ideal_def subgroup_def subgroup_of_additive_group_of_ring_def submonoid_axioms_def submonoid_def)


[STATEMENT]
lemma term_is_le_rel_minus:
  assumes "ord_term_lin.is_le_rel rel" and "s adds t"
  shows "rel ((t - s) \<oplus> u) v \<longleftrightarrow> rel (t \<oplus> u) (s \<oplus> v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
s adds t
[PROOF STEP]
have eq: "s + (t - s) = t"
[PROOF STATE]
proof (prove)
using this:
s adds t

goal (1 subgoal):
 1. s + (t - s) = t
[PROOF STEP]
unfolding add.commute[of s]
[PROOF STATE]
proof (prove)
using this:
s adds t

goal (1 subgoal):
 1. t - s + s = t
[PROOF STEP]
by (rule adds_minus)
[PROOF STATE]
proof (state)
this:
s + (t - s) = t

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
ord_term_lin.is_le_rel rel
[PROOF STEP]
have "rel ((t - s) \<oplus> u) v = rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v)"
[PROOF STATE]
proof (prove)
using this:
ord_term_lin.is_le_rel rel

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v)
[PROOF STEP]
by (simp only: term_is_le_rel_canc_left)
[PROOF STATE]
proof (state)
this:
rel ((t - s) \<oplus> u) v = rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v)

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rel ((t - s) \<oplus> u) v = rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v)

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
have "... = rel (t \<oplus> u) (s \<oplus> v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v) = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
by (simp only: splus_assoc[symmetric] eq)
[PROOF STATE]
proof (state)
this:
rel (s \<oplus> ((t - s) \<oplus> u)) (s \<oplus> v) = rel (t \<oplus> u) (s \<oplus> v)

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)

goal (1 subgoal):
 1. rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rel ((t - s) \<oplus> u) v = rel (t \<oplus> u) (s \<oplus> v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ennsqrt_tendsto [tendsto_intros]:
  assumes "((\<lambda>n. u n) \<longlongrightarrow> l) F"
  shows "((\<lambda>n. ennsqrt(u n)) \<longlongrightarrow> ennsqrt l) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>n. ennsqrt (u n)) \<longlongrightarrow> ennsqrt l) F
[PROOF STEP]
using ennsqrt_continuous assms
[PROOF STATE]
proof (prove)
using this:
continuous_on UNIV ennsqrt
(u \<longlongrightarrow> l) F

goal (1 subgoal):
 1. ((\<lambda>n. ennsqrt (u n)) \<longlongrightarrow> ennsqrt l) F
[PROOF STEP]
by (metis UNIV_I continuous_on tendsto_compose)


[STATEMENT]
lemma lcoset_0: "(w::'a::monoid_add) +o 0 = {w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w +o 0 = {w}
[PROOF STEP]
using elt_set_plus_def[of w]
[PROOF STATE]
proof (prove)
using this:
w +o ?B = {c. \<exists>b\<in>?B. c = w + b}

goal (1 subgoal):
 1. w +o 0 = {w}
[PROOF STEP]
by simp


[STATEMENT]
lemma gmft_correct: "is_measured_ftree t
  \<Longrightarrow> (gmft t) = sum_list (map snd (toList t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_measured_ftree t \<Longrightarrow> gmft t = sum_list (map snd (toList t))
[PROOF STEP]
by (induct t, auto simp add: ft_invar_def gmd_correct gmn_correct add.assoc)


[STATEMENT]
lemma vec_set_append_vec[simp]: "vec_set (v @\<^sub>v w) = vec_set v \<union> vec_set w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set\<^sub>v (v @\<^sub>v w) = set\<^sub>v v \<union> set\<^sub>v w
[PROOF STEP]
by (metis list_of_vec_append set_append set_list_of_vec)


[STATEMENT]
lemma path_polynomial_function:
    fixes g  :: "real \<Rightarrow> 'b::euclidean_space"
    shows "polynomial_function g \<Longrightarrow> path g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polynomial_function g \<Longrightarrow> path g
[PROOF STEP]
by (simp add: path_def continuous_on_polymonial_function)


[STATEMENT]
lemma expands_to_insert_ln:
  assumes "basis_wf [b]"
  shows   "((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1::real,1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
basis_wf [b]
[PROOF STEP]
have b_limit: "filterlim b at_top at_top"
[PROOF STATE]
proof (prove)
using this:
basis_wf [b]

goal (1 subgoal):
 1. filterlim b at_top at_top
[PROOF STEP]
by (simp add: basis_wf_Cons)
[PROOF STATE]
proof (state)
this:
filterlim b at_top at_top

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
hence b: "eventually (\<lambda>x. b x > 1) at_top"
[PROOF STATE]
proof (prove)
using this:
filterlim b at_top at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 < b x
[PROOF STEP]
by (simp add: filterlim_at_top_dense)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 1 < b x

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
have "(\<lambda>x::real. x) \<in> \<Theta>(\<lambda>x. x powr 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x) \<in> \<Theta>(\<lambda>x. x powr 1)
[PROOF STEP]
by (intro bigthetaI_cong eventually_mono[OF eventually_gt_at_top[of 0]]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x) \<in> \<Theta>(\<lambda>x. x powr 1)

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x) \<in> \<Theta>(\<lambda>x. x powr 1)

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
have "(\<lambda>x::real. x powr 1) \<in> o(\<lambda>a. a powr e)" if "e > 1" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x powr 1) \<in> o(\<lambda>a. a powr e)
[PROOF STEP]
by (subst powr_smallo_iff) (auto simp: that filterlim_ident)
[PROOF STATE]
proof (state)
this:
1 < ?e \<Longrightarrow> (\<lambda>x. x powr 1) \<in> o(\<lambda>a. a powr ?e)

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 < ?e1 \<Longrightarrow> (\<lambda>x. x) \<in> o(\<lambda>a. a powr ?e1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < ?e1 \<Longrightarrow> (\<lambda>x. x) \<in> o(\<lambda>a. a powr ?e1)

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
using b assms
[PROOF STATE]
proof (prove)
using this:
1 < ?e1 \<Longrightarrow> (\<lambda>x. x) \<in> o(\<lambda>a. a powr ?e1)
\<forall>\<^sub>F x in at_top. 1 < b x
basis_wf [b]

goal (1 subgoal):
 1. ((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]
[PROOF STEP]
by (auto intro!: is_expansion_aux.intros landau_o.small.compose[of _ at_top _ "\<lambda>x. ln (b x)"]
                     filterlim_compose[OF ln_at_top b_limit] is_expansion_real.intros
             elim!: eventually_mono simp: expands_to.simps)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. ln (b x)) expands_to MS (MSLCons (1, 1) MSLNil) (\<lambda>x. ln (b x))) [\<lambda>x. ln (b x)]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma canon_ang_eq:
  assumes "\<exists> k::int. \<alpha>\<^sub>1 - \<alpha>\<^sub>2 = 2*k*pi"
  shows "\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
obtain k'::int where *: "- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>" "\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi" "\<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = 2 * k' * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k'. \<lbrakk>- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>; \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi; \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = real_of_int (2 * k') * pi\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using canon_ang[of \<alpha>\<^sub>1]
[PROOF STATE]
proof (prove)
using this:
- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi
\<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = 2 * real_of_int x * pi

goal (1 subgoal):
 1. (\<And>k'. \<lbrakk>- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>; \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi; \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = real_of_int (2 * k') * pi\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi
\<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = real_of_int (2 * k') * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
obtain k''::int where **: "- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>" "\<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi" "\<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * k'' * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k''. \<lbrakk>- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>; \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi; \<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = real_of_int (2 * k'') * pi\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using canon_ang[of \<alpha>\<^sub>2]
[PROOF STATE]
proof (prove)
using this:
- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi
\<exists>x. \<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi

goal (1 subgoal):
 1. (\<And>k''. \<lbrakk>- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>; \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi; \<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = real_of_int (2 * k'') * pi\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi
\<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = real_of_int (2 * k'') * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
obtain k::int where ***: "\<alpha>\<^sub>1 - \<alpha>\<^sub>2 = 2*k*pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. \<alpha>\<^sub>1 - \<alpha>\<^sub>2 = real_of_int (2 * k) * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<exists>x. \<alpha>\<^sub>1 - \<alpha>\<^sub>2 = 2 * real_of_int x * pi

goal (1 subgoal):
 1. (\<And>k. \<alpha>\<^sub>1 - \<alpha>\<^sub>2 = real_of_int (2 * k) * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha>\<^sub>1 - \<alpha>\<^sub>2 = real_of_int (2 * k) * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
have "\<exists>m::int. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * m * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi
[PROOF STEP]
using **(3) ***
[PROOF STATE]
proof (prove)
using this:
\<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = real_of_int (2 * k'') * pi
\<alpha>\<^sub>1 - \<alpha>\<^sub>2 = real_of_int (2 * k) * pi

goal (1 subgoal):
 1. \<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi
[PROOF STEP]
by (rule_tac x="k+k''" in exI) (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
using canon_ang_unique[of "\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>" \<alpha>\<^sub>1 "\<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>"] * **
[PROOF STATE]
proof (prove)
using this:
\<exists>x. \<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = 2 * real_of_int x * pi
\<lbrakk>canon_ang_P \<alpha>\<^sub>1 \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>; canon_ang_P \<alpha>\<^sub>1 \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>\<rbrakk> \<Longrightarrow> \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
- pi < \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> \<le> pi
\<alpha>\<^sub>1 - \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = real_of_int (2 * k') * pi
- pi < \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
\<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> \<le> pi
\<alpha>\<^sub>2 - \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft> = real_of_int (2 * k'') * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<downharpoonright>\<alpha>\<^sub>1\<downharpoonleft> = \<downharpoonright>\<alpha>\<^sub>2\<downharpoonleft>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_set_image_conv_nth: "f x \<in> f`set l \<longleftrightarrow> (\<exists>i<length l. f (l!i) = f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f x \<in> f ` set l) = (\<exists>i<length l. f (l ! i) = f x)
[PROOF STEP]
by (auto simp: in_set_conv_nth) (metis image_eqI nth_mem)


[STATEMENT]
lemma offset_hmset_of_nat[simp]: "offset_hmset (of_nat n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. offset_hmset (of_nat n) = n
[PROOF STEP]
unfolding offset_hmset_def of_nat_hmset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (hmsetmset (HMSet (replicate_mset n 0))) 0 = n
[PROOF STEP]
by simp


[STATEMENT]
lemma inner_divide_left:
  fixes a :: "'a :: {real_inner,real_div_algebra}"
  shows "inner (a / of_real m) b = (inner a b) / m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner (a / of_real m) b = inner a b / m
[PROOF STEP]
by (metis (no_types) divide_inverse inner_commute inner_scaleR_right mult.left_neutral mult.right_neutral mult_scaleR_right of_real_inverse scaleR_conv_of_real times_divide_eq_left)


[STATEMENT]
lemma to_nat_less_card:
  fixes j::"'a"
  shows "to_nat j < CARD ('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat j < CARD('a)
[PROOF STEP]
using bij_to_nat
[PROOF STATE]
proof (prove)
using this:
bij_betw mod_type_class.to_nat UNIV {0..<CARD('a)}

goal (1 subgoal):
 1. mod_type_class.to_nat j < CARD('a)
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj mod_type_class.to_nat \<and> range mod_type_class.to_nat = {0..<CARD('a)}

goal (1 subgoal):
 1. mod_type_class.to_nat j < CARD('a)
[PROOF STEP]
by auto