[STATEMENT]
lemma jumpF_polyL_smult_1:
  "jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
proof (cases "c=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
 2. c \<noteq> 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
c = 0

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
 2. c \<noteq> 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c = 0

goal (1 subgoal):
 1. jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> 0

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
unfolding jumpF_polyL_def
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly (smult c q) x / poly p x) (at_left x) = sgn c * jumpF (\<lambda>x. poly q x / poly p x) (at_left x)
[PROOF STEP]
apply (subst jumpF_times[of "\<lambda>_. c",symmetric])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. c \<noteq> 0 \<Longrightarrow> ((\<lambda>_. c) \<longlongrightarrow> c) (at_left x)
 2. c \<noteq> 0 \<Longrightarrow> c \<noteq> 0
 3. c \<noteq> 0 \<Longrightarrow> at_left x \<noteq> bot
 4. c \<noteq> 0 \<Longrightarrow> jumpF (\<lambda>x. poly (smult c q) x / poly p x) (at_left x) = jumpF (\<lambda>x. c * (poly q x / poly p x)) (at_left x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sup_image_mono_le:
  fixes le_b (infix "\<sqsubseteq>" 60) and Sup_b ("\<Or>")
  assumes ccpo: "class.ccpo Sup_b (\<sqsubseteq>) lt_b"
  assumes chain: "Complete_Partial_Order.chain (\<sqsubseteq>) Y"
  and mono: "\<And>x y. \<lbrakk> x \<sqsubseteq> y; x \<in> Y \<rbrakk> \<Longrightarrow> f x \<le> f y"
  shows "Sup (f ` Y) \<le> f (\<Or>Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> (f ` Y) \<le> f (\<Or> Y)
[PROOF STEP]
proof(rule ccpo_Sup_least)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Complete_Partial_Order.chain (\<le>) (f ` Y)
 2. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
show "Complete_Partial_Order.chain (\<le>) (f ` Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complete_Partial_Order.chain (\<le>) (f ` Y)
[PROOF STEP]
using chain
[PROOF STATE]
proof (prove)
using this:
Complete_Partial_Order.chain (\<sqsubseteq>) Y

goal (1 subgoal):
 1. Complete_Partial_Order.chain (\<le>) (f ` Y)
[PROOF STEP]
by(rule chain_imageI)(rule mono)
[PROOF STATE]
proof (state)
this:
Complete_Partial_Order.chain (\<le>) (f ` Y)

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
assume "x \<in> f ` Y"
[PROOF STATE]
proof (state)
this:
x \<in> f ` Y

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> f ` Y
[PROOF STEP]
obtain y where "y \<in> Y" and "x = f y"
[PROOF STATE]
proof (prove)
using this:
x \<in> f ` Y

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

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
note this(2)
[PROOF STATE]
proof (state)
this:
x = f y

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = f y

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
have "y \<sqsubseteq> \<Or>Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqsubseteq> \<Or> Y
[PROOF STEP]
using ccpo chain \<open>y \<in> Y\<close>
[PROOF STATE]
proof (prove)
using this:
class.ccpo \<Or> (\<sqsubseteq>) lt_b
Complete_Partial_Order.chain (\<sqsubseteq>) Y
y \<in> Y

goal (1 subgoal):
 1. y \<sqsubseteq> \<Or> Y
[PROOF STEP]
by(rule ccpo.ccpo_Sup_upper)
[PROOF STATE]
proof (state)
this:
y \<sqsubseteq> \<Or> Y

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
hence "f y \<le> f (\<Or>Y)"
[PROOF STATE]
proof (prove)
using this:
y \<sqsubseteq> \<Or> Y

goal (1 subgoal):
 1. f y \<le> f (\<Or> Y)
[PROOF STEP]
using \<open>y \<in> Y\<close>
[PROOF STATE]
proof (prove)
using this:
y \<sqsubseteq> \<Or> Y
y \<in> Y

goal (1 subgoal):
 1. f y \<le> f (\<Or> Y)
[PROOF STEP]
by(rule mono)
[PROOF STATE]
proof (state)
this:
f y \<le> f (\<Or> Y)

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<le> f (\<Or> Y)
[PROOF STEP]
show "x \<le> \<dots>"
[PROOF STATE]
proof (prove)
using this:
x \<le> f (\<Or> Y)

goal (1 subgoal):
 1. x \<le> f (\<Or> Y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<le> f (\<Or> Y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma q64_infinite_def: "q64 = (\<lambda>k. k\<^sup>2 mod 64) ` {0..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q64 = (\<lambda>k. k\<^sup>2 mod 64) ` {0..}
[PROOF STEP]
unfolding q64_upto_def image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>x\<in>{..<64}. y = x\<^sup>2 mod 64} = {y. \<exists>x\<in>{0..}. y = x\<^sup>2 mod 64}
[PROOF STEP]
proof (auto, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. \<exists>x\<in>{..<64}. xa\<^sup>2 mod 64 = x\<^sup>2 mod 64
[PROOF STEP]
case (1 xa)
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>xa. \<exists>x\<in>{..<64}. xa\<^sup>2 mod 64 = x\<^sup>2 mod 64
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>{..<64}. xa\<^sup>2 mod 64 = x\<^sup>2 mod 64
[PROOF STEP]
using square_mod_lower[of 64 xa "xa\<^sup>2 mod 64"]
      ex_nat_less_eq[of 64 "\<lambda>x. xa\<^sup>2 mod 64 = x\<^sup>2 mod 64"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 64; xa\<^sup>2 mod 64 = xa\<^sup>2 mod 64\<rbrakk> \<Longrightarrow> \<exists>q'<64. q'\<^sup>2 mod 64 = xa\<^sup>2 mod 64
(\<exists>m<64. xa\<^sup>2 mod 64 = m\<^sup>2 mod 64) = (\<exists>m\<in>{0..<64}. xa\<^sup>2 mod 64 = m\<^sup>2 mod 64)

goal (1 subgoal):
 1. \<exists>x\<in>{..<64}. xa\<^sup>2 mod 64 = x\<^sup>2 mod 64
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>{..<64}. xa\<^sup>2 mod 64 = x\<^sup>2 mod 64

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma acyclic_trancl_rtrancl:
  assumes acyclic: "acyclic r"
  shows "(x,y) \<in> r\<^sup>+ = ((x,y) \<in> r\<^sup>* \<and> x\<noteq>y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> r\<^sup>+) = ((x, y) \<in> r\<^sup>* \<and> x \<noteq> y)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (x, y) \<in> r\<^sup>+ \<Longrightarrow> (x, y) \<in> r\<^sup>* \<and> x \<noteq> y
 2. (x, y) \<in> r\<^sup>* \<and> x \<noteq> y \<Longrightarrow> (x, y) \<in> r\<^sup>+
[PROOF STEP]
assume x_y_trancl: "(x,y) \<in> r\<^sup>+"
[PROOF STATE]
proof (state)
this:
(x, y) \<in> r\<^sup>+

goal (2 subgoals):
 1. (x, y) \<in> r\<^sup>+ \<Longrightarrow> (x, y) \<in> r\<^sup>* \<and> x \<noteq> y
 2. (x, y) \<in> r\<^sup>* \<and> x \<noteq> y \<Longrightarrow> (x, y) \<in> r\<^sup>+
[PROOF STEP]
show "(x,y) \<in> r\<^sup>* \<and> x\<noteq>y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<in> r\<^sup>* \<and> x \<noteq> y
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (x, y) \<in> r\<^sup>*
 2. x \<noteq> y
[PROOF STEP]
from x_y_trancl
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> r\<^sup>+
[PROOF STEP]
show "(x,y) \<in> r\<^sup>*"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> r\<^sup>+

goal (1 subgoal):
 1. (x, y) \<in> r\<^sup>*
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(x, y) \<in> r\<^sup>*

goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
from x_y_trancl acyclic
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> r\<^sup>+
acyclic r
[PROOF STEP]
show "x\<noteq>y"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> r\<^sup>+
acyclic r

goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
by (auto simp add: acyclic_def)
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(x, y) \<in> r\<^sup>* \<and> x \<noteq> y

goal (1 subgoal):
 1. (x, y) \<in> r\<^sup>* \<and> x \<noteq> y \<Longrightarrow> (x, y) \<in> r\<^sup>+
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x, y) \<in> r\<^sup>* \<and> x \<noteq> y \<Longrightarrow> (x, y) \<in> r\<^sup>+
[PROOF STEP]
assume "(x,y) \<in> r\<^sup>* \<and> x\<noteq>y"
[PROOF STATE]
proof (state)
this:
(x, y) \<in> r\<^sup>* \<and> x \<noteq> y

goal (1 subgoal):
 1. (x, y) \<in> r\<^sup>* \<and> x \<noteq> y \<Longrightarrow> (x, y) \<in> r\<^sup>+
[PROOF STEP]
thus "(x,y) \<in> r\<^sup>+"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> r\<^sup>* \<and> x \<noteq> y

goal (1 subgoal):
 1. (x, y) \<in> r\<^sup>+
[PROOF STEP]
by (auto intro: distinct_rtrancl_into_trancl)
[PROOF STATE]
proof (state)
this:
(x, y) \<in> r\<^sup>+

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vsubset_contraD:
  assumes "A \<subseteq>\<^sub>\<circ> B" and "c \<notin>\<^sub>\<circ> B"
  shows "c \<notin>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<notin>\<^sub>\<circ> A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq>\<^sub>\<circ> B
c \<notin>\<^sub>\<circ> B

goal (1 subgoal):
 1. c \<notin>\<^sub>\<circ> A
[PROOF STEP]
by auto


[STATEMENT]
lemma fps_X_power_unit_factor: "unit_factor (fps_X ^ n) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor (fps_X ^ n) = 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unit_factor (fps_X ^ n) = 1
[PROOF STEP]
define X :: "'a fps" where "X \<equiv> fps_X"
[PROOF STATE]
proof (state)
this:
X \<equiv> fps_X

goal (1 subgoal):
 1. unit_factor (fps_X ^ n) = 1
[PROOF STEP]
hence "unit_factor (X^n) = fps_shift n (X^n)"
[PROOF STATE]
proof (prove)
using this:
X \<equiv> fps_X

goal (1 subgoal):
 1. unit_factor (X ^ n) = fps_shift n (X ^ n)
[PROOF STEP]
by (simp add: fps_X_power_subdegree)
[PROOF STATE]
proof (state)
this:
unit_factor (X ^ n) = fps_shift n (X ^ n)

goal (1 subgoal):
 1. unit_factor (fps_X ^ n) = 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
unit_factor (X ^ n) = fps_shift n (X ^ n)

goal (1 subgoal):
 1. unit_factor (fps_X ^ n) = 1
[PROOF STEP]
have "fps_shift n (X^n) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_shift n (X ^ n) = 1
[PROOF STEP]
by (auto intro: fps_ext simp: fps_X_power_iff X_def)
[PROOF STATE]
proof (state)
this:
fps_shift n (X ^ n) = 1

goal (1 subgoal):
 1. unit_factor (fps_X ^ n) = 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
unit_factor (X ^ n) = fps_shift n (X ^ n)
fps_shift n (X ^ n) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
unit_factor (X ^ n) = fps_shift n (X ^ n)
fps_shift n (X ^ n) = 1

goal (1 subgoal):
 1. unit_factor (fps_X ^ n) = 1
[PROOF STEP]
by (simp add: X_def)
[PROOF STATE]
proof (state)
this:
unit_factor (fps_X ^ n) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in vectorspace) subspace_dim:
assumes "subspace K X V" "fin_dim" "vectorspace.fin_dim K (vs X)"
shows "vectorspace.dim K (vs X) \<le> dim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace.dim K (vs X) \<le> local.dim
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vectorspace.dim K (vs X) \<le> local.dim
[PROOF STEP]
have "vectorspace K (vs X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace K (vs X)
[PROOF STEP]
using assms(1) subspace_is_vs
[PROOF STATE]
proof (prove)
using this:
subspace K X V
subspace K ?W V \<Longrightarrow> vectorspace K (vs ?W)

goal (1 subgoal):
 1. vectorspace K (vs X)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vectorspace K (vs X)

goal (1 subgoal):
 1. vectorspace.dim K (vs X) \<le> local.dim
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vectorspace K (vs X)
[PROOF STEP]
obtain b where "vectorspace.basis K (vs X) b"
[PROOF STATE]
proof (prove)
using this:
vectorspace K (vs X)

goal (1 subgoal):
 1. (\<And>b. vectorspace.basis K (vs X) b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using vectorspace.finite_basis_exists
[PROOF STATE]
proof (prove)
using this:
vectorspace K (vs X)
\<lbrakk>vectorspace ?K ?V; vectorspace.fin_dim ?K ?V\<rbrakk> \<Longrightarrow> \<exists>\<beta>. finite \<beta> \<and> vectorspace.basis ?K ?V \<beta>

goal (1 subgoal):
 1. (\<And>b. vectorspace.basis K (vs X) b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
vectorspace K (vs X)
\<lbrakk>vectorspace ?K ?V; vectorspace.fin_dim ?K ?V\<rbrakk> \<Longrightarrow> \<exists>\<beta>. finite \<beta> \<and> vectorspace.basis ?K ?V \<beta>
vectorspace.fin_dim K (vs X)

goal (1 subgoal):
 1. (\<And>b. vectorspace.basis K (vs X) b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vectorspace.basis K (vs X) b

goal (1 subgoal):
 1. vectorspace.dim K (vs X) \<le> local.dim
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vectorspace.basis K (vs X) b
[PROOF STEP]
have "b \<subseteq> carrier V" "LinearCombinations.module.lin_indpt K (vs X) b"
[PROOF STATE]
proof (prove)
using this:
vectorspace.basis K (vs X) b

goal (1 subgoal):
 1. b \<subseteq> carrier V &&& \<not> LinearCombinations.module.lin_dep K (vs X) b
[PROOF STEP]
using vectorspace.basis_def[OF \<open>vectorspace K (vs X)\<close>] \<open>subspace K X V\<close>[unfolded subspace_def submodule_def]
[PROOF STATE]
proof (prove)
using this:
vectorspace.basis K (vs X) b
vectorspace.basis K (vs X) ?A = (\<not> LinearCombinations.module.lin_dep K (vs X) ?A \<and> LinearCombinations.module.span K (vs X) ?A = carrier (vs X) \<and> ?A \<subseteq> carrier (vs X))
vectorspace K V \<and> (module K V \<and> X \<subseteq> carrier V) \<and> (\<forall>v w. v \<in> X \<longrightarrow> w \<in> X \<longrightarrow> v \<oplus>\<^bsub>V\<^esub> w \<in> X) \<and> \<zero>\<^bsub>V\<^esub> \<in> X \<and> (\<forall>c v. c \<in> carrier K \<longrightarrow> v \<in> X \<longrightarrow> c \<odot>\<^bsub>V\<^esub> v \<in> X)

goal (1 subgoal):
 1. b \<subseteq> carrier V &&& \<not> LinearCombinations.module.lin_dep K (vs X) b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<subseteq> carrier V
\<not> LinearCombinations.module.lin_dep K (vs X) b

goal (1 subgoal):
 1. vectorspace.dim K (vs X) \<le> local.dim
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<subseteq> carrier V
\<not> LinearCombinations.module.lin_dep K (vs X) b
[PROOF STEP]
have "lin_indpt b"
[PROOF STATE]
proof (prove)
using this:
b \<subseteq> carrier V
\<not> LinearCombinations.module.lin_dep K (vs X) b

goal (1 subgoal):
 1. lin_indpt b
[PROOF STEP]
by (metis LinearCombinations.module.span_li_not_depend(2) \<open>vectorspace K (vs X)\<close> \<open>vectorspace.basis K (vs X) b\<close>
    assms(1) is_module local.carrier_vs_is_self submodule_def vectorspace.basis_def)
[PROOF STATE]
proof (state)
this:
lin_indpt b

goal (1 subgoal):
 1. vectorspace.dim K (vs X) \<le> local.dim
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace.dim K (vs X) \<le> local.dim
[PROOF STEP]
using li_le_dim(2)[OF \<open>fin_dim\<close> \<open>b \<subseteq> carrier V\<close> \<open>lin_indpt b\<close>]
[PROOF STATE]
proof (prove)
using this:
card b \<le> local.dim

goal (1 subgoal):
 1. vectorspace.dim K (vs X) \<le> local.dim
[PROOF STEP]
using \<open>b \<subseteq> carrier V\<close> \<open>lin_indpt b\<close> \<open>vectorspace K (vs X)\<close> \<open>vectorspace.basis K (vs X) b\<close> assms(2)
    fin_dim_li_fin vectorspace.dim_basis
[PROOF STATE]
proof (prove)
using this:
card b \<le> local.dim
b \<subseteq> carrier V
lin_indpt b
vectorspace K (vs X)
vectorspace.basis K (vs X) b
fin_dim
\<lbrakk>fin_dim; lin_indpt ?A; ?A \<subseteq> carrier V\<rbrakk> \<Longrightarrow> finite ?A
\<lbrakk>vectorspace ?K ?V; finite ?A; vectorspace.basis ?K ?V ?A\<rbrakk> \<Longrightarrow> vectorspace.dim ?K ?V = card ?A

goal (1 subgoal):
 1. vectorspace.dim K (vs X) \<le> local.dim
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
vectorspace.dim K (vs X) \<le> local.dim

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma plg__coplanar:
  assumes "Plg 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]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
obtain M where "Bet A M C \<and> Bet B M D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M. Bet A M C \<and> Bet B M D \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson Plg_def assms midpoint_bet)
[PROOF STATE]
proof (state)
this:
Bet A M C \<and> Bet B M D

goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Bet A M C \<and> Bet B M D
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Bet A M C \<and> Bet B M D

goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
by (metis InAngle_def bet_out_1 inangle__coplanar ncop__ncols not_col_distincts)
[PROOF STATE]
proof (state)
this:
Coplanar A B C D

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cart2_append1_proj2: "cart2_append1 (proj2_pt v) = vector2_append1 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cart2_append1 (proj2_pt v) = vector2_append1 v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cart2_append1 (proj2_pt v) = vector2_append1 v
[PROOF STEP]
from z_non_zero_proj2_pt
[PROOF STATE]
proof (chain)
picking this:
z_non_zero (proj2_pt ?v)
[PROOF STEP]
have "cart2_append1 (proj2_pt v) = vector2_append1 (cart2_pt (proj2_pt v))"
[PROOF STATE]
proof (prove)
using this:
z_non_zero (proj2_pt ?v)

goal (1 subgoal):
 1. cart2_append1 (proj2_pt v) = vector2_append1 (cart2_pt (proj2_pt v))
[PROOF STEP]
by (simp add: cart2_append1)
[PROOF STATE]
proof (state)
this:
cart2_append1 (proj2_pt v) = vector2_append1 (cart2_pt (proj2_pt v))

goal (1 subgoal):
 1. cart2_append1 (proj2_pt v) = vector2_append1 v
[PROOF STEP]
thus "cart2_append1 (proj2_pt v) = vector2_append1 v"
[PROOF STATE]
proof (prove)
using this:
cart2_append1 (proj2_pt v) = vector2_append1 (cart2_pt (proj2_pt v))

goal (1 subgoal):
 1. cart2_append1 (proj2_pt v) = vector2_append1 v
[PROOF STEP]
by (simp add: cart2_proj2)
[PROOF STATE]
proof (state)
this:
cart2_append1 (proj2_pt v) = vector2_append1 v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_component_nonneg:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "k \<in> Basis"
    and  "\<And>x. x \<in> S \<Longrightarrow> 0 \<le> (f x)\<bullet>k"
  shows "0 \<le> (integral S f)\<bullet>k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> integral S f \<bullet> k
[PROOF STEP]
proof (cases "f integrable_on S")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f integrable_on S \<Longrightarrow> 0 \<le> integral S f \<bullet> k
 2. \<not> f integrable_on S \<Longrightarrow> 0 \<le> integral S f \<bullet> k
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f integrable_on S

goal (2 subgoals):
 1. f integrable_on S \<Longrightarrow> 0 \<le> integral S f \<bullet> k
 2. \<not> f integrable_on S \<Longrightarrow> 0 \<le> integral S f \<bullet> k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> integral S f \<bullet> k
[PROOF STEP]
using True assms has_integral_component_nonneg
[PROOF STATE]
proof (prove)
using this:
f integrable_on S
k \<in> Basis
?x \<in> S \<Longrightarrow> 0 \<le> f ?x \<bullet> k
\<lbrakk>?k \<in> Basis; (?f has_integral ?i) ?S; \<And>x. x \<in> ?S \<Longrightarrow> 0 \<le> ?f x \<bullet> ?k\<rbrakk> \<Longrightarrow> 0 \<le> ?i \<bullet> ?k

goal (1 subgoal):
 1. 0 \<le> integral S f \<bullet> k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 \<le> integral S f \<bullet> k

goal (1 subgoal):
 1. \<not> f integrable_on S \<Longrightarrow> 0 \<le> integral S f \<bullet> k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> f integrable_on S \<Longrightarrow> 0 \<le> integral S f \<bullet> k
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> f integrable_on S

goal (1 subgoal):
 1. \<not> f integrable_on S \<Longrightarrow> 0 \<le> integral S f \<bullet> k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> f integrable_on S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> f integrable_on S

goal (1 subgoal):
 1. 0 \<le> integral S f \<bullet> k
[PROOF STEP]
by (simp add: not_integrable_integral)
[PROOF STATE]
proof (state)
this:
0 \<le> integral S f \<bullet> k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm010:
  assumes "runiq a" "runiq (a\<inverse>)" "(Domain a) partitions G" "Range a \<subseteq> N"
  shows "a \<in> possible_allocations_rel G N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> possible_allocations_rel G N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in> possible_allocations_rel G N
[PROOF STEP]
have "a \<in> injections (Domain a) N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> injections (Domain a) N
[PROOF STEP]
unfolding injections_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> {R. Domain R = Domain a \<and> Range R \<subseteq> N \<and> runiq R \<and> runiq (R\<inverse>)}
[PROOF STEP]
using assms(1) assms(2)  assms(4)
[PROOF STATE]
proof (prove)
using this:
runiq a
runiq (a\<inverse>)
Range a \<subseteq> N

goal (1 subgoal):
 1. a \<in> {R. Domain R = Domain a \<and> Range R \<subseteq> N \<and> runiq R \<and> runiq (R\<inverse>)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<in> injections (Domain a) N

goal (1 subgoal):
 1. a \<in> possible_allocations_rel G N
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<in> injections (Domain a) N

goal (1 subgoal):
 1. a \<in> possible_allocations_rel G N
[PROOF STEP]
have "Domain a \<in> all_partitions G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domain a \<in> all_partitions G
[PROOF STEP]
using assms(3) all_partitions_def
[PROOF STATE]
proof (prove)
using this:
Domain a partitions G
all_partitions ?A = {P. P partitions ?A}

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

goal (1 subgoal):
 1. a \<in> possible_allocations_rel G N
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a \<in> injections (Domain a) N
Domain a \<in> all_partitions G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> injections (Domain a) N
Domain a \<in> all_partitions G

goal (1 subgoal):
 1. a \<in> possible_allocations_rel G N
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
a \<in> injections (Domain a) N
Domain a \<in> all_partitions G
runiq a

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_cblinfun_bound: "0 \<le> b \<Longrightarrow> (\<And>x. norm (cblinfun_apply f x) \<le> b * norm x) \<Longrightarrow> norm f \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> b; \<And>x. norm (cblinfun_apply f x) \<le> b * norm x\<rbrakk> \<Longrightarrow> norm f \<le> b
[PROOF STEP]
by transfer (rule onorm_bound)


[STATEMENT]
lemma filtermap_times_pos_at_top: "filtermap ((*) e) at_top = at_top"
  if "e > 0"
  for e::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap ((*) e) at_top = at_top
[PROOF STEP]
apply (rule filtermap_fun_inverse[of "(*) (inverse e)"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. filterlim ((*) (inverse e)) at_top at_top
 2. filterlim ((*) e) at_top at_top
 3. \<forall>\<^sub>F x in at_top. e * (inverse e * x) = x
[PROOF STEP]
apply (rule filterlim_tendsto_pos_mult_at_top)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. ((\<lambda>x. inverse e) \<longlongrightarrow> ?c4) at_top
 2. 0 < ?c4
 3. LIM x at_top. x :> at_top
 4. filterlim ((*) e) at_top at_top
 5. \<forall>\<^sub>F x in at_top. e * (inverse e * x) = x
[PROOF STEP]
apply (rule tendsto_intros)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0 < inverse e
 2. LIM x at_top. x :> at_top
 3. filterlim ((*) e) at_top at_top
 4. \<forall>\<^sub>F x in at_top. e * (inverse e * x) = x
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < inverse e
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. 0 < inverse e
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. LIM x at_top. x :> at_top
 2. filterlim ((*) e) at_top at_top
 3. \<forall>\<^sub>F x in at_top. e * (inverse e * x) = x
[PROOF STEP]
apply (rule filterlim_ident)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. filterlim ((*) e) at_top at_top
 2. \<forall>\<^sub>F x in at_top. e * (inverse e * x) = x
[PROOF STEP]
apply (rule filterlim_tendsto_pos_mult_at_top)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. ((\<lambda>x. e) \<longlongrightarrow> ?c11) at_top
 2. 0 < ?c11
 3. LIM x at_top. x :> at_top
 4. \<forall>\<^sub>F x in at_top. e * (inverse e * x) = x
[PROOF STEP]
apply (rule tendsto_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 < e
 2. LIM x at_top. x :> at_top
 3. \<forall>\<^sub>F x in at_top. e * (inverse e * x) = x
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. 0 < e
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. LIM x at_top. x :> at_top
 2. \<forall>\<^sub>F x in at_top. e * (inverse e * x) = x
[PROOF STEP]
apply (rule filterlim_ident)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. e * (inverse e * x) = x
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. e * (inverse e * x) = x
[PROOF STEP]
by auto


[STATEMENT]
lemma changes_scale_Cons:
  fixes xs:: "real list" assumes hs: "s > 0"
  shows "changes (s * x # xs) = changes (x # xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes (s * x # xs) = changes (x # xs)
[PROOF STEP]
apply (induction xs rule: changes.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. changes [s * x] = changes [x]
 2. \<And>uu_. changes [s * x, uu_] = changes [x, uu_]
 3. \<And>x1 x2 xs. \<lbrakk>x1 * x2 < 0 \<Longrightarrow> changes (s * x # x2 # xs) = changes (x # x2 # xs); \<lbrakk>\<not> x1 * x2 < 0; x2 = 0\<rbrakk> \<Longrightarrow> changes (s * x # x1 # xs) = changes (x # x1 # xs); \<lbrakk>\<not> x1 * x2 < 0; x2 \<noteq> 0\<rbrakk> \<Longrightarrow> changes (s * x # x2 # xs) = changes (x # x2 # xs)\<rbrakk> \<Longrightarrow> changes (s * x # x1 # x2 # xs) = changes (x # x1 # x2 # xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < s

goal (3 subgoals):
 1. changes [s * x] = changes [x]
 2. \<And>uu_. changes [s * x, uu_] = changes [x, uu_]
 3. \<And>x1 x2 xs. \<lbrakk>x1 * x2 < 0 \<Longrightarrow> changes (s * x # x2 # xs) = changes (x # x2 # xs); \<lbrakk>\<not> x1 * x2 < 0; x2 = 0\<rbrakk> \<Longrightarrow> changes (s * x # x1 # xs) = changes (x # x1 # xs); \<lbrakk>\<not> x1 * x2 < 0; x2 \<noteq> 0\<rbrakk> \<Longrightarrow> changes (s * x # x2 # xs) = changes (x # x2 # xs)\<rbrakk> \<Longrightarrow> changes (s * x # x1 # x2 # xs) = changes (x # x1 # x2 # xs)
[PROOF STEP]
by (auto simp: mult_less_0_iff zero_less_mult_iff)


[STATEMENT]
lemma Gromov_extension_onto':
  fixes f::"'a::Gromov_hyperbolic_space_geodesic \<Rightarrow> 'b::Gromov_hyperbolic_space_geodesic"
  assumes "lambda C-quasi_isometry_between UNIV UNIV f"
  shows "(Gromov_extension f)`Gromov_boundary = Gromov_boundary"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_extension f ` Gromov_boundary = Gromov_boundary
[PROOF STEP]
using Gromov_extension_onto[OF assms] Gromov_extension_quasi_isometry_boundary_to_boundary[OF quasi_isometry_betweenD(1)[OF assms]]
[PROOF STATE]
proof (prove)
using this:
?y \<in> Gromov_boundary \<Longrightarrow> \<exists>x\<in>Gromov_boundary. Gromov_extension f x = ?y
?x \<in> Gromov_boundary \<Longrightarrow> Gromov_extension f ?x \<in> Gromov_boundary

goal (1 subgoal):
 1. Gromov_extension f ` Gromov_boundary = Gromov_boundary
[PROOF STEP]
by auto


[STATEMENT]
lemma matrix_mult_to_times_mat:
  assumes "dim_col A > 0" and "dim_col B > 0" and "dim_col (A::complex Matrix.mat) = dim_row B"
  shows "A * B = mat_of_cols_list (dim_row A) (plus_mult.matrix_mult (*) 0 (+) (mat_to_cols_list A) (mat_to_cols_list B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B = Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B))); j < dim_col (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)))\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)) $$ (i, j)
 2. dim_row (A * B) = dim_row (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)))
 3. dim_col (A * B) = dim_col (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)))
[PROOF STEP]
define M where "M = mat_of_cols_list (dim_row A) (plus_mult.matrix_mult (*) 0 (+) (mat_to_cols_list A) (mat_to_cols_list B))"
[PROOF STATE]
proof (state)
this:
M = Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B))); j < dim_col (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)))\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)) $$ (i, j)
 2. dim_row (A * B) = dim_row (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)))
 3. dim_col (A * B) = dim_col (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M = Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B))
[PROOF STEP]
show f1:"dim_row (A * B) = dim_row M"
[PROOF STATE]
proof (prove)
using this:
M = Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B))

goal (1 subgoal):
 1. dim_row (A * B) = dim_row M
[PROOF STEP]
by (simp add: mat_of_cols_list_def times_mat_def)
[PROOF STATE]
proof (state)
this:
dim_row (A * B) = dim_row M

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B))); j < dim_col (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)))\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)) $$ (i, j)
 2. dim_col (A * B) = dim_col (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)))
[PROOF STEP]
have "length (plus_mult.matrix_mult (*) 0 (+) (mat_to_cols_list A) (mat_to_cols_list B)) = dim_col B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)) = dim_col B
[PROOF STEP]
by (simp add: mat_multI_def)
[PROOF STATE]
proof (state)
this:
length (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)) = dim_col B

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B))); j < dim_col (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)))\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)) $$ (i, j)
 2. dim_col (A * B) = dim_col (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)) = dim_col B
[PROOF STEP]
show f2:"dim_col (A * B) = dim_col M"
[PROOF STATE]
proof (prove)
using this:
length (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)) = dim_col B

goal (1 subgoal):
 1. dim_col (A * B) = dim_col M
[PROOF STEP]
by (simp add: M_def times_mat_def mat_of_cols_list_def)
[PROOF STATE]
proof (state)
this:
dim_col (A * B) = dim_col M

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B))); j < dim_col (Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)))\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)) $$ (i, j)
[PROOF STEP]
show "\<And>i j. i < dim_row M \<Longrightarrow> j < dim_col M \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
assume a1:"i < dim_row M" and a2:"j < dim_col M"
[PROOF STATE]
proof (state)
this:
i < dim_row M
j < dim_col M

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row M
j < dim_col M
[PROOF STEP]
have "(A * B) $$ (i,j) = Matrix.row A i \<bullet> Matrix.col B j"
[PROOF STATE]
proof (prove)
using this:
i < dim_row M
j < dim_col M

goal (1 subgoal):
 1. (A * B) $$ (i, j) = Matrix.row A i \<bullet> Matrix.col B j
[PROOF STEP]
using f1 f2
[PROOF STATE]
proof (prove)
using this:
i < dim_row M
j < dim_col M
dim_row (A * B) = dim_row M
dim_col (A * B) = dim_col M

goal (1 subgoal):
 1. (A * B) $$ (i, j) = Matrix.row A i \<bullet> Matrix.col B j
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(A * B) $$ (i, j) = Matrix.row A i \<bullet> Matrix.col B j

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A * B) $$ (i, j) = Matrix.row A i \<bullet> Matrix.col B j

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
have "\<dots> = vec_of_list (row (mat_to_cols_list A) i) \<bullet> vec_of_list (col (mat_to_cols_list B) j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.row A i \<bullet> Matrix.col B j = vec_of_list (Matrix_Legacy.row (mat_to_cols_list A) i) \<bullet> vec_of_list (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
using f1 f2 a1 a2
[PROOF STATE]
proof (prove)
using this:
dim_row (A * B) = dim_row M
dim_col (A * B) = dim_col M
i < dim_row M
j < dim_col M

goal (1 subgoal):
 1. Matrix.row A i \<bullet> Matrix.col B j = vec_of_list (Matrix_Legacy.row (mat_to_cols_list A) i) \<bullet> vec_of_list (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
by (simp add: Matrix_row_is_Legacy_row Matrix_col_is_Legacy_col)
[PROOF STATE]
proof (state)
this:
Matrix.row A i \<bullet> Matrix.col B j = vec_of_list (Matrix_Legacy.row (mat_to_cols_list A) i) \<bullet> vec_of_list (Matrix_Legacy.col (mat_to_cols_list B) j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Matrix.row A i \<bullet> Matrix.col B j = vec_of_list (Matrix_Legacy.row (mat_to_cols_list A) i) \<bullet> vec_of_list (Matrix_Legacy.col (mat_to_cols_list B) j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
have "\<dots> = plus_mult.scalar_product (*) 0 (+) (row (mat_to_cols_list A) i) (col (mat_to_cols_list B) j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_list (Matrix_Legacy.row (mat_to_cols_list A) i) \<bullet> vec_of_list (Matrix_Legacy.col (mat_to_cols_list B) j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
using a1 a2 assms(3) f1 f2
[PROOF STATE]
proof (prove)
using this:
i < dim_row M
j < dim_col M
dim_col A = dim_row B
dim_row (A * B) = dim_row M
dim_col (A * B) = dim_col M

goal (1 subgoal):
 1. vec_of_list (Matrix_Legacy.row (mat_to_cols_list A) i) \<bullet> vec_of_list (Matrix_Legacy.col (mat_to_cols_list B) j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec_of_list (Matrix_Legacy.row (mat_to_cols_list A) i) \<bullet> vec_of_list (Matrix_Legacy.col (mat_to_cols_list B) j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec_of_list (Matrix_Legacy.row (mat_to_cols_list A) i) \<bullet> vec_of_list (Matrix_Legacy.col (mat_to_cols_list B) j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
have "M $$ (i,j) =  plus_mult.scalar_product (*) 0 (+) (row (mat_to_cols_list A) i) (col (mat_to_cols_list B) j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M $$ (i, j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. M $$ (i, j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
have "M $$ (i,j) = (plus_mult.matrix_mult (*) 0 (+) (mat_to_cols_list A) (mat_to_cols_list B)) ! j ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M $$ (i, j) = mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B) ! j ! i
[PROOF STEP]
using M_def f1 f2
\<open>length (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)) = dim_col B\<close> a1 a2
[PROOF STATE]
proof (prove)
using this:
M = Tensor.mat_of_cols_list (dim_row A) (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B))
dim_row (A * B) = dim_row M
dim_col (A * B) = dim_col M
length (mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B)) = dim_col B
i < dim_row M
j < dim_col M

goal (1 subgoal):
 1. M $$ (i, j) = mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B) ! j ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
M $$ (i, j) = mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B) ! j ! i

goal (1 subgoal):
 1. M $$ (i, j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
M $$ (i, j) = mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B) ! j ! i

goal (1 subgoal):
 1. M $$ (i, j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
have "mat (mult.row_length (mat_to_cols_list A)) (dim_col A) (mat_to_cols_list A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix_Legacy.mat (mult.row_length (mat_to_cols_list A)) (dim_col A) (mat_to_cols_list A)
[PROOF STEP]
using mat_to_cols_list_is_mat assms(1)
[PROOF STATE]
proof (prove)
using this:
0 < dim_col ?A \<Longrightarrow> Matrix_Legacy.mat (mult.row_length (mat_to_cols_list ?A)) (length (mat_to_cols_list ?A)) (mat_to_cols_list ?A)
0 < dim_col A

goal (1 subgoal):
 1. Matrix_Legacy.mat (mult.row_length (mat_to_cols_list A)) (dim_col A) (mat_to_cols_list A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Matrix_Legacy.mat (mult.row_length (mat_to_cols_list A)) (dim_col A) (mat_to_cols_list A)

goal (1 subgoal):
 1. M $$ (i, j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Matrix_Legacy.mat (mult.row_length (mat_to_cols_list A)) (dim_col A) (mat_to_cols_list A)

goal (1 subgoal):
 1. M $$ (i, j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
have "mat (dim_col A) (dim_col B) (mat_to_cols_list B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix_Legacy.mat (dim_col A) (dim_col B) (mat_to_cols_list B)
[PROOF STEP]
using assms(2) assms(3) mat_to_cols_list_is_mat
[PROOF STATE]
proof (prove)
using this:
0 < dim_col B
dim_col A = dim_row B
0 < dim_col ?A \<Longrightarrow> Matrix_Legacy.mat (mult.row_length (mat_to_cols_list ?A)) (length (mat_to_cols_list ?A)) (mat_to_cols_list ?A)

goal (1 subgoal):
 1. Matrix_Legacy.mat (dim_col A) (dim_col B) (mat_to_cols_list B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Matrix_Legacy.mat (dim_col A) (dim_col B) (mat_to_cols_list B)

goal (1 subgoal):
 1. M $$ (i, j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
M $$ (i, j) = mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B) ! j ! i
Matrix_Legacy.mat (mult.row_length (mat_to_cols_list A)) (dim_col A) (mat_to_cols_list A)
Matrix_Legacy.mat (dim_col A) (dim_col B) (mat_to_cols_list B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
M $$ (i, j) = mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B) ! j ! i
Matrix_Legacy.mat (mult.row_length (mat_to_cols_list A)) (dim_col A) (mat_to_cols_list A)
Matrix_Legacy.mat (dim_col A) (dim_col B) (mat_to_cols_list B)

goal (1 subgoal):
 1. M $$ (i, j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
using assms(1) a1 a2 row_length_mat_to_cols_list plus_mult.matrix_index[of 1 "(*)" 0 "(+)"] plus_mult_cpx
[PROOF STATE]
proof (prove)
using this:
M $$ (i, j) = mat_mult (mult.row_length (mat_to_cols_list A)) (mat_to_cols_list A) (mat_to_cols_list B) ! j ! i
Matrix_Legacy.mat (mult.row_length (mat_to_cols_list A)) (dim_col A) (mat_to_cols_list A)
Matrix_Legacy.mat (dim_col A) (dim_col B) (mat_to_cols_list B)
0 < dim_col A
i < dim_row M
j < dim_col M
0 < dim_col ?A \<Longrightarrow> mult.row_length (mat_to_cols_list ?A) = dim_row ?A
\<lbrakk>plus_mult (1::?'a1) (*) (0::?'a1) (+) ?inver; Matrix_Legacy.mat (mult.row_length ?m1.0) ?n ?m1.0; Matrix_Legacy.mat ?n ?nc ?m2.0; ?i < mult.row_length ?m1.0; ?j < ?nc\<rbrakk> \<Longrightarrow> mat_multI (0::?'a1) (+) (*) (mult.row_length ?m1.0) ?m1.0 ?m2.0 ! ?j ! ?i = plus_mult.scalar_product (*) (0::?'a1) (+) (Matrix_Legacy.row ?m1.0 ?i) (Matrix_Legacy.col ?m2.0 ?j)
plus_mult 1 (*) 0 (+) (a_inv cpx_rng)

goal (1 subgoal):
 1. M $$ (i, j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)
[PROOF STEP]
by (smt f1 f2 index_mult_mat(2) index_mult_mat(3))
[PROOF STATE]
proof (state)
this:
M $$ (i, j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
M $$ (i, j) = plus_mult.scalar_product (*) 0 (+) (Matrix_Legacy.row (mat_to_cols_list A) i) (Matrix_Legacy.col (mat_to_cols_list B) j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
M $$ (i, j) = (A * B) $$ (i, j)
[PROOF STEP]
show "(A * B) $$ (i, j) = M $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
M $$ (i, j) = (A * B) $$ (i, j)

goal (1 subgoal):
 1. (A * B) $$ (i, j) = M $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(A * B) $$ (i, j) = M $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < dim_row M; ?j < dim_col M\<rbrakk> \<Longrightarrow> (A * B) $$ (?i, ?j) = M $$ (?i, ?j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Group) QmpTr5:"\<lbrakk>G \<triangleright> H; G \<triangleright> N; H \<subseteq> N; X \<in> carrier (G/H);
      Y \<in> carrier (G/H) \<rbrakk> \<Longrightarrow> (Qmp G H N) ( X \<cdot>\<^bsub>(G / H)\<^esub> Y) =
                              ((Qmp G H N) X) \<cdot>\<^bsub>(G / N)\<^esub> ((Qmp G H N) Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<triangleright> H; G \<triangleright> N; H \<subseteq> N; X \<in> carrier (G / H); Y \<in> carrier (G / H)\<rbrakk> \<Longrightarrow> (Qm\<^bsub>G H,N\<^esub>) (X \<cdot>\<^bsub>G / H\<^esub> Y) = (Qm\<^bsub>G H,N\<^esub>) X \<cdot>\<^bsub>G / N\<^esub> (Qm\<^bsub>G H,N\<^esub>) Y
[PROOF STEP]
by (frule nsg_sg[of "H"], frule nsg_sg[of "N"],
       (subst Qg_def)+, simp,
       simp add:QmpTr3 [of "H" "N" "X" "Y"])


[STATEMENT]
lemma ord_of_nat_equality: "ord_of_nat n = \<Squnion> ((succ \<circ> ord_of_nat) ` {..<n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_of_nat n = \<Squnion> ((ZFC_in_HOL.succ \<circ> ord_of_nat) ` {..<n})
[PROOF STEP]
by (metis Ord_equality Ord_ord_of_nat elts_of_set image_comp small_image_nat_V ord_of_nat_eq_initial)


[STATEMENT]
lemma to_fun_monom':
  assumes "c \<in> carrier R"
  assumes "c \<noteq>\<zero>"
  assumes "x \<in> carrier R"
  shows "to_fun (c \<odot>\<^bsub>P\<^esub> X[^]\<^bsub>P\<^esub>(n::nat)) x = c \<otimes> x [^] n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun (c \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n) x = c \<otimes> x [^] n
[PROOF STEP]
using P_def to_fun_monom monom_rep_X_pow UP_cring_axioms assms(1) assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
P \<equiv> UP R
\<lbrakk>?c \<in> carrier R; ?x \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun (monom P ?c ?n) ?x = ?c \<otimes> ?x [^] ?n
?a \<in> carrier R \<Longrightarrow> monom P ?a ?n = ?a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> ?n
UP_cring R
c \<in> carrier R
c \<noteq> \<zero>
x \<in> carrier R

goal (1 subgoal):
 1. to_fun (c \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n) x = c \<otimes> x [^] n
[PROOF STEP]
by fastforce


[STATEMENT]
lemma "(x - y) - (x::nat) = (x - x) - y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - y - x = x - x - y
[PROOF STEP]
by linarith


[STATEMENT]
lemma exists_MST: "connected g \<Longrightarrow> \<exists>t. is_MST w g t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Undirected_Graph.connected g \<Longrightarrow> \<exists>t. is_MST w g t
[PROOF STEP]
using ex_has_least_nat[of "is_spanning_tree g"] ex_spanning_tree
[PROOF STATE]
proof (prove)
using this:
is_spanning_tree g ?k \<Longrightarrow> \<exists>x. is_spanning_tree g x \<and> (\<forall>y. is_spanning_tree g y \<longrightarrow> ?m x \<le> ?m y)
Undirected_Graph.connected ?g \<Longrightarrow> \<exists>t. is_spanning_tree ?g t

goal (1 subgoal):
 1. Undirected_Graph.connected g \<Longrightarrow> \<exists>t. is_MST w g t
[PROOF STEP]
unfolding is_MST_def
[PROOF STATE]
proof (prove)
using this:
is_spanning_tree g ?k \<Longrightarrow> \<exists>x. is_spanning_tree g x \<and> (\<forall>y. is_spanning_tree g y \<longrightarrow> ?m x \<le> ?m y)
Undirected_Graph.connected ?g \<Longrightarrow> \<exists>t. is_spanning_tree ?g t

goal (1 subgoal):
 1. Undirected_Graph.connected g \<Longrightarrow> \<exists>t. is_spanning_tree g t \<and> (\<forall>t'. is_spanning_tree g t' \<longrightarrow> weight w t \<le> weight w t')
[PROOF STEP]
by blast


[STATEMENT]
lemma rel_fun_relcompp:
  "((R1 ===> S1) OO (R2 ===> S2)) a b \<Longrightarrow> ((R1 OO R2) ===> (S1 OO S2)) a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((R1 ===> S1) OO (R2 ===> S2)) a b \<Longrightarrow> (R1 OO R2 ===> S1 OO S2) a b
[PROOF STEP]
unfolding OO_def rel_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. (\<forall>x ya. R1 x ya \<longrightarrow> S1 (a x) (y ya)) \<and> (\<forall>x ya. R2 x ya \<longrightarrow> S2 (y x) (b ya)) \<Longrightarrow> \<forall>x y. (\<exists>ya. R1 x ya \<and> R2 ya y) \<longrightarrow> (\<exists>ya. S1 (a x) ya \<and> S2 ya (b y))
[PROOF STEP]
by blast


[STATEMENT]
lemma capped_postfixpoint:
  "y \<le> u \<Longrightarrow> z \<le> v \<Longrightarrow> u * v \<le> v \<Longrightarrow> is_postfixpoint (\<lambda>x . (y * x \<squnion> z) \<sqinter> v) (y\<^sup>\<omega>\<^sub>v \<squnion> y\<^sup>\<star> * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<le> u; z \<le> v; u * v \<le> v\<rbrakk> \<Longrightarrow> is_postfixpoint (\<lambda>x. (y * x \<squnion> z) \<sqinter> v) (y\<^sup>\<omega>\<^sub>v \<squnion> y\<^sup>\<star> * z)
[PROOF STEP]
using capped_fix inf.eq_refl is_postfixpoint_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y \<le> ?u; ?z \<le> ?v; ?u * ?v \<le> ?v\<rbrakk> \<Longrightarrow> (?y * (?y\<^sup>\<omega>\<^sub>?v \<squnion> ?y\<^sup>\<star> * ?z) \<squnion> ?z) \<sqinter> ?v = ?y\<^sup>\<omega>\<^sub>?v \<squnion> ?y\<^sup>\<star> * ?z
?x = ?y \<Longrightarrow> ?y \<le> ?x
is_postfixpoint ?f ?x \<equiv> ?x \<le> ?f ?x

goal (1 subgoal):
 1. \<lbrakk>y \<le> u; z \<le> v; u * v \<le> v\<rbrakk> \<Longrightarrow> is_postfixpoint (\<lambda>x. (y * x \<squnion> z) \<sqinter> v) (y\<^sup>\<omega>\<^sub>v \<squnion> y\<^sup>\<star> * z)
[PROOF STEP]
by auto


[STATEMENT]
lemma nn_integral_eP:
  "\<omega> \<in> space (PiM {0..<n} M) \<Longrightarrow> f \<in> borel_measurable (PiM {0..<Suc n} M) \<Longrightarrow>
    (\<integral>\<^sup>+x. f x \<partial>eP n \<omega>) = (\<integral>\<^sup>+x. f (\<omega>(n := x)) \<partial>P n \<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<omega> \<in> space (Pi\<^sub>M {0..<n} M); f \<in> borel_measurable (Pi\<^sub>M {0..<Suc n} M)\<rbrakk> \<Longrightarrow> integral\<^sup>N (eP n \<omega>) f = \<integral>\<^sup>+ x. f (\<omega>(n := x)) \<partial>P n \<omega>
[PROOF STEP]
unfolding eP_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<omega> \<in> space (Pi\<^sub>M {0..<n} M); f \<in> borel_measurable (Pi\<^sub>M {0..<Suc n} M)\<rbrakk> \<Longrightarrow> integral\<^sup>N (distr (P n \<omega>) (Pi\<^sub>M {0..<Suc n} M) (fun_upd \<omega> n)) f = \<integral>\<^sup>+ x. f (\<omega>(n := x)) \<partial>P n \<omega>
[PROOF STEP]
by (subst nn_integral_distr) (auto intro!: measurable_fun_upd[where J="{0..<n}"] simp: space_PiM PiE_iff)


[STATEMENT]
lemma mcont2mcont_max_enat [cont_intro, simp]:
  "\<lbrakk> mcont lub ord Sup (\<le>) (\<lambda>x. f x);
    mcont lub ord Sup (\<le>) (\<lambda>x. g x) \<rbrakk>
  \<Longrightarrow> mcont lub ord Sup (\<le>) (\<lambda>x. max (f x) (g x) :: enat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mcont lub ord Sup (\<le>) f; mcont lub ord Sup (\<le>) g\<rbrakk> \<Longrightarrow> mcont lub ord Sup (\<le>) (\<lambda>x. max (f x) (g x))
[PROOF STEP]
by(best intro: ccpo.mcont2mcont'[OF complete_lattice_ccpo] mcont_max_enat1 mcont_max_enat2 ccpo.mcont_const[OF complete_lattice_ccpo])


[STATEMENT]
lemma prod_ereal_pos:
  fixes f :: "'a \<Rightarrow> ereal"
  assumes pos: "\<And>i. i \<in> I \<Longrightarrow> 0 \<le> f i"
  shows "0 \<le> (\<Prod>i\<in>I. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> prod f I
[PROOF STEP]
proof (cases "finite I")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite I \<Longrightarrow> 0 \<le> prod f I
 2. infinite I \<Longrightarrow> 0 \<le> prod f I
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite I

goal (2 subgoals):
 1. finite I \<Longrightarrow> 0 \<le> prod f I
 2. infinite I \<Longrightarrow> 0 \<le> prod f I
[PROOF STEP]
from this pos
[PROOF STATE]
proof (chain)
picking this:
finite I
?i \<in> I \<Longrightarrow> 0 \<le> f ?i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite I
?i \<in> I \<Longrightarrow> 0 \<le> f ?i

goal (1 subgoal):
 1. 0 \<le> prod f I
[PROOF STEP]
by induct auto
[PROOF STATE]
proof (state)
this:
0 \<le> prod f I

goal (1 subgoal):
 1. infinite I \<Longrightarrow> 0 \<le> prod f I
[PROOF STEP]
qed auto


[STATEMENT]
lemma "P a \<Longrightarrow> \<exists>A. (\<forall>x \<in> A. P x) \<and> (\<exists>y. y \<in> A)"
  \<comment> \<open>Example 3.\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P a \<Longrightarrow> \<exists>A. (\<forall>x\<in>A. P x) \<and> (\<exists>y. y \<in> A)
[PROOF STEP]
by force


[STATEMENT]
lemma mset_rows_index_map:  "image_mset (\<lambda> i. row M i) (mset_set {0..< dim_row M}) = mset (rows M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset (row M) (mset_set {0..<dim_row M}) = mset (rows M)
[PROOF STEP]
by (simp add: rows_def)


[STATEMENT]
lemma prob_proj_comm:
  fixes PROB vs vs'
  shows "prob_proj (prob_proj PROB vs) vs' = prob_proj (prob_proj PROB vs') vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_proj (prob_proj PROB vs) vs' = prob_proj (prob_proj PROB vs') vs
[PROOF STEP]
by (smt graph_plan_neq_mems_state_set_neq_len inf_commute inf_le2 PROJ_DOM_IDEMPOT prob_proj_idempot)

\<comment> \<open>TODO Unwrap the metis proof.\<close>


[STATEMENT]
lemma iMin_atLeastLessThan: "m < n \<Longrightarrow> iMin {m..<n} = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < n \<Longrightarrow> iMin {m..<n} = m
[PROOF STEP]
by (rule iMin_equality, simp_all)


[STATEMENT]
lemma Sup_pres_map_dual_var:
  fixes f :: "'a::complete_lattice_with_dual \<Rightarrow> 'b::complete_lattice_with_dual"
  shows "Sup_pres f = Inf_pres (\<partial>\<^sub>F f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup_pres f = Inf_pres (\<partial>\<^sub>F f)
[PROOF STEP]
by (metis Inf_pres_map_dual_var fun_dual5 map_dual_def)


[STATEMENT]
lemma rev_ordsetmap_smap: "\<lbrakk> X\<in>\<P>; Y\<in>\<P>; smap X \<subseteq> smap Y \<rbrakk> \<Longrightarrow> X\<supseteq>Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<in> \<P>; Y \<in> \<P>; dual_order.poset_simplex_map \<P> X \<subseteq> dual_order.poset_simplex_map \<P> Y\<rbrakk> \<Longrightarrow> Y \<subseteq> X
[PROOF STEP]
using ComplexLikePoset.rev_ordsetmap_smap[
          OF ComplexLikePoset_special_cosets
        ]
        smap_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> \<P>; ?b \<in> \<P>; dual_order.poset_simplex_map \<P> ?a \<subseteq> dual_order.poset_simplex_map \<P> ?b\<rbrakk> \<Longrightarrow> ?b \<subseteq> ?a
dual_order.poset_simplex_map \<P> ?x = {y. dual_order.pseudominimal_in (dual_order.below_in \<P> ?x) y}

goal (1 subgoal):
 1. \<lbrakk>X \<in> \<P>; Y \<in> \<P>; dual_order.poset_simplex_map \<P> X \<subseteq> dual_order.poset_simplex_map \<P> Y\<rbrakk> \<Longrightarrow> Y \<subseteq> X
[PROOF STEP]
by    simp


[STATEMENT]
lemma mset_extend_size:
assumes "\<not> (\<Gamma> = \<Empt> \<and> \<Delta> = \<Empt>)"
shows "size (mset ((extend (\<Gamma> \<Rightarrow>* \<Delta>) c))) > size (mset c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (ModalSequents.mset c) < size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> (\<Gamma> = \<Empt> \<and> \<Delta> = \<Empt>)

goal (1 subgoal):
 1. size (ModalSequents.mset c) < size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<Gamma> = \<Empt> \<and> \<Delta> = \<Empt>) \<Longrightarrow> size (ModalSequents.mset c) < size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<Gamma> = \<Empt> \<and> \<Delta> = \<Empt>)
[PROOF STEP]
have "mset (\<Gamma> \<Rightarrow>* \<Delta>) \<noteq> \<Empt>"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<Gamma> = \<Empt> \<and> \<Delta> = \<Empt>)

goal (1 subgoal):
 1. ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>) \<noteq> \<Empt>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>) \<noteq> \<Empt>

goal (1 subgoal):
 1. \<not> (\<Gamma> = \<Empt> \<and> \<Delta> = \<Empt>) \<Longrightarrow> size (ModalSequents.mset c) < size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>) \<noteq> \<Empt>
[PROOF STEP]
have "size (mset (\<Gamma> \<Rightarrow>* \<Delta>)) > 0"
[PROOF STATE]
proof (prove)
using this:
ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>) \<noteq> \<Empt>

goal (1 subgoal):
 1. 0 < size (ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<Delta> = \<Empt>; \<Gamma> \<noteq> \<Empt>\<rbrakk> \<Longrightarrow> 0 < size \<Gamma>
[PROOF STEP]
by (induct \<Gamma>) auto
[PROOF STATE]
proof (state)
this:
0 < size (ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>))

goal (1 subgoal):
 1. \<not> (\<Gamma> = \<Empt> \<and> \<Delta> = \<Empt>) \<Longrightarrow> size (ModalSequents.mset c) < size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < size (ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>))

goal (1 subgoal):
 1. \<not> (\<Gamma> = \<Empt> \<and> \<Delta> = \<Empt>) \<Longrightarrow> size (ModalSequents.mset c) < size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c))
[PROOF STEP]
have "mset (extend (\<Gamma> \<Rightarrow>* \<Delta>) c) = mset (\<Gamma>\<Rightarrow>*\<Delta>) + mset c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c) = ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>) + ModalSequents.mset c
[PROOF STEP]
using mset_extend[where S="\<Gamma> \<Rightarrow>* \<Delta>" and c=c]
[PROOF STATE]
proof (prove)
using this:
ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c) = ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>) + ModalSequents.mset c

goal (1 subgoal):
 1. ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c) = ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>) + ModalSequents.mset c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c) = ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>) + ModalSequents.mset c

goal (1 subgoal):
 1. \<not> (\<Gamma> = \<Empt> \<and> \<Delta> = \<Empt>) \<Longrightarrow> size (ModalSequents.mset c) < size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c) = ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>) + ModalSequents.mset c
[PROOF STEP]
have "size (mset (extend (\<Gamma> \<Rightarrow>* \<Delta>) c)) = size (mset (\<Gamma> \<Rightarrow>* \<Delta>)) + size (mset c)"
[PROOF STATE]
proof (prove)
using this:
ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c) = ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>) + ModalSequents.mset c

goal (1 subgoal):
 1. size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c)) = size (ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>)) + size (ModalSequents.mset c)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c)) = size (ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>)) + size (ModalSequents.mset c)

goal (1 subgoal):
 1. \<not> (\<Gamma> = \<Empt> \<and> \<Delta> = \<Empt>) \<Longrightarrow> size (ModalSequents.mset c) < size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < size (ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>))
size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c)) = size (ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>)) + size (ModalSequents.mset c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < size (ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>))
size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c)) = size (ModalSequents.mset ( \<Gamma> \<Rightarrow>* \<Delta>)) + size (ModalSequents.mset c)

goal (1 subgoal):
 1. size (ModalSequents.mset c) < size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c))
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
size (ModalSequents.mset c) < size (ModalSequents.mset (extend ( \<Gamma> \<Rightarrow>* \<Delta>) c))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(\<exists>x. P x) \<and>
      (\<forall>x. L x \<longrightarrow> \<not> (M x \<and> R x)) \<and>
      (\<forall>x. P x \<longrightarrow> (M x \<and> L x)) \<and>
      ((\<forall>x. P x \<longrightarrow> Q x) \<or> (\<exists>x. P x \<and> R x))
    \<longrightarrow> (\<exists>x. Q x \<and> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. P x) \<and> (\<forall>x. L x \<longrightarrow> \<not> (M x \<and> R x)) \<and> (\<forall>x. P x \<longrightarrow> M x \<and> L x) \<and> ((\<forall>x. P x \<longrightarrow> Q x) \<or> (\<exists>x. P x \<and> R x)) \<longrightarrow> (\<exists>x. Q x \<and> P x)
[PROOF STEP]
by blast


[STATEMENT]
lemma ss_rewrite_snd_h:
  assumes e_e'_mod: "e' mod order \<G> < e mod order \<G>"
    and h_mem: "snd h \<in> carrier \<G>"
    and a_mem: "snd a \<in> carrier \<G>"
    and a1: "snd a \<otimes> snd h [^] e = g' [^] z"
    and a2: "snd a \<otimes> snd h [^] e' = g' [^] z'"
  shows "snd h = g' [^] ((int z - int z') * fst (bezw ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>)) mod int (order \<G>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
have gcd: "gcd ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) = 1
[PROOF STEP]
using prime_field
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime ?q; ?a < ?q; ?a \<noteq> 0\<rbrakk> \<Longrightarrow> coprime ?a ?q

goal (1 subgoal):
 1. gcd ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) = 1
[PROOF STEP]
by (simp add: assms less_imp_diff_less linorder_not_le prime_order)
[PROOF STATE]
proof (state)
this:
gcd ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) = 1

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
have "snd a = g' [^] z \<otimes> inv (snd h [^] e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd a = g' [^] z \<otimes> inv (snd h [^] e)
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
snd a \<otimes> snd h [^] e = g' [^] z

goal (1 subgoal):
 1. snd a = g' [^] z \<otimes> inv (snd h [^] e)
[PROOF STEP]
by (metis (no_types, lifting) Group.group.axioms(1) h_mem a_mem group.inv_closed group_l_invI l_inv_ex monoid.m_assoc nat_pow_closed r_inv r_one)
[PROOF STATE]
proof (state)
this:
snd a = g' [^] z \<otimes> inv (snd h [^] e)

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
snd a = g' [^] z \<otimes> inv (snd h [^] e)

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
have "snd a = g' [^] z' \<otimes> inv (snd h [^] e')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd a = g' [^] z' \<otimes> inv (snd h [^] e')
[PROOF STEP]
by (metis a2 h_mem a_mem g'_def generator_closed group.inv_solve_right' group_l_invI l_inv_ex nat_pow_closed)
[PROOF STATE]
proof (state)
this:
snd a = g' [^] z' \<otimes> inv (snd h [^] e')

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
snd a = g' [^] z \<otimes> inv (snd h [^] e)
snd a = g' [^] z' \<otimes> inv (snd h [^] e')
[PROOF STEP]
have "g' [^] z \<otimes> snd h [^] e' = g' [^] z' \<otimes> snd h [^] e"
[PROOF STATE]
proof (prove)
using this:
snd a = g' [^] z \<otimes> inv (snd h [^] e)
snd a = g' [^] z' \<otimes> inv (snd h [^] e')

goal (1 subgoal):
 1. g' [^] z \<otimes> snd h [^] e' = g' [^] z' \<otimes> snd h [^] e
[PROOF STEP]
by (metis (no_types, lifting) a2 h_mem a_mem a1 cyclic_group_assoc cyclic_group_commute nat_pow_closed)
[PROOF STATE]
proof (state)
this:
g' [^] z \<otimes> snd h [^] e' = g' [^] z' \<otimes> snd h [^] e

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
g' [^] z \<otimes> snd h [^] e' = g' [^] z' \<otimes> snd h [^] e

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
obtain t :: nat where t: "snd h = \<^bold>g [^] t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t. snd h = \<^bold>g [^] t \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2) generatorE
[PROOF STATE]
proof (prove)
using this:
snd h \<in> carrier \<G>
\<lbrakk>?x \<in> carrier \<G>; \<And>n. ?x = \<^bold>g [^] n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>t. snd h = \<^bold>g [^] t \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
snd h = \<^bold>g [^] t

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
g' [^] z \<otimes> snd h [^] e' = g' [^] z' \<otimes> snd h [^] e
snd h = \<^bold>g [^] t
[PROOF STEP]
have "\<^bold>g [^] (x * z + t * e') = \<^bold>g [^] (x * z' + t * e)"
[PROOF STATE]
proof (prove)
using this:
g' [^] z \<otimes> snd h [^] e' = g' [^] z' \<otimes> snd h [^] e
snd h = \<^bold>g [^] t

goal (1 subgoal):
 1. \<^bold>g [^] (x * z + t * e') = \<^bold>g [^] (x * z' + t * e)
[PROOF STEP]
using g'_def nat_pow_pow
[PROOF STATE]
proof (prove)
using this:
g' [^] z \<otimes> snd h [^] e' = g' [^] z' \<otimes> snd h [^] e
snd h = \<^bold>g [^] t
g' = \<^bold>g [^] x
?x \<in> carrier \<G> \<Longrightarrow> (?x [^] ?n) [^] ?m = ?x [^] (?n * ?m)

goal (1 subgoal):
 1. \<^bold>g [^] (x * z + t * e') = \<^bold>g [^] (x * z' + t * e)
[PROOF STEP]
by (simp add: nat_pow_mult)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (x * z + t * e') = \<^bold>g [^] (x * z' + t * e)

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
hence "[x * z + t * e' = x * z' + t * e] (mod order \<G>)"
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] (x * z + t * e') = \<^bold>g [^] (x * z' + t * e)

goal (1 subgoal):
 1. [x * z + t * e' = x * z' + t * e] (mod order \<G>)
[PROOF STEP]
using group_eq_pow_eq_mod order_gt_0
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] (x * z + t * e') = \<^bold>g [^] (x * z' + t * e)
\<lbrakk>\<^bold>g [^] ?a = \<^bold>g [^] ?b; 0 < order \<G>\<rbrakk> \<Longrightarrow> [?a = ?b] (mod order \<G>)
0 < order \<G>

goal (1 subgoal):
 1. [x * z + t * e' = x * z' + t * e] (mod order \<G>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[x * z + t * e' = x * z' + t * e] (mod order \<G>)

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
hence "[int x * int z + int t * int e' = int x * int z' + int t * int e] (mod order \<G>)"
[PROOF STATE]
proof (prove)
using this:
[x * z + t * e' = x * z' + t * e] (mod order \<G>)

goal (1 subgoal):
 1. [int x * int z + int t * int e' = int x * int z' + int t * int e] (mod int (order \<G>))
[PROOF STEP]
by (metis Groups.add_ac(2) Groups.mult_ac(2) cong_int_iff int_ops(7) int_plus)
[PROOF STATE]
proof (state)
this:
[int x * int z + int t * int e' = int x * int z' + int t * int e] (mod int (order \<G>))

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
hence "[int x * int z - int x * int z' = int t * int e - int t * int e'] (mod order \<G>)"
[PROOF STATE]
proof (prove)
using this:
[int x * int z + int t * int e' = int x * int z' + int t * int e] (mod int (order \<G>))

goal (1 subgoal):
 1. [int x * int z - int x * int z' = int t * int e - int t * int e'] (mod int (order \<G>))
[PROOF STEP]
by (smt cong_diff_iff_cong_0)
[PROOF STATE]
proof (state)
this:
[int x * int z - int x * int z' = int t * int e - int t * int e'] (mod int (order \<G>))

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
hence "[int x * (int z - int z') = int t * (int e - int e')] (mod order \<G>)"
[PROOF STATE]
proof (prove)
using this:
[int x * int z - int x * int z' = int t * int e - int t * int e'] (mod int (order \<G>))

goal (1 subgoal):
 1. [int x * (int z - int z') = int t * (int e - int e')] (mod int (order \<G>))
[PROOF STEP]
by (simp add: int_distrib(4))
[PROOF STATE]
proof (state)
this:
[int x * (int z - int z') = int t * (int e - int e')] (mod int (order \<G>))

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
hence "[int x * (int z - int z') = int t * (int e mod order \<G> - int e' mod order \<G>) mod order \<G>] (mod order \<G>)"
[PROOF STATE]
proof (prove)
using this:
[int x * (int z - int z') = int t * (int e - int e')] (mod int (order \<G>))

goal (1 subgoal):
 1. [int x * (int z - int z') = int t * (int e mod int (order \<G>) - int e' mod int (order \<G>)) mod int (order \<G>)] (mod int (order \<G>))
[PROOF STEP]
by (metis (no_types, lifting) cong_def mod_diff_eq mod_mod_trivial mod_mult_right_eq)
[PROOF STATE]
proof (state)
this:
[int x * (int z - int z') = int t * (int e mod int (order \<G>) - int e' mod int (order \<G>)) mod int (order \<G>)] (mod int (order \<G>))

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
hence *: "[int x * (int z - int z') = int t * (e mod order \<G> - e' mod order \<G>) mod order \<G>] (mod order \<G>)"
[PROOF STATE]
proof (prove)
using this:
[int x * (int z - int z') = int t * (int e mod int (order \<G>) - int e' mod int (order \<G>)) mod int (order \<G>)] (mod int (order \<G>))

goal (1 subgoal):
 1. [int x * (int z - int z') = int t * int (e mod order \<G> - e' mod order \<G>) mod int (order \<G>)] (mod int (order \<G>))
[PROOF STEP]
by (simp add: assms(1) int_ops(9) less_imp_le_nat of_nat_diff)
[PROOF STATE]
proof (state)
this:
[int x * (int z - int z') = int t * int (e mod order \<G> - e' mod order \<G>) mod int (order \<G>)] (mod int (order \<G>))

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
hence "[int x * (int z - int z') * fst (bezw ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>))
               = int t * ((e mod order \<G> - e' mod order \<G>) mod order \<G>
                  * fst (bezw ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>)))] (mod order \<G>)"
[PROOF STATE]
proof (prove)
using this:
[int x * (int z - int z') = int t * int (e mod order \<G> - e' mod order \<G>) mod int (order \<G>)] (mod int (order \<G>))

goal (1 subgoal):
 1. [int x * (int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) = int t * (int ((e mod order \<G> - e' mod order \<G>) mod order \<G>) * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>))] (mod int (order \<G>))
[PROOF STEP]
by (metis (no_types, lifting) cong_mod_right cong_scalar_right less_imp_diff_less mod_if more_arith_simps(11) or_gt_0 unique_euclidean_semiring_numeral_class.pos_mod_bound)
[PROOF STATE]
proof (state)
this:
[int x * (int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) = int t * (int ((e mod order \<G> - e' mod order \<G>) mod order \<G>) * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>))] (mod int (order \<G>))

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
hence "[int x * (int z - int z') * fst (bezw ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>))
               = int t * 1] (mod order \<G>)"
[PROOF STATE]
proof (prove)
using this:
[int x * (int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) = int t * (int ((e mod order \<G> - e' mod order \<G>) mod order \<G>) * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>))] (mod int (order \<G>))

goal (1 subgoal):
 1. [int x * (int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) = int t * 1] (mod int (order \<G>))
[PROOF STEP]
by (meson Number_Theory_Aux.inverse * gcd cong_scalar_left cong_trans)
[PROOF STATE]
proof (state)
this:
[int x * (int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) = int t * 1] (mod int (order \<G>))

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
hence "\<^bold>g [^] (int x * (int z - int z') * fst (bezw ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>))) = \<^bold>g [^] t"
[PROOF STATE]
proof (prove)
using this:
[int x * (int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) = int t * 1] (mod int (order \<G>))

goal (1 subgoal):
 1. \<^bold>g [^] (int x * (int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>)) = \<^bold>g [^] t
[PROOF STEP]
by (metis cong_def int_pow_int more_arith_simps(6) pow_generator_mod_int)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (int x * (int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>)) = \<^bold>g [^] t

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] (int x * (int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>)) = \<^bold>g [^] t

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] (int x * (int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>)) = \<^bold>g [^] t
snd h = \<^bold>g [^] t

goal (1 subgoal):
 1. snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) g'_def generator_closed int_pow_int int_pow_pow mod_mult_right_eq more_arith_simps(11) pow_generator_mod_int)
[PROOF STATE]
proof (state)
this:
snd h = g' [^] ((int z - int z') * Number_Theory_Aux.inverse ((e mod order \<G> - e' mod order \<G>) mod order \<G>) (order \<G>) mod int (order \<G>))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_ennreal_of_enat[simp]: "(\<Sum>i\<in>I. ennreal_of_enat (f i)) = ennreal_of_enat (sum f I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>I. ennreal_of_enat (f i)) = ennreal_of_enat (sum f I)
[PROOF STEP]
by (induct I rule: infinite_finite_induct) (auto simp: sum_nonneg)


[STATEMENT]
lemma sum_list_distinct_filter:
  fixes f:: "'a \<Rightarrow> int"
  assumes "distinct xs" "distinct ys"
  assumes "set ys \<subseteq> set xs"
  assumes "\<And>x. x \<in> set xs - set ys \<Longrightarrow> f x = 0"
  shows "sum_list (map f xs) = sum_list (map f ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map f xs) = sum_list (map f ys)
[PROOF STEP]
by (metis List.finite_set assms(1) assms(2) assms(3) assms(4) sum.mono_neutral_cong_left sum_list_distinct_conv_sum_set)


[STATEMENT]
lemma LIM_cnj_iff: "((\<lambda>x. cnj (f x)) \<midarrow>a\<rightarrow> cnj L) \<longleftrightarrow> f \<midarrow>a\<rightarrow> L"
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. cnj (f x)) \<midarrow>a\<rightarrow> cnj L = f \<midarrow>a\<rightarrow> L
[PROOF STEP]
by (simp add: LIM_eq complex_cnj_diff [symmetric] del: complex_cnj_diff)


[STATEMENT]
lemma acyclic_eq_wf: "!!r::(vertex*vertex)set. acyclic r = wf r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. acyclic r = wf r
[PROOF STEP]
by (auto simp add: wf_iff_acyclic_if_finite)


[STATEMENT]
lemma uint_word_of_int: "uint (word_of_int k :: 'a::len word) = k mod 2 ^ LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uint (word_of_int k) = k mod 2 ^ LENGTH('a)
[PROOF STEP]
by (simp add: uint_word_of_int_eq take_bit_eq_mod)


[STATEMENT]
lemma coeff_monom_Suc: "coeff (monom a (Suc d) * p) (Suc i) = coeff (monom a d * p) i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (monom a (Suc d) * p) (Suc i) = coeff (monom a d * p) i
[PROOF STEP]
by (simp add: monom_Suc)


[STATEMENT]
lemma nat_int:  "nat (int x + int y) = x + y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat (int x + int y) = x + y
[PROOF STEP]
using nat_int of_nat_add
[PROOF STATE]
proof (prove)
using this:
nat (int ?n) = ?n
of_nat (?m + ?n) = of_nat ?m + of_nat ?n

goal (1 subgoal):
 1. nat (int x + int y) = x + y
[PROOF STEP]
by auto


[STATEMENT]
lemma pp_total_linorder_matrix:
  fixes f :: "('a::finite,'b::non_trivial_linorder_stone_relation_algebra_expansion) square"
  shows "matrix_bounded_idempotent_semiring.total (\<ominus>\<ominus>f) \<longleftrightarrow> (\<forall>i . \<exists>j . f (i,j) \<noteq> bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_bounded_idempotent_semiring.total (\<ominus> \<ominus> f) = (\<forall>i. \<exists>j. f (i, j) \<noteq> bot)
[PROOF STEP]
using matrix_stone_relation_algebra.pp_total pp_total_linorder_matrix_1 pp_total_linorder_matrix_2
[PROOF STATE]
proof (prove)
using this:
matrix_bounded_idempotent_semiring.total (\<ominus> \<ominus> ?x) = matrix_p_algebra.dense (?x \<odot> mtop)
matrix_p_algebra.dense (?f \<odot> mtop) \<Longrightarrow> \<exists>j. ?f (?i, j) \<noteq> bot
\<forall>i. \<exists>j. ?f (i, j) \<noteq> bot \<Longrightarrow> matrix_p_algebra.dense (?f \<odot> mtop)

goal (1 subgoal):
 1. matrix_bounded_idempotent_semiring.total (\<ominus> \<ominus> f) = (\<forall>i. \<exists>j. f (i, j) \<noteq> bot)
[PROOF STEP]
by auto


[STATEMENT]
lemma dims_output_witness':
assumes "length rs \<ge> 1"
and "\<And>r. r\<in>set rs \<Longrightarrow> r > 0"
and "j < rs!0"
shows "Tensor.dims (tensors_from_net (witness'_l rs) $ j) = replicate (2^(length rs - 1)) (last rs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dims (tensors_from_net (witness'_l rs) $ j) = replicate (2 ^ (length rs - 1)) (last rs)
[PROOF STEP]
using dims_output_deep_model' assms witness'_is_deep_model
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 \<le> length ?rs; \<And>r. r \<in> set ?rs \<Longrightarrow> 0 < r; ?j < ?rs ! 0; remove_weights ?m = deep_model'_l ?rs\<rbrakk> \<Longrightarrow> dims (tensors_from_net ?m $ ?j) = replicate (2 ^ (length ?rs - 1)) (last ?rs)
1 \<le> length rs
?r \<in> set rs \<Longrightarrow> 0 < ?r
j < rs ! 0
remove_weights (witness' ?Y ?rs) = deep_model' ?Y ?rs

goal (1 subgoal):
 1. dims (tensors_from_net (witness'_l rs) $ j) = replicate (2 ^ (length rs - 1)) (last rs)
[PROOF STEP]
by blast


[STATEMENT]
lemma linorder_finite_sup_selective:
  fixes f :: "'a::finite \<Rightarrow> 'b::linorder_stone_algebra_expansion"
  shows "\<exists>i . (\<Squnion>\<^sub>k f k) = f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. sup_monoid.sum f {k. True} = f i
[PROOF STEP]
apply (induct rule: comp_inf.one_sup_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<exists>ia. f i = f ia
 2. \<And>j I. \<lbrakk>j \<notin> I; \<exists>i. sup_monoid.sum f I = f i\<rbrakk> \<Longrightarrow> \<exists>i. f j \<squnion> sup_monoid.sum f I = f i
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j I. \<lbrakk>j \<notin> I; \<exists>i. sup_monoid.sum f I = f i\<rbrakk> \<Longrightarrow> \<exists>i. f j \<squnion> sup_monoid.sum f I = f i
[PROOF STEP]
using sup_selective
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> ?y = ?x \<or> ?x \<squnion> ?y = ?y

goal (1 subgoal):
 1. \<And>j I. \<lbrakk>j \<notin> I; \<exists>i. sup_monoid.sum f I = f i\<rbrakk> \<Longrightarrow> \<exists>i. f j \<squnion> sup_monoid.sum f I = f i
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sum_mset_Bag[code]: "sum_mset (Bag ms) = DAList_Multiset.fold (\<lambda>a n. (((+) a) ^^ n)) 0 ms"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (Bag ms) = DAList_Multiset.fold (\<lambda>a. (^^) ((+) a)) (0::'a) ms
[PROOF STEP]
unfolding sum_mset.eq_fold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold_mset (+) (0::'a) (Bag ms) = DAList_Multiset.fold (\<lambda>a. (^^) ((+) a)) (0::'a) ms
[PROOF STEP]
apply (rule comp_fun_commute.DAList_Multiset_fold)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. comp_fun_commute (+)
 2. \<And>a n x. ((+) a ^^ n) x = ((+) a ^^ n) x
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>y x. (+) y \<circ> (+) x = (+) x \<circ> (+) y
 2. \<And>a n x. ((+) a ^^ n) x = ((+) a ^^ n) x
[PROOF STEP]
apply (auto simp: ac_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done

\<comment> \<open>we cannot use \<open>\<lambda>a n. (*) (a ^ n)\<close> for folding, since \<open>(^)\<close> is not defined in \<open>comm_monoid_mult\<close>\<close>


[STATEMENT]
lemma lcl_trans_l:
  assumes "locally_compatible_l R1 R2 (A + B) (C + D) (E + F)"
  shows "locally_compatible_l R1 R2 A C E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally_compatible_l R1 R2 A C E
[PROOF STEP]
using assms[unfolded locally_compatible_l_def, rule_format]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?t \<in># A + B; ?u \<in># C + D; ?v \<in># E + F; (?t, ?u) \<in> R1; (?u, ?v) \<in> R2\<rbrakk> \<Longrightarrow> (?t, ?v) \<in> R2

goal (1 subgoal):
 1. locally_compatible_l R1 R2 A C E
[PROOF STEP]
unfolding locally_compatible_l_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?t \<in># A + B; ?u \<in># C + D; ?v \<in># E + F; (?t, ?u) \<in> R1; (?u, ?v) \<in> R2\<rbrakk> \<Longrightarrow> (?t, ?v) \<in> R2

goal (1 subgoal):
 1. \<forall>t u v. t \<in># A \<longrightarrow> u \<in># C \<longrightarrow> v \<in># E \<longrightarrow> (t, u) \<in> R1 \<longrightarrow> (u, v) \<in> R2 \<longrightarrow> (t, v) \<in> R2
[PROOF STEP]
by auto


[STATEMENT]
lemma construct_add:
  assumes B[simp]: "vs1.independent B"
  shows "construct B (\<lambda>x. f x + g x) v = construct B f v + construct B g v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. construct B (\<lambda>x. f x + g x) v = construct B f v + construct B g v
[PROOF STEP]
proof (rule linear_eq_on)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. linear (*a) (*b) (construct B (\<lambda>x. f x + g x))
 2. linear (*a) (*b) (\<lambda>a. construct B f a + construct B g a)
 3. v \<in> vs1.span ?B
 4. \<And>b. b \<in> ?B \<Longrightarrow> construct B (\<lambda>x. f x + g x) b = construct B f b + construct B g b
[PROOF STEP]
show "v \<in> vs1.span (vs1.extend_basis B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> vs1.span (vs1.extend_basis B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<in> vs1.span (vs1.extend_basis B)

goal (3 subgoals):
 1. linear (*a) (*b) (construct B (\<lambda>x. f x + g x))
 2. linear (*a) (*b) (\<lambda>a. construct B f a + construct B g a)
 3. \<And>b. b \<in> vs1.extend_basis B \<Longrightarrow> construct B (\<lambda>x. f x + g x) b = construct B f b + construct B g b
[PROOF STEP]
show "b \<in> vs1.extend_basis B \<Longrightarrow> construct B (\<lambda>x. f x + g x) b = construct B f b + construct B g b" for b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> vs1.extend_basis B \<Longrightarrow> construct B (\<lambda>x. f x + g x) b = construct B f b + construct B g b
[PROOF STEP]
using construct_outside[OF B vs1.span_base, of b]
[PROOF STATE]
proof (prove)
using this:
b \<in> vs1.extend_basis B - B \<Longrightarrow> construct B ?f b = (0::'c)

goal (1 subgoal):
 1. b \<in> vs1.extend_basis B \<Longrightarrow> construct B (\<lambda>x. f x + g x) b = construct B f b + construct B g b
[PROOF STEP]
by (cases "b \<in> B") (auto simp: construct_basis)
[PROOF STATE]
proof (state)
this:
?b \<in> vs1.extend_basis B \<Longrightarrow> construct B (\<lambda>x. f x + g x) ?b = construct B f ?b + construct B g ?b

goal (2 subgoals):
 1. linear (*a) (*b) (construct B (\<lambda>x. f x + g x))
 2. linear (*a) (*b) (\<lambda>a. construct B f a + construct B g a)
[PROOF STEP]
qed (intro linear_compose_add linear_construct B)+


[STATEMENT]
lemma rbt_max_simps:
  assumes "is_rbt (Branch c lt k v RBT_Impl.Empty)"
  shows "rbt_max (Branch c lt k v RBT_Impl.Empty) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbt_max (Branch c lt k v rbt.Empty) = k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rbt_max (Branch c lt k v rbt.Empty) = k
[PROOF STEP]
have "List.fold max (tl (rev(RBT_Impl.keys lt @ [k]))) (hd (rev(RBT_Impl.keys lt @ [k]))) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold max (tl (rev (RBT_Impl.keys lt @ [k]))) (hd (rev (RBT_Impl.keys lt @ [k]))) = k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_rbt (Branch c lt k v rbt.Empty)

goal (1 subgoal):
 1. fold max (tl (rev (RBT_Impl.keys lt @ [k]))) (hd (rev (RBT_Impl.keys lt @ [k]))) = k
[PROOF STEP]
by (auto intro!: fold_max_triv dest!: left_le_key is_rbt_rbt_sorted)
[PROOF STATE]
proof (state)
this:
fold max (tl (rev (RBT_Impl.keys lt @ [k]))) (hd (rev (RBT_Impl.keys lt @ [k]))) = k

goal (1 subgoal):
 1. rbt_max (Branch c lt k v rbt.Empty) = k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fold max (tl (rev (RBT_Impl.keys lt @ [k]))) (hd (rev (RBT_Impl.keys lt @ [k]))) = k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fold max (tl (rev (RBT_Impl.keys lt @ [k]))) (hd (rev (RBT_Impl.keys lt @ [k]))) = k

goal (1 subgoal):
 1. rbt_max (Branch c lt k v rbt.Empty) = k
[PROOF STEP]
by (auto simp add: rbt_max_def rbt_fold1_keys_def fold_max_rev_eq)
[PROOF STATE]
proof (state)
this:
rbt_max (Branch c lt k v rbt.Empty) = k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distinct_adj_rev [simp]: "distinct_adj (rev xs) \<longleftrightarrow> distinct_adj xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_adj (rev xs) = distinct_adj xs
[PROOF STEP]
by (simp add: distinct_adj_def eq_commute)


[STATEMENT]
lemma nprv_subst:
assumes "x \<in> var" "t \<in> trm" "\<psi> \<in> fmla" "finite F" "F \<subseteq> fmla"
and 1: "nprv F \<psi>"
shows "nprv ((\<lambda>\<phi>. subst \<phi> t x) ` F) (subst \<psi> t x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nprv ((\<lambda>\<phi>. subst \<phi> t x) ` F) (subst \<psi> t x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> var
t \<in> trm
\<psi> \<in> fmla
finite F
F \<subseteq> fmla
nprv F \<psi>

goal (1 subgoal):
 1. nprv ((\<lambda>\<phi>. subst \<phi> t x) ` F) (subst \<psi> t x)
[PROOF STEP]
using prv_subst[OF _ _ _ 1[unfolded nprv_def]]
[PROOF STATE]
proof (prove)
using this:
x \<in> var
t \<in> trm
\<psi> \<in> fmla
finite F
F \<subseteq> fmla
nprv F \<psi>
\<lbrakk>?x \<in> var; imp (scnj F) \<psi> \<in> fmla; ?t \<in> trm\<rbrakk> \<Longrightarrow> prv (subst (imp (scnj F) \<psi>) ?t ?x)

goal (1 subgoal):
 1. nprv ((\<lambda>\<phi>. subst \<phi> t x) ` F) (subst \<psi> t x)
[PROOF STEP]
unfolding nprv_def
[PROOF STATE]
proof (prove)
using this:
x \<in> var
t \<in> trm
\<psi> \<in> fmla
finite F
F \<subseteq> fmla
prv (imp (scnj F) \<psi>)
\<lbrakk>?x \<in> var; imp (scnj F) \<psi> \<in> fmla; ?t \<in> trm\<rbrakk> \<Longrightarrow> prv (subst (imp (scnj F) \<psi>) ?t ?x)

goal (1 subgoal):
 1. prv (imp (scnj ((\<lambda>\<phi>. subst \<phi> t x) ` F)) (subst \<psi> t x))
[PROOF STEP]
by (intro prv_prv_imp_trans[OF _ _ _ prv_subst_scnj_imp]) auto