[STATEMENT]
theorem is_inf_uniq: "is_inf x y i \<Longrightarrow> is_inf x y i' \<Longrightarrow> i = i'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_inf x y i; is_inf x y i'\<rbrakk> \<Longrightarrow> i = i'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>is_inf x y i; is_inf x y i'\<rbrakk> \<Longrightarrow> i = i'
[PROOF STEP]
assume inf: "is_inf x y i"
[PROOF STATE]
proof (state)
this:
is_inf x y i

goal (1 subgoal):
 1. \<lbrakk>is_inf x y i; is_inf x y i'\<rbrakk> \<Longrightarrow> i = i'
[PROOF STEP]
assume inf': "is_inf x y i'"
[PROOF STATE]
proof (state)
this:
is_inf x y i'

goal (1 subgoal):
 1. \<lbrakk>is_inf x y i; is_inf x y i'\<rbrakk> \<Longrightarrow> i = i'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = i'
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i \<sqsubseteq> i'
 2. i' \<sqsubseteq> i
[PROOF STEP]
from inf'
[PROOF STATE]
proof (chain)
picking this:
is_inf x y i'
[PROOF STEP]
show "i \<sqsubseteq> i'"
[PROOF STATE]
proof (prove)
using this:
is_inf x y i'

goal (1 subgoal):
 1. i \<sqsubseteq> i'
[PROOF STEP]
proof (rule is_inf_greatest)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i \<sqsubseteq> x
 2. i \<sqsubseteq> y
[PROOF STEP]
from inf
[PROOF STATE]
proof (chain)
picking this:
is_inf x y i
[PROOF STEP]
show "i \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
using this:
is_inf x y i

goal (1 subgoal):
 1. i \<sqsubseteq> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
i \<sqsubseteq> x

goal (1 subgoal):
 1. i \<sqsubseteq> y
[PROOF STEP]
from inf
[PROOF STATE]
proof (chain)
picking this:
is_inf x y i
[PROOF STEP]
show "i \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
using this:
is_inf x y i

goal (1 subgoal):
 1. i \<sqsubseteq> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
i \<sqsubseteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i \<sqsubseteq> i'

goal (1 subgoal):
 1. i' \<sqsubseteq> i
[PROOF STEP]
from inf
[PROOF STATE]
proof (chain)
picking this:
is_inf x y i
[PROOF STEP]
show "i' \<sqsubseteq> i"
[PROOF STATE]
proof (prove)
using this:
is_inf x y i

goal (1 subgoal):
 1. i' \<sqsubseteq> i
[PROOF STEP]
proof (rule is_inf_greatest)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i' \<sqsubseteq> x
 2. i' \<sqsubseteq> y
[PROOF STEP]
from inf'
[PROOF STATE]
proof (chain)
picking this:
is_inf x y i'
[PROOF STEP]
show "i' \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
using this:
is_inf x y i'

goal (1 subgoal):
 1. i' \<sqsubseteq> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
i' \<sqsubseteq> x

goal (1 subgoal):
 1. i' \<sqsubseteq> y
[PROOF STEP]
from inf'
[PROOF STATE]
proof (chain)
picking this:
is_inf x y i'
[PROOF STEP]
show "i' \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
using this:
is_inf x y i'

goal (1 subgoal):
 1. i' \<sqsubseteq> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
i' \<sqsubseteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i' \<sqsubseteq> i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i = i'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma neg_closed : "g \<in> G \<Longrightarrow> -g \<in> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> G \<Longrightarrow> - g \<in> G
[PROOF STEP]
using zero_closed diff_closed[of 0 g]
[PROOF STATE]
proof (prove)
using this:
(0::'g) \<in> G
\<lbrakk>(0::'g) \<in> G; g \<in> G\<rbrakk> \<Longrightarrow> (0::'g) - g \<in> G

goal (1 subgoal):
 1. g \<in> G \<Longrightarrow> - g \<in> G
[PROOF STEP]
by simp


[STATEMENT]
lemma bounded_linear_image:
  assumes "bounded S"
    and "bounded_linear f"
  shows "bounded (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (f ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded (f ` S)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
bounded S
[PROOF STEP]
obtain b where "b > 0" and b: "\<forall>x\<in>S. norm x \<le> b"
[PROOF STATE]
proof (prove)
using this:
bounded S

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>0 < b; \<forall>x\<in>S. norm x \<le> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding bounded_pos
[PROOF STATE]
proof (prove)
using this:
\<exists>b>0. \<forall>x\<in>S. norm x \<le> b

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>0 < b; \<forall>x\<in>S. norm x \<le> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < b
\<forall>x\<in>S. norm x \<le> b

goal (1 subgoal):
 1. bounded (f ` S)
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
bounded_linear f
[PROOF STEP]
obtain B where B: "B > 0" "\<forall>x. norm (f x) \<le> B * norm x"
[PROOF STATE]
proof (prove)
using this:
bounded_linear f

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>0 < B; \<forall>x. norm (f x) \<le> B * norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using bounded_linear.pos_bounded
[PROOF STATE]
proof (prove)
using this:
bounded_linear f
bounded_linear ?f \<Longrightarrow> \<exists>K>0. \<forall>x. norm (?f x) \<le> norm x * K

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>0 < B; \<forall>x. norm (f x) \<le> B * norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: ac_simps)
[PROOF STATE]
proof (state)
this:
0 < B
\<forall>x. norm (f x) \<le> B * norm x

goal (1 subgoal):
 1. bounded (f ` S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (f ` S)
[PROOF STEP]
unfolding bounded_pos
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b>0. \<forall>x\<in>f ` S. norm x \<le> b
[PROOF STEP]
proof (intro exI, safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < ?b
 2. \<And>x xa. xa \<in> S \<Longrightarrow> norm (f xa) \<le> ?b
[PROOF STEP]
show "norm (f x) \<le> B * b" if "x \<in> S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x) \<le> B * b
[PROOF STEP]
by (meson B b less_imp_le mult_left_mono order_trans that)
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> norm (f ?x) \<le> B * b

goal (1 subgoal):
 1. 0 < B * b
[PROOF STEP]
qed (use \<open>b > 0\<close> \<open>B > 0\<close> in auto)
[PROOF STATE]
proof (state)
this:
bounded (f ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma HFinite_FreeUltrafilterNat:
  assumes "star_n X \<in> HFinite"
  shows "\<exists>u. eventually (\<lambda>n. norm (X n) < u) \<U>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u. \<forall>\<^sub>F n in \<U>. norm (X n) < u
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u. \<forall>\<^sub>F n in \<U>. norm (X n) < u
[PROOF STEP]
obtain r where "hnorm (star_n X) < hypreal_of_real r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. hnorm (star_n X) < hypreal_of_real r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using HFiniteD SReal_iff assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> HFinite \<Longrightarrow> \<exists>t\<in>\<real>. hnorm ?x < t
(?x \<in> \<real>) = (\<exists>y. ?x = hypreal_of_real y)
star_n X \<in> HFinite

goal (1 subgoal):
 1. (\<And>r. hnorm (star_n X) < hypreal_of_real r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
hnorm (star_n X) < hypreal_of_real r

goal (1 subgoal):
 1. \<exists>u. \<forall>\<^sub>F n in \<U>. norm (X n) < u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
hnorm (star_n X) < hypreal_of_real r
[PROOF STEP]
have "\<forall>\<^sub>F n in \<U>. norm (X n) < r"
[PROOF STATE]
proof (prove)
using this:
hnorm (star_n X) < hypreal_of_real r

goal (1 subgoal):
 1. \<forall>\<^sub>F n in \<U>. norm (X n) < r
[PROOF STEP]
by (simp add: hnorm_def star_n_less star_of_def starfun_star_n)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in \<U>. norm (X n) < r

goal (1 subgoal):
 1. \<exists>u. \<forall>\<^sub>F n in \<U>. norm (X n) < u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in \<U>. norm (X n) < r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in \<U>. norm (X n) < r

goal (1 subgoal):
 1. \<exists>u. \<forall>\<^sub>F n in \<U>. norm (X n) < u
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>u. \<forall>\<^sub>F n in \<U>. norm (X n) < u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma keys_lower: "keys (lower p v) = {u\<in>keys p. u \<prec>\<^sub>t v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (lower p v) = {u \<in> keys p. u \<prec>\<^sub>t v}
[PROOF STEP]
by (rule set_eqI, simp only: in_keys_iff, simp add: lookup_lower)


[STATEMENT]
lemma transpose_infmatrix_twice[simp]: "transpose_infmatrix (transpose_infmatrix A) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose_infmatrix (transpose_infmatrix A) = A
[PROOF STEP]
by ((rule ext)+, simp)


[STATEMENT]
lemma aboveS_aboveS_trans:
assumes TRANS: "trans r" and ANTISYM: "antisym r" and
        IN1: "b \<in> aboveS r a" and IN2: "c \<in> aboveS r b"
shows "c \<in> aboveS r a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> aboveS r a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<in> aboveS r a
[PROOF STEP]
have "b \<in> above r a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> above r a
[PROOF STEP]
using IN1 aboveS_subset_above
[PROOF STATE]
proof (prove)
using this:
b \<in> aboveS r a
aboveS ?r ?a \<subseteq> above ?r ?a

goal (1 subgoal):
 1. b \<in> above r a
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
b \<in> above r a

goal (1 subgoal):
 1. c \<in> aboveS r a
[PROOF STEP]
with assms above_aboveS_trans
[PROOF STATE]
proof (chain)
picking this:
trans r
antisym r
b \<in> aboveS r a
c \<in> aboveS r b
\<lbrakk>trans ?r; antisym ?r; ?b \<in> above ?r ?a; ?c \<in> aboveS ?r ?b\<rbrakk> \<Longrightarrow> ?c \<in> aboveS ?r ?a
b \<in> above r a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
trans r
antisym r
b \<in> aboveS r a
c \<in> aboveS r b
\<lbrakk>trans ?r; antisym ?r; ?b \<in> above ?r ?a; ?c \<in> aboveS ?r ?b\<rbrakk> \<Longrightarrow> ?c \<in> aboveS ?r ?a
b \<in> above r a

goal (1 subgoal):
 1. c \<in> aboveS r a
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
c \<in> aboveS r a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monoI1: "\<forall>m. \<forall>n \<ge> m. X m \<le> X n \<Longrightarrow> monoseq X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m n. m \<le> n \<longrightarrow> X m \<le> X n \<Longrightarrow> monoseq X
[PROOF STEP]
by (simp add: monoseq_def)


[STATEMENT]
lemma E_wfD: assumes "(v,v') \<in> E"
      shows "v \<in> V" "v' \<in> V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> V &&& v' \<in> V
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. v \<in> V
 2. v' \<in> V
[PROOF STEP]
apply (rule subsetD[OF E_wf(1)])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. v \<in> fst ` E
 2. v' \<in> V
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(v, v') \<in> E

goal (2 subgoals):
 1. v \<in> fst ` E
 2. v' \<in> V
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v' \<in> V
[PROOF STEP]
apply (rule subsetD[OF E_wf(2)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v' \<in> snd ` E
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(v, v') \<in> E

goal (1 subgoal):
 1. v' \<in> snd ` E
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma c_pair_sum_mono: "(x1::nat) + y1 < x2 + y2 \<Longrightarrow> c_pair x1 y1 < c_pair x2 y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 + y1 < x2 + y2 \<Longrightarrow> c_pair x1 y1 < c_pair x2 y2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x1 + y1 < x2 + y2 \<Longrightarrow> c_pair x1 y1 < c_pair x2 y2
[PROOF STEP]
assume "(x1::nat) + y1 < x2 + y2"
[PROOF STATE]
proof (state)
this:
x1 + y1 < x2 + y2

goal (1 subgoal):
 1. x1 + y1 < x2 + y2 \<Longrightarrow> c_pair x1 y1 < c_pair x2 y2
[PROOF STEP]
hence "sf (x1+y1) + (x1+y1) < sf(x2+y2)"
[PROOF STATE]
proof (prove)
using this:
x1 + y1 < x2 + y2

goal (1 subgoal):
 1. sf (x1 + y1) + (x1 + y1) < sf (x2 + y2)
[PROOF STEP]
by (rule sf_aux4)
[PROOF STATE]
proof (state)
this:
sf (x1 + y1) + (x1 + y1) < sf (x2 + y2)

goal (1 subgoal):
 1. x1 + y1 < x2 + y2 \<Longrightarrow> c_pair x1 y1 < c_pair x2 y2
[PROOF STEP]
hence "sf (x1+y1) + x1 < sf(x2+y2) + x2"
[PROOF STATE]
proof (prove)
using this:
sf (x1 + y1) + (x1 + y1) < sf (x2 + y2)

goal (1 subgoal):
 1. sf (x1 + y1) + x1 < sf (x2 + y2) + x2
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
sf (x1 + y1) + x1 < sf (x2 + y2) + x2

goal (1 subgoal):
 1. x1 + y1 < x2 + y2 \<Longrightarrow> c_pair x1 y1 < c_pair x2 y2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
sf (x1 + y1) + x1 < sf (x2 + y2) + x2

goal (1 subgoal):
 1. c_pair x1 y1 < c_pair x2 y2
[PROOF STEP]
by (simp add: c_pair_def)
[PROOF STATE]
proof (state)
this:
c_pair x1 y1 < c_pair x2 y2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_as_map_containment :
  assumes "(x,y) \<in> zs"
  shows "y \<in> (m2f (set_as_map zs)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> (case set_as_map zs x of None \<Rightarrow> {} | Some xs \<Rightarrow> xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> zs

goal (1 subgoal):
 1. y \<in> (case set_as_map zs x of None \<Rightarrow> {} | Some xs \<Rightarrow> xs)
[PROOF STEP]
unfolding set_as_map_def
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> zs

goal (1 subgoal):
 1. y \<in> (case if \<exists>z. (x, z) \<in> zs then Some {z. (x, z) \<in> zs} else None of None \<Rightarrow> {} | Some xs \<Rightarrow> xs)
[PROOF STEP]
by auto


[STATEMENT]
lemma competitive_equilibriumD [dest]:
  assumes "competitive_equilibrium P X Y"
  shows "feasible X Y \<and>
         (\<forall>j \<in> firms. (Y j) \<in> profit_maximisation P (production_sets j)) \<and>
         (\<forall>i \<in> agents. (X i) \<in> arg_max_set U[i] (budget_constraint (calculate_value P) consumption_set (poe_wealth P i Y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. feasible X Y \<and> (\<forall>j\<in>firms. Y j \<in> profit_maximisation P (production_sets j)) \<and> (\<forall>i\<in>agents. X i \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i Y)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
competitive_equilibrium P X Y

goal (1 subgoal):
 1. feasible X Y \<and> (\<forall>j\<in>firms. Y j \<in> profit_maximisation P (production_sets j)) \<and> (\<forall>i\<in>agents. X i \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i Y)))
[PROOF STEP]
by (simp add: competitive_equilibrium_def)


[STATEMENT]
lemma path_length_n_finite_set:
"wf_prog wf_md P \<Longrightarrow> finite{Cs. Subobjs P C Cs \<and> length Cs = n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_prog wf_md P \<Longrightarrow> finite {Cs. Subobjs P C Cs \<and> length Cs = n}
[PROOF STEP]
by (rule_tac B="{Cs. set Cs <= {C. is_class P C} \<and> length Cs = n}" in finite_subset,
  auto dest:path_contains_classes intro:max_length_finite_set simp:finite_is_class)


[STATEMENT]
lemma power_down_mono:
  "power_down prec a n \<le> power_down prec b n"
  if "((0 \<le> a \<and> a \<le> b)\<or>(odd n \<and> a \<le> b) \<or> (even n \<and> a \<le> 0 \<and> b \<le> a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. power_down prec a n \<le> power_down prec b n
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 \<le> a \<and> a \<le> b \<or> odd n \<and> a \<le> b \<or> even n \<and> a \<le> 0 \<and> b \<le> a

goal (1 subgoal):
 1. power_down prec a n \<le> power_down prec b n
[PROOF STEP]
proof (induction n arbitrary: a b rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x a b. \<lbrakk>\<And>y a b. \<lbrakk>y < x; 0 \<le> a \<and> a \<le> b \<or> odd y \<and> a \<le> b \<or> even y \<and> a \<le> 0 \<and> b \<le> a\<rbrakk> \<Longrightarrow> power_down prec a y \<le> power_down prec b y; 0 \<le> a \<and> a \<le> b \<or> odd x \<and> a \<le> b \<or> even x \<and> a \<le> 0 \<and> b \<le> a\<rbrakk> \<Longrightarrow> power_down prec a x \<le> power_down prec b x
[PROOF STEP]
case (less i)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y < i; 0 \<le> ?a \<and> ?a \<le> ?b \<or> odd ?y \<and> ?a \<le> ?b \<or> even ?y \<and> ?a \<le> 0 \<and> ?b \<le> ?a\<rbrakk> \<Longrightarrow> power_down prec ?a ?y \<le> power_down prec ?b ?y
0 \<le> a \<and> a \<le> b \<or> odd i \<and> a \<le> b \<or> even i \<and> a \<le> 0 \<and> b \<le> a

goal (1 subgoal):
 1. \<And>x a b. \<lbrakk>\<And>y a b. \<lbrakk>y < x; 0 \<le> a \<and> a \<le> b \<or> odd y \<and> a \<le> b \<or> even y \<and> a \<le> 0 \<and> b \<le> a\<rbrakk> \<Longrightarrow> power_down prec a y \<le> power_down prec b y; 0 \<le> a \<and> a \<le> b \<or> odd x \<and> a \<le> b \<or> even x \<and> a \<le> 0 \<and> b \<le> a\<rbrakk> \<Longrightarrow> power_down prec a x \<le> power_down prec b x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. power_down prec a i \<le> power_down prec b i
[PROOF STEP]
proof (cases i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = 0 \<Longrightarrow> power_down prec a i \<le> power_down prec b i
 2. \<And>nat. i = Suc nat \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
case j: (Suc j)
[PROOF STATE]
proof (state)
this:
i = Suc j

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> power_down prec a i \<le> power_down prec b i
 2. \<And>nat. i = Suc nat \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
note IH = less[unfolded j even_Suc not_not]
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y < Suc j; 0 \<le> ?a \<and> ?a \<le> ?b \<or> odd ?y \<and> ?a \<le> ?b \<or> even ?y \<and> ?a \<le> 0 \<and> ?b \<le> ?a\<rbrakk> \<Longrightarrow> power_down prec ?a ?y \<le> power_down prec ?b ?y
0 \<le> a \<and> a \<le> b \<or> even j \<and> a \<le> b \<or> odd j \<and> a \<le> 0 \<and> b \<le> a

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> power_down prec a i \<le> power_down prec b i
 2. \<And>nat. i = Suc nat \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
note [simp del] = power_down.simps
[PROOF STATE]
proof (state)
this:
power_down ?p ?x 0 = 1
power_down ?p ?x (Suc ?n) = (if odd ?n then truncate_down (Suc ?p) ((power_down ?p ?x (Suc ?n div 2))\<^sup>2) else truncate_down (Suc ?p) (?x * power_down ?p ?x ?n))

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> power_down prec a i \<le> power_down prec b i
 2. \<And>nat. i = Suc nat \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. power_down prec a i \<le> power_down prec b i
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> power_down prec a i \<le> power_down prec b i
 2. \<not> ?P \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
assume [simp]: "even j"
[PROOF STATE]
proof (state)
this:
even j

goal (2 subgoals):
 1. ?P \<Longrightarrow> power_down prec a i \<le> power_down prec b i
 2. \<not> ?P \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
have "a * power_down prec a j \<le> b * power_down prec b j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * power_down prec a j \<le> b * power_down prec b j
[PROOF STEP]
by (metis IH(1) IH(2) \<open>even j\<close> lessI linear mult_mono mult_mono' mult_mono_nonpos_nonneg power_down_even_nonneg)
[PROOF STATE]
proof (state)
this:
a * power_down prec a j \<le> b * power_down prec b j

goal (2 subgoals):
 1. ?P \<Longrightarrow> power_down prec a i \<le> power_down prec b i
 2. \<not> ?P \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a * power_down prec a j \<le> b * power_down prec b j
[PROOF STEP]
have "truncate_down (Suc prec) (a * power_down prec a j) \<le> truncate_down (Suc prec) (b * power_down prec b j)"
[PROOF STATE]
proof (prove)
using this:
a * power_down prec a j \<le> b * power_down prec b j

goal (1 subgoal):
 1. truncate_down (Suc prec) (a * power_down prec a j) \<le> truncate_down (Suc prec) (b * power_down prec b j)
[PROOF STEP]
by (auto intro!: truncate_down_mono simp: abs_le_square_iff[symmetric] abs_real_def)
[PROOF STATE]
proof (state)
this:
truncate_down (Suc prec) (a * power_down prec a j) \<le> truncate_down (Suc prec) (b * power_down prec b j)

goal (2 subgoals):
 1. ?P \<Longrightarrow> power_down prec a i \<le> power_down prec b i
 2. \<not> ?P \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
truncate_down (Suc prec) (a * power_down prec a j) \<le> truncate_down (Suc prec) (b * power_down prec b j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
truncate_down (Suc prec) (a * power_down prec a j) \<le> truncate_down (Suc prec) (b * power_down prec b j)

goal (1 subgoal):
 1. power_down prec a i \<le> power_down prec b i
[PROOF STEP]
unfolding j
[PROOF STATE]
proof (prove)
using this:
truncate_down (Suc prec) (a * power_down prec a j) \<le> truncate_down (Suc prec) (b * power_down prec b j)

goal (1 subgoal):
 1. power_down prec a (Suc j) \<le> power_down prec b (Suc j)
[PROOF STEP]
by (simp add: power_down_simp)
[PROOF STATE]
proof (state)
this:
power_down prec a i \<le> power_down prec b i

goal (1 subgoal):
 1. odd j \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. odd j \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
assume [simp]: "odd j"
[PROOF STATE]
proof (state)
this:
odd j

goal (1 subgoal):
 1. odd j \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
have "power_down prec 0 (Suc (j div 2)) \<le> - power_down prec b (Suc (j div 2))"
        if "b < 0" "even (j div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. power_down prec 0 (Suc (j div 2)) \<le> - power_down prec b (Suc (j div 2))
[PROOF STEP]
apply (rule order_trans[where y=0])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. power_down prec 0 (Suc (j div 2)) \<le> 0
 2. 0 \<le> - power_down prec b (Suc (j div 2))
[PROOF STEP]
using IH that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y < Suc j; 0 \<le> ?a \<and> ?a \<le> ?b \<or> odd ?y \<and> ?a \<le> ?b \<or> even ?y \<and> ?a \<le> 0 \<and> ?b \<le> ?a\<rbrakk> \<Longrightarrow> power_down prec ?a ?y \<le> power_down prec ?b ?y
0 \<le> a \<and> a \<le> b \<or> even j \<and> a \<le> b \<or> odd j \<and> a \<le> 0 \<and> b \<le> a
b < 0
even (j div 2)

goal (2 subgoals):
 1. power_down prec 0 (Suc (j div 2)) \<le> 0
 2. 0 \<le> - power_down prec b (Suc (j div 2))
[PROOF STEP]
by (auto simp: div2_less_self)
[PROOF STATE]
proof (state)
this:
\<lbrakk>b < 0; even (j div 2)\<rbrakk> \<Longrightarrow> power_down prec 0 (Suc (j div 2)) \<le> - power_down prec b (Suc (j div 2))

goal (1 subgoal):
 1. odd j \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>b < 0; even (j div 2)\<rbrakk> \<Longrightarrow> power_down prec 0 (Suc (j div 2)) \<le> - power_down prec b (Suc (j div 2))
[PROOF STEP]
have "truncate_down (Suc prec) ((power_down prec a (Suc (j div 2)))\<^sup>2)
        \<le> truncate_down (Suc prec) ((power_down prec b (Suc (j div 2)))\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>b < 0; even (j div 2)\<rbrakk> \<Longrightarrow> power_down prec 0 (Suc (j div 2)) \<le> - power_down prec b (Suc (j div 2))

goal (1 subgoal):
 1. truncate_down (Suc prec) ((power_down prec a (Suc (j div 2)))\<^sup>2) \<le> truncate_down (Suc prec) ((power_down prec b (Suc (j div 2)))\<^sup>2)
[PROOF STEP]
using IH
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>b < 0; even (j div 2)\<rbrakk> \<Longrightarrow> power_down prec 0 (Suc (j div 2)) \<le> - power_down prec b (Suc (j div 2))
\<lbrakk>?y < Suc j; 0 \<le> ?a \<and> ?a \<le> ?b \<or> odd ?y \<and> ?a \<le> ?b \<or> even ?y \<and> ?a \<le> 0 \<and> ?b \<le> ?a\<rbrakk> \<Longrightarrow> power_down prec ?a ?y \<le> power_down prec ?b ?y
0 \<le> a \<and> a \<le> b \<or> even j \<and> a \<le> b \<or> odd j \<and> a \<le> 0 \<and> b \<le> a

goal (1 subgoal):
 1. truncate_down (Suc prec) ((power_down prec a (Suc (j div 2)))\<^sup>2) \<le> truncate_down (Suc prec) ((power_down prec b (Suc (j div 2)))\<^sup>2)
[PROOF STEP]
by (auto intro!: truncate_down_mono intro: order_trans[where y=0]
            simp: abs_le_square_iff[symmetric] abs_real_def
            div2_less_self)
[PROOF STATE]
proof (state)
this:
truncate_down (Suc prec) ((power_down prec a (Suc (j div 2)))\<^sup>2) \<le> truncate_down (Suc prec) ((power_down prec b (Suc (j div 2)))\<^sup>2)

goal (1 subgoal):
 1. odd j \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
truncate_down (Suc prec) ((power_down prec a (Suc (j div 2)))\<^sup>2) \<le> truncate_down (Suc prec) ((power_down prec b (Suc (j div 2)))\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
truncate_down (Suc prec) ((power_down prec a (Suc (j div 2)))\<^sup>2) \<le> truncate_down (Suc prec) ((power_down prec b (Suc (j div 2)))\<^sup>2)

goal (1 subgoal):
 1. power_down prec a i \<le> power_down prec b i
[PROOF STEP]
unfolding j
[PROOF STATE]
proof (prove)
using this:
truncate_down (Suc prec) ((power_down prec a (Suc (j div 2)))\<^sup>2) \<le> truncate_down (Suc prec) ((power_down prec b (Suc (j div 2)))\<^sup>2)

goal (1 subgoal):
 1. power_down prec a (Suc j) \<le> power_down prec b (Suc j)
[PROOF STEP]
by (simp add: power_down_simp)
[PROOF STATE]
proof (state)
this:
power_down prec a i \<le> power_down prec b i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
power_down prec a i \<le> power_down prec b i

goal (1 subgoal):
 1. i = 0 \<Longrightarrow> power_down prec a i \<le> power_down prec b i
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
power_down prec a i \<le> power_down prec b i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comp_lunit_lunit' [simp]:
    assumes "ide a"
    shows "\<l>[a] \<cdot> \<l>\<^sup>-\<^sup>1[a] = a"
    and "\<l>\<^sup>-\<^sup>1[a] \<cdot> \<l>[a] = \<I> \<otimes> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<l>[a] \<cdot> \<l>\<^sup>-\<^sup>1[a] = a &&& \<l>\<^sup>-\<^sup>1[a] \<cdot> \<l>[a] = \<I> \<otimes> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<l>[a] \<cdot> \<l>\<^sup>-\<^sup>1[a] = a
 2. \<l>\<^sup>-\<^sup>1[a] \<cdot> \<l>[a] = \<I> \<otimes> a
[PROOF STEP]
show "\<l>[a] \<cdot> \<l>\<^sup>-\<^sup>1[a] = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<l>[a] \<cdot> \<l>\<^sup>-\<^sup>1[a] = a
[PROOF STEP]
using assms comp_arr_inv lunit_inv
[PROOF STATE]
proof (prove)
using this:
ide a
inverse_arrows ?f ?g \<Longrightarrow> ?f \<cdot> ?g = local.dom ?g
ide ?a \<Longrightarrow> inverse_arrows \<l>[?a] \<l>\<^sup>-\<^sup>1[?a]

goal (1 subgoal):
 1. \<l>[a] \<cdot> \<l>\<^sup>-\<^sup>1[a] = a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<l>[a] \<cdot> \<l>\<^sup>-\<^sup>1[a] = a

goal (1 subgoal):
 1. \<l>\<^sup>-\<^sup>1[a] \<cdot> \<l>[a] = \<I> \<otimes> a
[PROOF STEP]
show "\<l>\<^sup>-\<^sup>1[a] \<cdot> \<l>[a] = \<I> \<otimes> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<l>\<^sup>-\<^sup>1[a] \<cdot> \<l>[a] = \<I> \<otimes> a
[PROOF STEP]
using assms comp_arr_inv lunit_inv
[PROOF STATE]
proof (prove)
using this:
ide a
inverse_arrows ?f ?g \<Longrightarrow> ?f \<cdot> ?g = local.dom ?g
ide ?a \<Longrightarrow> inverse_arrows \<l>[?a] \<l>\<^sup>-\<^sup>1[?a]

goal (1 subgoal):
 1. \<l>\<^sup>-\<^sup>1[a] \<cdot> \<l>[a] = \<I> \<otimes> a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<l>\<^sup>-\<^sup>1[a] \<cdot> \<l>[a] = \<I> \<otimes> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inDed_mono[simplified inDed_def]: "inDed x ==> set x <= set y ==> inDed y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inDed x; set x \<subseteq> set y\<rbrakk> \<Longrightarrow> inDed y
[PROOF STEP]
using perm_weak_contr_mono[OF perm contr weak]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set ?x \<subseteq> set ?y; inDed ?x\<rbrakk> \<Longrightarrow> inDed ?y

goal (1 subgoal):
 1. \<lbrakk>inDed x; set x \<subseteq> set y\<rbrakk> \<Longrightarrow> inDed y
[PROOF STEP]
.


[STATEMENT]
lemma blinding_of_G_mono:
  assumes "boa \<le> boa'" "bob \<le> bob'"
  shows "blinding_of_G rha boa rhb bob \<le> blinding_of_G rha boa' rhb bob'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blinding_of_G rha boa rhb bob \<le> blinding_of_G rha boa' rhb bob'
[PROOF STEP]
unfolding blinding_of_G_unfold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vimage2p the_G\<^sub>m the_G\<^sub>m (blinding_of_F (root_hash_T rha) (blinding_of_T rha boa) rhb bob) \<le> vimage2p the_G\<^sub>m the_G\<^sub>m (blinding_of_F (root_hash_T rha) (blinding_of_T rha boa') rhb bob')
[PROOF STEP]
by(rule vimage2p_mono' blinding_of_F_mono blinding_of_T_mono assms)+


[STATEMENT]
lemma vec_to_iarray_show_vec_real[code_unfold]: "vec_to_iarray (show_vec_real v)
  = show_vec_real_iarrays (vec_to_iarray v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray (show_vec_real v) = show_vec_real_iarrays (vec_to_iarray v)
[PROOF STEP]
unfolding show_vec_real_def show_vec_real_iarrays_def vec_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.of_fun (\<lambda>i. (\<chi>i. show_real (v $ i)) $ mod_type_class.from_nat i) CARD('a) = IArray.of_fun (\<lambda>i. show_real (IArray.of_fun (\<lambda>i. v $ mod_type_class.from_nat i) CARD('a) !! i)) (IArray.length (IArray.of_fun (\<lambda>i. v $ mod_type_class.from_nat i) CARD('a)))
[PROOF STEP]
by auto


[STATEMENT]
lemma continuous_image_subset_rel_interior:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes contf: "continuous_on S f" and injf: "inj_on f S" and fim: "f ` S \<subseteq> T"
      and TS: "aff_dim T \<le> aff_dim S"
  shows "f ` (rel_interior S) \<subseteq> rel_interior(f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` rel_interior S \<subseteq> rel_interior (f ` S)
[PROOF STEP]
proof (rule rel_interior_maximal)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` rel_interior S \<subseteq> f ` S
 2. openin (top_of_set (affine hull f ` S)) (f ` rel_interior S)
[PROOF STEP]
show "f ` rel_interior S \<subseteq> f ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` rel_interior S \<subseteq> f ` S
[PROOF STEP]
by(simp add: image_mono rel_interior_subset)
[PROOF STATE]
proof (state)
this:
f ` rel_interior S \<subseteq> f ` S

goal (1 subgoal):
 1. openin (top_of_set (affine hull f ` S)) (f ` rel_interior S)
[PROOF STEP]
show "openin (top_of_set (affine hull f ` S)) (f ` rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set (affine hull f ` S)) (f ` rel_interior S)
[PROOF STEP]
proof (rule invariance_of_domain_affine_sets)
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. openin (top_of_set ?U) (rel_interior S)
 2. affine ?U
 3. affine (affine hull f ` S)
 4. aff_dim (affine hull f ` S) \<le> aff_dim ?U
 5. continuous_on (rel_interior S) f
 6. f ` rel_interior S \<subseteq> affine hull f ` S
 7. inj_on f (rel_interior S)
[PROOF STEP]
show "openin (top_of_set (affine hull S)) (rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set (affine hull S)) (rel_interior S)
[PROOF STEP]
by (simp add: openin_rel_interior)
[PROOF STATE]
proof (state)
this:
openin (top_of_set (affine hull S)) (rel_interior S)

goal (6 subgoals):
 1. affine (affine hull S)
 2. affine (affine hull f ` S)
 3. aff_dim (affine hull f ` S) \<le> aff_dim (affine hull S)
 4. continuous_on (rel_interior S) f
 5. f ` rel_interior S \<subseteq> affine hull f ` S
 6. inj_on f (rel_interior S)
[PROOF STEP]
show "aff_dim (affine hull f ` S) \<le> aff_dim (affine hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim (affine hull f ` S) \<le> aff_dim (affine hull S)
[PROOF STEP]
by (metis aff_dim_affine_hull aff_dim_subset fim TS order_trans)
[PROOF STATE]
proof (state)
this:
aff_dim (affine hull f ` S) \<le> aff_dim (affine hull S)

goal (5 subgoals):
 1. affine (affine hull S)
 2. affine (affine hull f ` S)
 3. continuous_on (rel_interior S) f
 4. f ` rel_interior S \<subseteq> affine hull f ` S
 5. inj_on f (rel_interior S)
[PROOF STEP]
show "f ` rel_interior S \<subseteq> affine hull f ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` rel_interior S \<subseteq> affine hull f ` S
[PROOF STEP]
by (meson \<open>f ` rel_interior S \<subseteq> f ` S\<close> hull_subset order_trans)
[PROOF STATE]
proof (state)
this:
f ` rel_interior S \<subseteq> affine hull f ` S

goal (4 subgoals):
 1. affine (affine hull S)
 2. affine (affine hull f ` S)
 3. continuous_on (rel_interior S) f
 4. inj_on f (rel_interior S)
[PROOF STEP]
show "continuous_on (rel_interior S) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (rel_interior S) f
[PROOF STEP]
using contf continuous_on_subset rel_interior_subset
[PROOF STATE]
proof (prove)
using this:
continuous_on S f
\<lbrakk>continuous_on ?s ?f; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> continuous_on ?t ?f
rel_interior ?S \<subseteq> ?S

goal (1 subgoal):
 1. continuous_on (rel_interior S) f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on (rel_interior S) f

goal (3 subgoals):
 1. affine (affine hull S)
 2. affine (affine hull f ` S)
 3. inj_on f (rel_interior S)
[PROOF STEP]
show "inj_on f (rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f (rel_interior S)
[PROOF STEP]
using inj_on_subset injf rel_interior_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>inj_on ?f ?A; ?B \<subseteq> ?A\<rbrakk> \<Longrightarrow> inj_on ?f ?B
inj_on f S
rel_interior ?S \<subseteq> ?S

goal (1 subgoal):
 1. inj_on f (rel_interior S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on f (rel_interior S)

goal (2 subgoals):
 1. affine (affine hull S)
 2. affine (affine hull f ` S)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
openin (top_of_set (affine hull f ` S)) (f ` rel_interior S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma remove1_single_empty_iff[simp]: \<open>remove1_mset L {#L'#} = {#} \<longleftrightarrow> L = L'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (remove1_mset L {#L'#} = {#}) = (L = L')
[PROOF STEP]
using add_mset_remove_trivial_iff
[PROOF STATE]
proof (prove)
using this:
(?N = add_mset ?a (remove1_mset ?b ?N)) = (?a \<in># ?N \<and> ?a = ?b)

goal (1 subgoal):
 1. (remove1_mset L {#L'#} = {#}) = (L = L')
[PROOF STEP]
by fastforce


[STATEMENT]
lemma euler_64:
  "\<bar>exp 1 - 50143449209799256683 / 2 ^ 64\<bar> \<le> inverse (2 ^ 64 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>exp 1 - 50143449209799256683 / 2 ^ 64\<bar> \<le> inverse (2 ^ 64)
[PROOF STEP]
by (rule approx_coarsen[OF euler_128]) simp_all


[STATEMENT]
lemma Suc_add_max_le[simp]:
  "(Suc(n + max i j) \<le> m) = (Suc(n + i) \<le> m \<and> Suc(n + j) \<le> m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Suc (n + max i j) \<le> m) = (Suc (n + i) \<le> m \<and> Suc (n + j) \<le> m)
[PROOF STEP]
by arith


[STATEMENT]
lemma pw_REC_nofail:
  shows "nofail (REC B x) \<longleftrightarrow> trimono B \<and>
  (\<exists>F. (\<forall>x.
    nofail (F x) \<longrightarrow> nofail (B F x)
    \<and> (\<forall>x'. inres (B F x) x' \<longrightarrow> inres (F x) x')
  ) \<and> nofail (F x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nofail (REC B x) = (trimono B \<and> (\<exists>F. (\<forall>x. nofail (F x) \<longrightarrow> nofail (B F x) \<and> (\<forall>x'. inres (B F x) x' \<longrightarrow> inres (F x) x')) \<and> nofail (F x)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nofail (REC B x) = (trimono B \<and> (\<exists>F. (\<forall>x. nofail (F x) \<longrightarrow> nofail (B F x) \<and> (\<forall>x'. inres (B F x) x' \<longrightarrow> inres (F x) x')) \<and> nofail (F x)))
[PROOF STEP]
have "nofail (REC B x) \<longleftrightarrow> trimono B \<and>
  (\<exists>F. (\<forall>x. B F x \<le> F x) \<and> nofail (F x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nofail (REC B x) = (trimono B \<and> (\<exists>F. (\<forall>x. B F x \<le> F x) \<and> nofail (F x)))
[PROOF STEP]
unfolding REC_def lfp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nofail (if trimono B then Inf {u. B u \<le> u} x else FAIL) = (trimono B \<and> (\<exists>F. (\<forall>x. B F x \<le> F x) \<and> nofail (F x)))
[PROOF STEP]
apply (auto simp: refine_pw_simps intro: le_funI dest: le_funD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
nofail (REC B x) = (trimono B \<and> (\<exists>F. (\<forall>x. B F x \<le> F x) \<and> nofail (F x)))

goal (1 subgoal):
 1. nofail (REC B x) = (trimono B \<and> (\<exists>F. (\<forall>x. nofail (F x) \<longrightarrow> nofail (B F x) \<and> (\<forall>x'. inres (B F x) x' \<longrightarrow> inres (F x) x')) \<and> nofail (F x)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
nofail (REC B x) = (trimono B \<and> (\<exists>F. (\<forall>x. B F x \<le> F x) \<and> nofail (F x)))

goal (1 subgoal):
 1. nofail (REC B x) = (trimono B \<and> (\<exists>F. (\<forall>x. nofail (F x) \<longrightarrow> nofail (B F x) \<and> (\<forall>x'. inres (B F x) x' \<longrightarrow> inres (F x) x')) \<and> nofail (F x)))
[PROOF STEP]
unfolding pw_le_iff
[PROOF STATE]
proof (prove)
using this:
nofail (REC B x) = (trimono B \<and> (\<exists>F. (\<forall>x. nofail (F x) \<longrightarrow> nofail (B F x) \<and> (\<forall>xa. inres (B F x) xa \<longrightarrow> inres (F x) xa)) \<and> nofail (F x)))

goal (1 subgoal):
 1. nofail (REC B x) = (trimono B \<and> (\<exists>F. (\<forall>x. nofail (F x) \<longrightarrow> nofail (B F x) \<and> (\<forall>x'. inres (B F x) x' \<longrightarrow> inres (F x) x')) \<and> nofail (F x)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
nofail (REC B x) = (trimono B \<and> (\<exists>F. (\<forall>x. nofail (F x) \<longrightarrow> nofail (B F x) \<and> (\<forall>x'. inres (B F x) x' \<longrightarrow> inres (F x) x')) \<and> nofail (F x)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l11_62_unicity:
  assumes "Coplanar A B C D" and
    "Coplanar A B C D'" and
    "\<forall> E. Coplanar A B C E \<longrightarrow> Per E D P" and
    "\<forall> E. Coplanar A B C E \<longrightarrow> Per E D' P"
  shows "D = D'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D = D'
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) assms(4) l8_8 not_col_distincts per_not_colp)


[STATEMENT]
lemma godel_code'_set[simp]:
  "{u. Pi (Suc i) ^ u dvd (Suc (Suc 0)) ^ length nl *
                                     godel_code' nl (Suc 0)} =
    {u. Pi (Suc i) ^ u dvd  godel_code' nl (Suc 0)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {u. Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0)} = {u. Pi (Suc i) ^ u dvd godel_code' nl (Suc 0)}
[PROOF STEP]
apply(rule_tac Collect_cong, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u. Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0) \<Longrightarrow> Pi (Suc i) ^ u dvd godel_code' nl (Suc 0)
[PROOF STEP]
apply(rule_tac n = " (Suc (Suc 0)) ^ length nl" in
      coprime_dvd_mult_nat2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>u. Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0) \<Longrightarrow> coprime (Pi (Suc i) ^ u) (Suc (Suc 0) ^ length nl)
 2. \<And>u. Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0) \<Longrightarrow> Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>u. Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0) \<Longrightarrow> coprime (Pi (Suc i) ^ u) (Suc (Suc 0) ^ length nl)
 2. \<And>u. Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0) \<Longrightarrow> Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0)
[PROOF STEP]
have "Pi 0 = (2::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi 0 = 2
[PROOF STEP]
by(simp add: Pi.simps)
[PROOF STATE]
proof (state)
this:
Pi 0 = 2

goal (2 subgoals):
 1. \<And>u. Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0) \<Longrightarrow> coprime (Pi (Suc i) ^ u) (Suc (Suc 0) ^ length nl)
 2. \<And>u. Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0) \<Longrightarrow> Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0)
[PROOF STEP]
show "coprime (Pi (Suc i) ^ u) ((Suc (Suc 0)) ^ length nl)" for u
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (Pi (Suc i) ^ u) (Suc (Suc 0) ^ length nl)
[PROOF STEP]
using Pi_coprime Pi.simps(1)
[PROOF STATE]
proof (prove)
using this:
?i \<noteq> ?j \<Longrightarrow> coprime (Pi ?i) (Pi ?j)
Pi 0 = 2

goal (1 subgoal):
 1. coprime (Pi (Suc i) ^ u) (Suc (Suc 0) ^ length nl)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
coprime (Pi (Suc i) ^ ?u) (Suc (Suc 0) ^ length nl)

goal (1 subgoal):
 1. \<And>u. Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0) \<Longrightarrow> Pi (Suc i) ^ u dvd Suc (Suc 0) ^ length nl * godel_code' nl (Suc 0)
[PROOF STEP]
qed


[STATEMENT]
lemma tri_next3_id:
 "|vertices f| = 3 \<Longrightarrow> distinct(vertices f) \<Longrightarrow> v \<in> \<V> f
  \<Longrightarrow> f \<bullet> (f \<bullet> (f \<bullet> v)) = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>triangle f; distinct (vertices f); v \<in> \<V> f\<rbrakk> \<Longrightarrow> f \<bullet> (f \<bullet> (f \<bullet> v)) = v
[PROOF STEP]
apply(subgoal_tac "\<forall>(i::nat) < 3. (((((i+1) mod 3)+1) mod 3)+1) mod 3 = i")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>triangle f; distinct (vertices f); v \<in> \<V> f; \<forall>i<3. (((i + 1) mod 3 + 1) mod 3 + 1) mod 3 = i\<rbrakk> \<Longrightarrow> f \<bullet> (f \<bullet> (f \<bullet> v)) = v
 2. \<lbrakk>triangle f; distinct (vertices f); v \<in> \<V> f\<rbrakk> \<Longrightarrow> \<forall>i<3. (((i + 1) mod 3 + 1) mod 3 + 1) mod 3 = i
[PROOF STEP]
apply(clarsimp simp:in_set_conv_nth nextVertex_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>triangle f; distinct (vertices f); v \<in> \<V> f\<rbrakk> \<Longrightarrow> \<forall>i<3. (((i + 1) mod 3 + 1) mod 3 + 1) mod 3 = i
[PROOF STEP]
apply(presburger)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mod_ring_unit_factor_integer: "(mod_ring_rel_integer ===> mod_ring_rel_integer) (\<lambda>x. x) unit_factor"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mod_ring_rel_integer ===> mod_ring_rel_integer) (\<lambda>x. x) unit_factor
[PROOF STEP]
using mod_ring_unit_factor
[PROOF STATE]
proof (prove)
using this:
(mod_ring_rel ===> mod_ring_rel) (\<lambda>x. x) unit_factor

goal (1 subgoal):
 1. (mod_ring_rel_integer ===> mod_ring_rel_integer) (\<lambda>x. x) unit_factor
[PROOF STEP]
unfolding mod_ring_rel_integer_def[OF *] rel_fun_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. mod_ring_rel x y \<longrightarrow> mod_ring_rel x (unit_factor y)

goal (1 subgoal):
 1. \<forall>x y. (\<exists>z. urel_integer x z \<and> mod_ring_rel z y) \<longrightarrow> (\<exists>z. urel_integer x z \<and> mod_ring_rel z (unit_factor y))
[PROOF STEP]
by blast


[STATEMENT]
lemma del_UnEdge_odd_even:
    assumes "valid_unMultigraph G" "finite(edges G)" "finite(nodes G)" "(v, w, v')\<in>edges G"
    assumes parity_assms: "odd (degree v G)" "even (degree v' G)"
    shows "num_of_odd_nodes(del_unEdge v w v' G)=num_of_odd_nodes G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. num_of_odd_nodes (del_unEdge v w v' G) = num_of_odd_nodes G
[PROOF STEP]
by (metis assms del_UnEdge_even_odd delete_edge_sym parity_assms valid_unMultigraph.corres)


[STATEMENT]
lemma thetaIfTT_sym:
"sym thetaIfTT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym thetaIfTT
[PROOF STEP]
unfolding thetaIfTT_def sym_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(if tst then c1 else c2, if tst then d1 else d2) |tst c1 c2 d1 d2. compatTst tst \<and> c1 \<approx>T d1 \<and> c2 \<approx>T d2} \<longrightarrow> (y, x) \<in> {(if tst then c1 else c2, if tst then d1 else d2) |tst c1 c2 d1 d2. compatTst tst \<and> c1 \<approx>T d1 \<and> c2 \<approx>T d2}
[PROOF STEP]
using BisT_Sym
[PROOF STATE]
proof (prove)
using this:
?c \<approx>T ?d \<Longrightarrow> ?d \<approx>T ?c

goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(if tst then c1 else c2, if tst then d1 else d2) |tst c1 c2 d1 d2. compatTst tst \<and> c1 \<approx>T d1 \<and> c2 \<approx>T d2} \<longrightarrow> (y, x) \<in> {(if tst then c1 else c2, if tst then d1 else d2) |tst c1 c2 d1 d2. compatTst tst \<and> c1 \<approx>T d1 \<and> c2 \<approx>T d2}
[PROOF STEP]
by blast


[STATEMENT]
lemma (in field) split_aux_correct:
  "in_carrier xs \<Longrightarrow>
    peval xs (PExpr2 (PPow e\<^sub>1 n)) =
    peval xs (PExpr2 (PMul (fst (split_aux e\<^sub>1 n e\<^sub>2)) (fst (snd (split_aux e\<^sub>1 n e\<^sub>2)))))"
  "in_carrier xs \<Longrightarrow>
    peval xs e\<^sub>2 =
    peval xs (PExpr2 (PMul (snd (snd (split_aux e\<^sub>1 n e\<^sub>2))) (fst (snd (split_aux e\<^sub>1 n e\<^sub>2)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (in_carrier xs \<Longrightarrow> peval xs (PExpr2 (PPow e\<^sub>1 n)) = peval xs (PExpr2 (PMul (fst (split_aux e\<^sub>1 n e\<^sub>2)) (fst (snd (split_aux e\<^sub>1 n e\<^sub>2)))))) &&& (in_carrier xs \<Longrightarrow> peval xs e\<^sub>2 = peval xs (PExpr2 (PMul (snd (snd (split_aux e\<^sub>1 n e\<^sub>2))) (fst (snd (split_aux e\<^sub>1 n e\<^sub>2))))))
[PROOF STEP]
by (induct e\<^sub>1 n e\<^sub>2 rule: split_aux_induct)
    (auto simp add: split_beta
       nat_pow_distrib nat_pow_pow nat_pow_mult m_ac
       npemul_correct npepow_correct isin_correct'
       split: option.split)


[STATEMENT]
lemma CSP1_CSP2_commute: "CSP1 o CSP2 = CSP2 o CSP1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CSP1 \<circ> CSP2 = CSP2 \<circ> CSP1
[PROOF STEP]
by (auto simp: csp_defs fun_eq_iff)


[STATEMENT]
lemma SA_poly_to_Qp_poly_taylor_poly:
  assumes "F \<in> carrier (UP (SA n))"
  assumes "c \<in> carrier (SA n)"
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  shows "SA_poly_to_Qp_poly n a (taylor_expansion (SA n) c F) =
        taylor_expansion Q\<^sub>p (c a) (SA_poly_to_Qp_poly n a F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SA_poly_to_Qp_poly n a (taylor_expansion (SA n) c F) = taylor_expansion Q\<^sub>p (c a) (SA_poly_to_Qp_poly n a F)
[PROOF STEP]
unfolding SA_poly_to_Qp_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) (taylor_expansion (SA n) c F) = taylor_expansion Q\<^sub>p (c a) (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) F)
[PROOF STEP]
using assms Qp.cring_axioms SA_is_cring eval_hom_def
      eval_hom_is_SA_hom UP_cring.poly_lift_hom_comm_taylor_expansion[of "SA n" Q\<^sub>p "eval_hom a" F c] ring_hom_ring.homh
[PROOF STATE]
proof (prove)
using this:
F \<in> carrier (UP (SA n))
c \<in> carrier (SA n)
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
cring Q\<^sub>p
cring (SA ?n)
eval_hom ?a = (\<lambda>f. f ?a)
?a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> ring_hom_ring (SA ?n) Q\<^sub>p (eval_hom ?a)
\<lbrakk>UP_cring (SA n); cring Q\<^sub>p; eval_hom a \<in> ring_hom (SA n) Q\<^sub>p; F \<in> carrier (UP (SA n)); c \<in> carrier (SA n)\<rbrakk> \<Longrightarrow> poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) (taylor_expansion (SA n) c F) = taylor_expansion Q\<^sub>p (eval_hom a c) (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) F)
ring_hom_ring ?R ?S ?h \<Longrightarrow> ?h \<in> ring_hom ?R ?S

goal (1 subgoal):
 1. poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) (taylor_expansion (SA n) c F) = taylor_expansion Q\<^sub>p (c a) (poly_lift_hom (SA n) Q\<^sub>p (eval_hom a) F)
[PROOF STEP]
unfolding  SA_poly_to_Qp_poly_def eval_hom_def UP_cring_def
[PROOF STATE]
proof (prove)
using this:
F \<in> carrier (UP (SA n))
c \<in> carrier (SA n)
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
cring Q\<^sub>p
cring (SA ?n)
(\<lambda>f. f ?a) = (\<lambda>f. f ?a)
?a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> ring_hom_ring (SA ?n) Q\<^sub>p (\<lambda>f. f ?a)
\<lbrakk>cring (SA n); cring Q\<^sub>p; (\<lambda>f. f a) \<in> ring_hom (SA n) Q\<^sub>p; F \<in> carrier (UP (SA n)); c \<in> carrier (SA n)\<rbrakk> \<Longrightarrow> poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) (taylor_expansion (SA n) c F) = taylor_expansion Q\<^sub>p (c a) (poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) F)
ring_hom_ring ?R ?S ?h \<Longrightarrow> ?h \<in> ring_hom ?R ?S

goal (1 subgoal):
 1. poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) (taylor_expansion (SA n) c F) = taylor_expansion Q\<^sub>p (c a) (poly_lift_hom (SA n) Q\<^sub>p (\<lambda>f. f a) F)
[PROOF STEP]
by metis


[STATEMENT]
lemma NSDERIV_chain:
  "NSDERIV f (g x) :> Da \<Longrightarrow> NSDERIV g x :> Db \<Longrightarrow> NSDERIV (f \<circ> g) x :> Da * Db"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>NSDERIV f (g x) :> Da; NSDERIV g x :> Db\<rbrakk> \<Longrightarrow> NSDERIV (f \<circ> g) x :> Da * Db
[PROOF STEP]
using DERIV_NS_iff DERIV_chain NSDERIV_NSLIM_iff
[PROOF STATE]
proof (prove)
using this:
(?f has_field_derivative ?D) (at ?x) = (\<lambda>h. (?f (?x + h) - ?f ?x) / h) \<midarrow>0::?'a\<rightarrow>\<^sub>N\<^sub>S ?D
\<lbrakk>(?f has_field_derivative ?Da) (at (?g ?x)); (?g has_field_derivative ?Db) (at ?x within ?s)\<rbrakk> \<Longrightarrow> (?f \<circ> ?g has_field_derivative ?Da * ?Db) (at ?x within ?s)
NSDERIV ?f ?x :> ?D = (\<lambda>h. (?f (?x + h) - ?f ?x) / h) \<midarrow>0::?'a\<rightarrow>\<^sub>N\<^sub>S ?D

goal (1 subgoal):
 1. \<lbrakk>NSDERIV f (g x) :> Da; NSDERIV g x :> Db\<rbrakk> \<Longrightarrow> NSDERIV (f \<circ> g) x :> Da * Db
[PROOF STEP]
by blast


[STATEMENT]
lemma lcm_coprime: "coprime a b \<Longrightarrow> lcm a b = normalize (a * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime a b \<Longrightarrow> lcm a b = normalize (a * b)
[PROOF STEP]
by (subst lcm_gcd) simp


[STATEMENT]
lemma numeral_nat: "(numeral m1 :: nat) * numeral n1 \<equiv> numeral (m1 * n1)"
  "(numeral m1 :: nat) + numeral n1 \<equiv> numeral (m1 + n1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral m1 * numeral n1 \<equiv> numeral (m1 * n1)) &&& numeral m1 + numeral n1 \<equiv> numeral (m1 + n1)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma [code abstract]:
  "integer_of_natural (m * n) = integer_of_natural m * integer_of_natural n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_natural (m * n) = integer_of_natural m * integer_of_natural n
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma quotient_group_lift_to_quotient_set:
  "\<lbrakk> Subgroup H; normal H; g\<in>G \<rbrakk> \<Longrightarrow> (\<lceil>g|H\<rceil>) \<rightarrow> H = LCoset_rel H `` {g}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Subgroup H; normal H; g \<in> G\<rbrakk> \<Longrightarrow> BinOpSetGroup.Abs_G_perm (G // LCoset_rel H) (+) (LCoset_rel H `` {g}) \<rightarrow> H = LCoset_rel H `` {g}
[PROOF STEP]
using LCoset_rel_quotientI
        BinOpSetGroup.G_perm_apply_identity[
          OF BinOpSetGroup_normal_quotient
        ]
[PROOF STATE]
proof (prove)
using this:
?x \<in> G \<Longrightarrow> LCoset_rel ?uu `` {?x} \<in> G // LCoset_rel ?uu
\<lbrakk>Subgroup ?e; normal ?e; ?g \<in> G // LCoset_rel ?e\<rbrakk> \<Longrightarrow> BinOpSetGroup.Abs_G_perm (G // LCoset_rel ?e) (+) ?g \<rightarrow> ?e = ?g

goal (1 subgoal):
 1. \<lbrakk>Subgroup H; normal H; g \<in> G\<rbrakk> \<Longrightarrow> BinOpSetGroup.Abs_G_perm (G // LCoset_rel H) (+) (LCoset_rel H `` {g}) \<rightarrow> H = LCoset_rel H `` {g}
[PROOF STEP]
by    simp


[STATEMENT]
lemma mk_poly_delete[simp]:
  assumes i: "i < dim_row A"
  shows "mat_delete (mk_poly A) i (dim_col A - 1) = map_mat coeff_lift (mat_delete A i (dim_col A - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_delete (mk_poly A) i (dim_col A - 1) = coeff_lift_hom.mat_hom (mat_delete A i (dim_col A - 1))
[PROOF STEP]
apply(rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ia j. \<lbrakk>ia < dim_row (coeff_lift_hom.mat_hom (mat_delete A i (dim_col A - 1))); j < dim_col (coeff_lift_hom.mat_hom (mat_delete A i (dim_col A - 1)))\<rbrakk> \<Longrightarrow> mat_delete (mk_poly A) i (dim_col A - 1) $$ (ia, j) = coeff_lift_hom.mat_hom (mat_delete A i (dim_col A - 1)) $$ (ia, j)
 2. dim_row (mat_delete (mk_poly A) i (dim_col A - 1)) = dim_row (coeff_lift_hom.mat_hom (mat_delete A i (dim_col A - 1)))
 3. dim_col (mat_delete (mk_poly A) i (dim_col A - 1)) = dim_col (coeff_lift_hom.mat_hom (mat_delete A i (dim_col A - 1)))
[PROOF STEP]
unfolding mat_delete_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ia j. \<lbrakk>ia < dim_row (coeff_lift_hom.mat_hom (mat (dim_row A - 1) (dim_col A - 1) (\<lambda>(i', j'). A $$ (if i' < i then i' else Suc i', if j' < dim_col A - 1 then j' else Suc j')))); j < dim_col (coeff_lift_hom.mat_hom (mat (dim_row A - 1) (dim_col A - 1) (\<lambda>(i', j'). A $$ (if i' < i then i' else Suc i', if j' < dim_col A - 1 then j' else Suc j'))))\<rbrakk> \<Longrightarrow> mat (dim_row (mk_poly A) - 1) (dim_col (mk_poly A) - 1) (\<lambda>(i', j'). mk_poly A $$ (if i' < i then i' else Suc i', if j' < dim_col A - 1 then j' else Suc j')) $$ (ia, j) = coeff_lift_hom.mat_hom (mat (dim_row A - 1) (dim_col A - 1) (\<lambda>(i', j'). A $$ (if i' < i then i' else Suc i', if j' < dim_col A - 1 then j' else Suc j'))) $$ (ia, j)
 2. dim_row (mat (dim_row (mk_poly A) - 1) (dim_col (mk_poly A) - 1) (\<lambda>(i', j'). mk_poly A $$ (if i' < i then i' else Suc i', if j' < dim_col A - 1 then j' else Suc j'))) = dim_row (coeff_lift_hom.mat_hom (mat (dim_row A - 1) (dim_col A - 1) (\<lambda>(i', j'). A $$ (if i' < i then i' else Suc i', if j' < dim_col A - 1 then j' else Suc j'))))
 3. dim_col (mat (dim_row (mk_poly A) - 1) (dim_col (mk_poly A) - 1) (\<lambda>(i', j'). mk_poly A $$ (if i' < i then i' else Suc i', if j' < dim_col A - 1 then j' else Suc j'))) = dim_col (coeff_lift_hom.mat_hom (mat (dim_row A - 1) (dim_col A - 1) (\<lambda>(i', j'). A $$ (if i' < i then i' else Suc i', if j' < dim_col A - 1 then j' else Suc j'))))
[PROOF STEP]
by auto


[STATEMENT]
lemma fls_base_factor_to_fps_mult:
  fixes f g :: "'a::semiring_no_zero_divisors fls"
  shows "fls_base_factor_to_fps (f * g) = fls_base_factor_to_fps f * fls_base_factor_to_fps g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor_to_fps (f * g) = fls_base_factor_to_fps f * fls_base_factor_to_fps g
[PROOF STEP]
using fls_base_factor_to_fps_mult'[of f g]
[PROOF STATE]
proof (prove)
using this:
f $$ fls_subdegree f * g $$ fls_subdegree g \<noteq> (0::'a) \<Longrightarrow> fls_base_factor_to_fps (f * g) = fls_base_factor_to_fps f * fls_base_factor_to_fps g

goal (1 subgoal):
 1. fls_base_factor_to_fps (f * g) = fls_base_factor_to_fps f * fls_base_factor_to_fps g
[PROOF STEP]
by    (cases "f=0 \<or> g=0") auto


[STATEMENT]
lemma cexpr_sem_integrate_var':
  "extract_real (cexpr_sem \<sigma> (integrate_var \<Gamma> v e)) =
      (\<integral>x. extract_real (cexpr_sem (\<sigma>(v := x)) e) \<partial>stock_measure (\<Gamma> v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extract_real (cexpr_sem \<sigma> (integrate_var \<Gamma> v e)) = LINT x|stock_measure (\<Gamma> v). extract_real (cexpr_sem (\<sigma>(v := x)) e)
[PROOF STEP]
by (subst cexpr_sem_integrate_var, simp add: extract_real_def)


[STATEMENT]
lemma poly_const_pow: "[:a:]^b = [:a^b:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:a:] ^ b = [:a ^ b:]
[PROOF STEP]
by (metis Groups.mult_ac(2) monom_0 monom_power mult_zero_right)


[STATEMENT]
lemma tr_filter_conc_eq:
"(a@b = (tr_filter (a@c) cs)) = (b = (tr_filter c cs) & a = (tr_filter a cs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a @ b = tr_filter (a @ c) cs) = (b = tr_filter c cs \<and> a = tr_filter a cs)
[PROOF STEP]
apply (rule, rule)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. a @ b = tr_filter (a @ c) cs \<Longrightarrow> b = tr_filter c cs
 2. a @ b = tr_filter (a @ c) cs \<Longrightarrow> a = tr_filter a cs
 3. b = tr_filter c cs \<and> a = tr_filter a cs \<Longrightarrow> a @ b = tr_filter (a @ c) cs
[PROOF STEP]
apply (rule tr_filter_conc_eq1[rule_format, of a], clarsimp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a @ b = tr_filter (a @ c) cs \<Longrightarrow> a = tr_filter a cs
 2. b = tr_filter c cs \<and> a = tr_filter a cs \<Longrightarrow> a @ b = tr_filter (a @ c) cs
[PROOF STEP]
apply (rule tr_filter_conc_eq2[rule_format, of a b c], clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b = tr_filter c cs \<and> a = tr_filter a cs \<Longrightarrow> a @ b = tr_filter (a @ c) cs
[PROOF STEP]
apply (clarsimp simp: tr_filter_conc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in \<Z>) vfst_arrow_is_cat_Set_arr'[cat_rel_par_Set_cs_intros]:
  assumes "A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "AB = A \<times>\<^sub>\<circ> B"
    and "A' = A"
    and "\<CC>' = cat_Set \<alpha>"
  shows "vfst_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> A'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfst_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> A'
[PROOF STEP]
using assms(1-2)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vfst_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> A'
[PROOF STEP]
unfolding assms(3-5)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vfst_arrow A B : A \<times>\<^sub>\<circ> B \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> A
[PROOF STEP]
by (rule vfst_arrow_is_cat_Set_arr)


[STATEMENT]
lemma set_integrable_UN:
  fixes f :: "_ \<Rightarrow> _ :: {banach, second_countable_topology}"
  assumes "finite I" "\<And>i. i\<in>I \<Longrightarrow> set_integrable M (A i) f"
    "\<And>i. i\<in>I \<Longrightarrow> A i \<in> sets M"
  shows "set_integrable M (\<Union>i\<in>I. A i) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable M (\<Union> (A ` I)) f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
?i \<in> I \<Longrightarrow> set_integrable M (A ?i) f
?i \<in> I \<Longrightarrow> A ?i \<in> sets M

goal (1 subgoal):
 1. set_integrable M (\<Union> (A ` I)) f
[PROOF STEP]
by (induct I) (auto simp: set_integrable_Un sets.finite_UN)


[STATEMENT]
lemma star_left_induct_mult_iff:
  "x * y \<le> y \<longleftrightarrow> x\<^sup>\<star> * y \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * y \<le> y) = (x\<^sup>\<star> * y \<le> y)
[PROOF STEP]
using mult_left_isotone order_trans star.circ_increasing star_left_induct_mult
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<Longrightarrow> ?x * ?z \<le> ?y * ?z
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z
?x \<le> ?x\<^sup>\<star>
?x * ?y \<le> ?y \<Longrightarrow> ?x\<^sup>\<star> * ?y \<le> ?y

goal (1 subgoal):
 1. (x * y \<le> y) = (x\<^sup>\<star> * y \<le> y)
[PROOF STEP]
by blast


[STATEMENT]
lemma in_set_replicate[simp]: "(x \<in> set (replicate n y)) = (x = y \<and> n \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> set (replicate n y)) = (x = y \<and> n \<noteq> 0)
[PROOF STEP]
by (simp add: set_replicate_conv_if)


[STATEMENT]
lemma finite_sets_finite_univ :
  assumes "finite (UNIV :: 'a set)"
  shows "finite (xs :: 'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite xs
[PROOF STEP]
by (metis Diff_UNIV Diff_infinite_finite assms finite_Diff)


[STATEMENT]
lemma r_lifz [simp]:
  assumes "length xs = n" and "recfn n f" and "recfn n g"
  shows "eval (r_lifz f g) (c # xs) = (if c = 0 then eval f xs else eval g xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (r_lifz f g) (c # xs) = (if c = 0 then eval f xs else eval g xs)
[PROOF STEP]
using assms r_lazyifzero r_lifz_def wellf_arity_nonzero
[PROOF STATE]
proof (prove)
using this:
length xs = n
recfn n f
recfn n g
\<lbrakk>length ?xs = Suc ?n; ?j\<^sub>1 = encode ?f\<^sub>1; ?j\<^sub>2 = encode ?f\<^sub>2; recfn (Suc ?n) ?f\<^sub>1; recfn (Suc ?n) ?f\<^sub>2\<rbrakk> \<Longrightarrow> eval (r_lazyifzero ?n ?j\<^sub>1 ?j\<^sub>2) (?c # ?xs) = (if ?c = 0 then eval ?f\<^sub>1 ?xs else eval ?f\<^sub>2 ?xs)
r_lifz ?f ?g \<equiv> r_lazyifzero (arity ?f - 1) (encode ?f) (encode ?g)
wellf ?f \<Longrightarrow> 0 < arity ?f

goal (1 subgoal):
 1. eval (r_lifz f g) (c # xs) = (if c = 0 then eval f xs else eval g xs)
[PROOF STEP]
by (metis One_nat_def Suc_pred)


[STATEMENT]
lemma set_lebesgue_integral_cong:
  assumes "A \<in> sets M" and "\<forall>x. x \<in> A \<longrightarrow> f x = g x"
  shows "(LINT x:A|M. f x) = (LINT x:A|M. g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_lebesgue_integral M A f = set_lebesgue_integral M A g
[PROOF STEP]
unfolding set_lebesgue_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. indicat_real A x *\<^sub>R f x = LINT x|M. indicat_real A x *\<^sub>R g x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> sets M
\<forall>x. x \<in> A \<longrightarrow> f x = g x

goal (1 subgoal):
 1. LINT x|M. indicat_real A x *\<^sub>R f x = LINT x|M. indicat_real A x *\<^sub>R g x
[PROOF STEP]
by (metis indicator_simps(2) real_vector.scale_zero_left)


[STATEMENT]
lemma function_zero_as_constant:
"\<zero>\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub> = Qp_const n \<zero>\<^bsub>Q\<^sub>p\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> = constant_function (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) \<zero>
[PROOF STEP]
unfolding constant_function_def function_ring_def[of "carrier (Q\<^sub>p\<^bsup>n\<^esup>)" Q\<^sub>p] function_zero_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero>\<^bsub>\<lparr>carrier = carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow>\<^sub>E carrier Q\<^sub>p, monoid.mult = function_mult (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, one = function_one (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, zero = \<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). \<zero>, add = function_add (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p, smult = function_scalar_mult (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<rparr>\<^esub> = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). \<zero>)
[PROOF STEP]
by simp


[STATEMENT]
lemma dup_naturality:
    assumes "\<guillemotleft>f : a \<rightarrow> b\<guillemotright>"
    shows "\<d>[b] \<cdot> f = (f \<otimes> f) \<cdot> \<d>[a]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<d>[b] \<cdot> f = (f \<otimes> f) \<cdot> \<d>[a]
[PROOF STEP]
using assms prod_def comp_arr_dom comp_cod_arr comp_tuple_arr comp_assoc
[PROOF STATE]
proof (prove)
using this:
\<guillemotleft>f : a \<rightarrow> b\<guillemotright>
?f \<otimes> ?g \<equiv> \<langle>?f \<cdot> \<pp>\<^sub>1[local.dom ?f, local.dom ?g], ?g \<cdot> \<pp>\<^sub>0[local.dom ?f, local.dom ?g]\<rangle>
\<lbrakk>arr ?f; local.dom ?f = ?a\<rbrakk> \<Longrightarrow> ?f \<cdot> ?a = ?f
\<lbrakk>arr ?f; cod ?f = ?b\<rbrakk> \<Longrightarrow> ?b \<cdot> ?f = ?f
\<lbrakk>span ?f ?g; arr ?h; local.dom ?f = cod ?h\<rbrakk> \<Longrightarrow> \<langle>?f, ?g\<rangle> \<cdot> ?h = \<langle>?f \<cdot> ?h, ?g \<cdot> ?h\<rangle>
(?h \<cdot> ?g) \<cdot> ?f = ?h \<cdot> ?g \<cdot> ?f

goal (1 subgoal):
 1. \<d>[b] \<cdot> f = (f \<otimes> f) \<cdot> \<d>[a]
[PROOF STEP]
by fastforce


[STATEMENT]
lemma ex231c:
  "x \<le> x * x\<^sup>T * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> x * x\<^sup>T * x
[PROOF STEP]
by (metis comp_left_isotone ex231a inf_le2)


[STATEMENT]
lemma DERIV_inverse:
  "x \<noteq> 0 \<Longrightarrow> ((\<lambda>x. inverse(x)) has_field_derivative - (inverse x ^ Suc (Suc 0))) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> (0::'a) \<Longrightarrow> (inverse has_field_derivative - (inverse x ^ Suc (Suc 0))) (at x within s)
[PROOF STEP]
by (drule DERIV_inverse' [OF DERIV_ident]) simp


[STATEMENT]
lemma Suc_2p_unat_mask:
  "n < LENGTH('a) \<Longrightarrow> Suc (2 ^ n * k + unat (mask n :: 'a::len word)) = 2 ^ n * (k+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < LENGTH('a) \<Longrightarrow> Suc (2 ^ n * k + unat (mask n)) = 2 ^ n * (k + 1)
[PROOF STEP]
by (simp add: unat_mask)


[STATEMENT]
lemma GRP037_3:
  "EQU001_0_ax equal &
  GRP003_0_ax equal multiply INVERSE identity product &
  GRP003_0_eq product multiply INVERSE equal &
  (\<forall>A B C. subgroup_member(A) & subgroup_member(B) & product(A::'a,INVERSE(B),C) --> subgroup_member(C)) &
  (\<forall>A B. equal(A::'a,B) & subgroup_member(A) --> subgroup_member(B)) &
  (\<forall>A. subgroup_member(A) --> product(Gidentity::'a,A,A)) &
  (\<forall>A. subgroup_member(A) --> product(A::'a,Gidentity,A)) &
  (\<forall>A. subgroup_member(A) --> product(A::'a,Ginverse(A),Gidentity)) &
  (\<forall>A. subgroup_member(A) --> product(Ginverse(A),A,Gidentity)) &
  (\<forall>A. subgroup_member(A) --> subgroup_member(Ginverse(A))) &
  (\<forall>A B. equal(A::'a,B) --> equal(Ginverse(A),Ginverse(B))) &
  (\<forall>A C D B. product(A::'a,B,C) & product(A::'a,D,C) --> equal(D::'a,B)) &
  (\<forall>B C D A. product(A::'a,B,C) & product(D::'a,B,C) --> equal(D::'a,A)) &
  (subgroup_member(a)) &
  (subgroup_member(Gidentity)) &
  (~equal(INVERSE(a),Ginverse(a))) --> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. EQU001_0_ax equal \<and> GRP003_0_ax equal multiply INVERSE identity product \<and> GRP003_0_eq product multiply INVERSE equal \<and> (\<forall>A B C. subgroup_member A \<and> subgroup_member B \<and> product (A, INVERSE B, C) \<longrightarrow> subgroup_member C) \<and> (\<forall>A B. equal (A, B) \<and> subgroup_member A \<longrightarrow> subgroup_member B) \<and> (\<forall>A. subgroup_member A \<longrightarrow> product (Gidentity, A, A)) \<and> (\<forall>A. subgroup_member A \<longrightarrow> product (A, Gidentity, A)) \<and> (\<forall>A. subgroup_member A \<longrightarrow> product (A, Ginverse A, Gidentity)) \<and> (\<forall>A. subgroup_member A \<longrightarrow> product (Ginverse A, A, Gidentity)) \<and> (\<forall>A. subgroup_member A \<longrightarrow> subgroup_member (Ginverse A)) \<and> (\<forall>A B. equal (A, B) \<longrightarrow> equal (Ginverse A, Ginverse B)) \<and> (\<forall>A C D B. product (A, B, C) \<and> product (A, D, C) \<longrightarrow> equal (D, B)) \<and> (\<forall>B C D A. product (A, B, C) \<and> product (D, B, C) \<longrightarrow> equal (D, A)) \<and> subgroup_member a \<and> subgroup_member Gidentity \<and> \<not> equal (INVERSE a, Ginverse a) \<longrightarrow> False
[PROOF STEP]
by meson


[STATEMENT]
lemma [code]: "m < n \<longleftrightarrow> integer_of_natural m < integer_of_natural n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m < n) = (integer_of_natural m < integer_of_natural n)
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma is_semialg_map_closed:
  assumes "is_semialg_map m n f"
  shows "f \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<rightarrow> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<rightarrow> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
[PROOF STEP]
using is_semialg_map_def assms
[PROOF STATE]
proof (prove)
using this:
is_semialg_map ?m ?n ?f = (?f \<in> carrier (Q\<^sub>p\<^bsup>?m\<^esup>) \<rightarrow> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<and> (\<forall>l\<ge>0. \<forall>S\<in>semialg_sets (?n + l). is_semialgebraic (?m + l) (map_partial_pullback ?m ?f l S)))
is_semialg_map m n f

goal (1 subgoal):
 1. f \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>) \<rightarrow> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
[PROOF STEP]
by blast


[STATEMENT]
lemma minus_eq: "m - k = m \<longleftrightarrow> k = 0 \<or> m = 0"
  for k m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m - k = m) = (k = 0 \<or> m = 0)
[PROOF STEP]
by arith


[STATEMENT]
lemma (in \<Z>) vsnd_arrow_is_cat_Set_arr'[cat_rel_par_Set_cs_intros]:
  assumes "A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "AB = A \<times>\<^sub>\<circ> B"
    and "B' = B"
    and "\<CC>' = cat_Set \<alpha>"
  shows "vsnd_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsnd_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> B'
[PROOF STEP]
using assms(1-2)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vsnd_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> B'
[PROOF STEP]
unfolding assms(3-5)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vsnd_arrow A B : A \<times>\<^sub>\<circ> B \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> B
[PROOF STEP]
by (rule vsnd_arrow_is_cat_Set_arr)


[STATEMENT]
lemma "filterlim (\<lambda>x::real. (x * sin x) / abs x) (at_right 0) (at 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at 0. x * sin x / \<bar>x\<bar> :> at_right 0
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma "ZC.R' start \<le> 0.007"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZC.R' start \<le> 7 / 10 ^ 3
[PROOF STEP]
unfolding ZC.cost_from_start
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 10\<^sup>2 * (2 / 10 ^ 3 + (16 / 65024) ^ Suc 2 * 3600 + 2 / 10 ^ 3 * (16 / 65024) * (1 - (16 / 65024)\<^sup>2) / (1 - 16 / 65024)) + (1 - 1 / 10\<^sup>2) * (2 / 10 ^ 3 * real (Suc 2))) / (1 - 1 / 10\<^sup>2 + 1 / 10\<^sup>2 * (16 / 65024) ^ Suc 2) \<le> 7 / 10 ^ 3
[PROOF STEP]
by (simp add: power_divide power_one_over[symmetric])


[STATEMENT]
lemma i1: "inner x y = cnj (inner y x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x y = cnj_class.cnj (inner y x)
[PROOF STEP]
by (auto simp add: inner_vec_def cnj_sum cnj_mult mult.commute)
   (meson local.inner_commute)


[STATEMENT]
lemma cblinfun_of_mat_minus:
  fixes M::"complex mat"
  defines "nA \<equiv> length (canonical_basis :: 'a::{basis_enum,complex_normed_vector} list)"
    and "nB \<equiv> length (canonical_basis :: 'b::{basis_enum,complex_normed_vector} list)"
  assumes "M \<in> carrier_mat nB nA" and "N \<in> carrier_mat nB nA"
  shows "(cblinfun_of_mat (M - N) :: 'a \<Rightarrow>\<^sub>C\<^sub>L 'b) = cblinfun_of_mat M - cblinfun_of_mat N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cblinfun_of_mat (M - N) = cblinfun_of_mat M - cblinfun_of_mat N
[PROOF STEP]
by (metis assms add_uminus_minus_mat cblinfun_of_mat_plus cblinfun_of_mat_uminus pth_2 uminus_carrier_mat)


[STATEMENT]
lemma (in cring)
  assumes "x \<in> carrier R" "y \<in> carrier R"
  shows "(x \<ominus> y) [^] (3::nat) =
    x [^] (3::nat) \<oplus> \<guillemotleft>3\<guillemotright> \<otimes> x \<otimes> y [^] (2::nat) \<oplus> (\<ominus> \<guillemotleft>3\<guillemotright>) \<otimes> y \<otimes> x [^] (2::nat) \<ominus> y [^] (3::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<ominus> y) [^] 3 = x [^] 3 \<oplus> \<guillemotleft>3\<guillemotright> \<otimes> x \<otimes> y [^] 2 \<oplus> \<ominus> \<guillemotleft>3\<guillemotright> \<otimes> y \<otimes> x [^] 2 \<ominus> y [^] 3
[PROOF STEP]
by ring


[STATEMENT]
lemma i_set_mult_subset_conv: "
  a \<noteq> Suc 0 \<Longrightarrow> (i_set_mult a \<subseteq> i_set_mult b) = (a mod b = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> Suc 0 \<Longrightarrow> (i_set_mult a \<subseteq> i_set_mult b) = (a mod b = 0)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<noteq> Suc 0; i_set_mult a \<subseteq> i_set_mult b\<rbrakk> \<Longrightarrow> a mod b = 0
 2. \<lbrakk>a \<noteq> Suc 0; a mod b = 0\<rbrakk> \<Longrightarrow> i_set_mult a \<subseteq> i_set_mult b
[PROOF STEP]
apply (simp add: i_set_mult_subset_imp_mod_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<noteq> Suc 0; a mod b = 0\<rbrakk> \<Longrightarrow> i_set_mult a \<subseteq> i_set_mult b
[PROOF STEP]
apply (simp add: mod_0_imp_i_set_mult_subset)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma freess_subset: "set xs \<subseteq> set ys \<Longrightarrow> freess xs |\<subseteq>| freess ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs \<subseteq> set ys \<Longrightarrow> freess xs |\<subseteq>| freess ys
[PROOF STEP]
unfolding freess_def comp_apply
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs \<subseteq> set ys \<Longrightarrow> ffUnion (fset_of_list (map frees xs)) |\<subseteq>| ffUnion (fset_of_list (map frees ys))
[PROOF STEP]
by (intro ffunion_mono fset_of_list_subset) auto


[STATEMENT]
lemma eval_all_append[simp]: "eval_all \<alpha> (fs @ gs) = (eval_all \<alpha> fs \<and> eval_all \<alpha> gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_all \<alpha> (fs @ gs) = (eval_all \<alpha> fs \<and> eval_all \<alpha> gs)
[PROOF STEP]
by auto


[STATEMENT]
lemma odd_real_root_pow: "odd n \<Longrightarrow> root n x ^ n = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd n \<Longrightarrow> root n x ^ n = x
[PROOF STEP]
using sgn_power_root[of n x]
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> sgn (root n x) * \<bar>root n x\<bar> ^ n = x

goal (1 subgoal):
 1. odd n \<Longrightarrow> root n x ^ n = x
[PROOF STEP]
by (simp add: odd_pos sgn_real_def split: if_split_asm)


[STATEMENT]
theorem Hadjicostas_integral_integrable: "interval_lebesgue_integrable lborel 0 1 (f z)"
  if z: "Re z > -2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_interval_lebesgue_integrable lborel 0 1 (f z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. complex_interval_lebesgue_integrable lborel 0 1 (f z)
[PROOF STEP]
from dense[OF z]
[PROOF STATE]
proof (chain)
picking this:
\<exists>za>- 2. za < Re z
[PROOF STEP]
obtain x where x: "x > -2" "Re z > x"
[PROOF STATE]
proof (prove)
using this:
\<exists>za>- 2. za < Re z

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>- 2 < x; x < Re z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
- 2 < x
x < Re z

goal (1 subgoal):
 1. complex_interval_lebesgue_integrable lborel 0 1 (f z)
[PROOF STEP]
have "interval_lebesgue_integrable lborel 0 (exp(-1)) (f z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_interval_lebesgue_integrable lborel 0 (ereal (exp (- 1))) (f z)
[PROOF STEP]
by (rule integrable1_aux[of x _ "Re z + 1"]) (use x in auto)
[PROOF STATE]
proof (state)
this:
complex_interval_lebesgue_integrable lborel 0 (ereal (exp (- 1))) (f z)

goal (1 subgoal):
 1. complex_interval_lebesgue_integrable lborel 0 1 (f z)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
complex_interval_lebesgue_integrable lborel 0 (ereal (exp (- 1))) (f z)

goal (1 subgoal):
 1. complex_interval_lebesgue_integrable lborel 0 1 (f z)
[PROOF STEP]
have "interval_lebesgue_integrable lborel (exp(-1)) 1 (f z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_interval_lebesgue_integrable lborel (ereal (exp (- 1))) 1 (f z)
[PROOF STEP]
by (rule integrable2_aux[of x _ "Re z + 1"]) (use x in auto)
[PROOF STATE]
proof (state)
this:
complex_interval_lebesgue_integrable lborel (ereal (exp (- 1))) 1 (f z)

goal (1 subgoal):
 1. complex_interval_lebesgue_integrable lborel 0 1 (f z)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
complex_interval_lebesgue_integrable lborel 0 (ereal (exp (- 1))) (f z)
complex_interval_lebesgue_integrable lborel (ereal (exp (- 1))) 1 (f z)
[PROOF STEP]
show "interval_lebesgue_integrable lborel 0 1 (f z)"
[PROOF STATE]
proof (prove)
using this:
complex_interval_lebesgue_integrable lborel 0 (ereal (exp (- 1))) (f z)
complex_interval_lebesgue_integrable lborel (ereal (exp (- 1))) 1 (f z)

goal (1 subgoal):
 1. complex_interval_lebesgue_integrable lborel 0 1 (f z)
[PROOF STEP]
by (rule interval_lebesgue_integrable_combine) (auto simp: f_def set_borel_measurable_def)
[PROOF STATE]
proof (state)
this:
complex_interval_lebesgue_integrable lborel 0 1 (f z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tr_add_context_s:
  "\<lbrakk> (c,e,c')\<in>tr fg; mon_e fg e \<inter> mon_c fg ce = {} \<rbrakk> \<Longrightarrow> (c+ce,e,c'+ce)\<in>tr fg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(c, e, c') \<in> tr fg; mon_e fg e \<inter> mon_c fg ce = {}\<rbrakk> \<Longrightarrow> (c + ce, e, c' + ce) \<in> tr fg
[PROOF STEP]
by (erule gtrE) (auto simp add: mon_c_unconc union_assoc intro: gtrI_s dest: trss_add_context_s)


[STATEMENT]
lemma set_less_aux_antisym: "\<lbrakk> A \<sqsubset>' B; B \<sqsubset>' A \<rbrakk> \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<sqsubset>' B; B \<sqsubset>' A\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by(auto simp add: set_less_aux_def split: if_split_asm)


[STATEMENT]
lemma cindex_pathE_reversepath': "cindex_pathE g z = -cindex_pathE (reversepath g) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE g z = - cindex_pathE (reversepath g) z
[PROOF STEP]
using cindexE_linear_comp[of "-1" 0 1 "\<lambda>t. (Im (g t) - Im z) / (Re (g t) - Re z)" 1]
[PROOF STATE]
proof (prove)
using this:
- 1 \<noteq> 0 \<Longrightarrow> cindexE 0 1 ((\<lambda>t. (Im (g t) - Im z) / (Re (g t) - Re z)) \<circ> (\<lambda>x. - 1 * x + 1)) = (if 0 < - 1 then cindexE (- 1 * 0 + 1) (- 1 * 1 + 1) (\<lambda>t. (Im (g t) - Im z) / (Re (g t) - Re z)) else - cindexE (- 1 * 1 + 1) (- 1 * 0 + 1) (\<lambda>t. (Im (g t) - Im z) / (Re (g t) - Re z)))

goal (1 subgoal):
 1. cindex_pathE g z = - cindex_pathE (reversepath g) z
[PROOF STEP]
by (simp add: cindex_pathE_def reversepath_def o_def)


[STATEMENT]
lemma C_eq_C[simp]: "(C\<^bsup>i\<^esup> = C\<^bsup>j\<^esup>) \<longleftrightarrow> i = j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (C\<^bsup>i\<^esup> = C\<^bsup>j\<^esup>) = (i = j)
[PROOF STEP]
by (metis C_below_C le_antisym le_refl)


[STATEMENT]
lemma closure_of_subtopology_open:
     "openin X U \<or> S \<subseteq> U \<Longrightarrow> (subtopology X U) closure_of S = U \<inter> X closure_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin X U \<or> S \<subseteq> U \<Longrightarrow> subtopology X U closure_of S = U \<inter> X closure_of S
[PROOF STEP]
by (metis closure_of_subtopology inf_absorb2 openin_Int_closure_of_eq)


[STATEMENT]
lemma wf_nFOR: "wf idx (nFOR \<phi>s) \<longleftrightarrow> (\<forall>\<phi> \<in> set \<phi>s. wf idx \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.wf idx (nFOR \<phi>s) = (\<forall>\<phi>\<in>set \<phi>s. local.wf idx \<phi>)
[PROOF STEP]
by (induct rule: nFOR.induct) auto


[STATEMENT]
lemma Minr_is_Suc_Suc[simp]: "\<lbrakk>Minr Rr xs w = Suc w; \<not> Rr (xs @ [Suc w])\<rbrakk> \<Longrightarrow>
                                   Minr Rr xs (Suc w) = Suc (Suc w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Minr Rr xs w = Suc w; \<not> Rr (xs @ [Suc w])\<rbrakk> \<Longrightarrow> Minr Rr xs (Suc w) = Suc (Suc w)
[PROOF STEP]
apply(simp add: Minr.simps expand_conj_in_set)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(if \<forall>x\<le>w. \<not> Rr (xs @ [x]) then Suc w else Min {uu_. uu_ \<le> w \<and> Rr (xs @ [uu_])}) = Suc w; \<not> Rr (xs @ [Suc w])\<rbrakk> \<Longrightarrow> (\<exists>x\<le>w. Rr (xs @ [x])) \<longrightarrow> Min {uu_. uu_ \<le> w \<and> Rr (xs @ [uu_])} = Suc (Suc w)
[PROOF STEP]
apply(cases "\<forall>x\<le>w. \<not> Rr (xs @ [x])", auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Min {uu_. uu_ \<le> w \<and> Rr (xs @ [uu_])} = Suc w; \<not> Rr (xs @ [Suc w]); x \<le> w; Rr (xs @ [x])\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply(subgoal_tac "Min {x. x \<le> w \<and> Rr (xs @ [x])} \<in>
                                {x. x \<le> w \<and> Rr (xs @ [x])}", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Min {uu_. uu_ \<le> w \<and> Rr (xs @ [uu_])} = Suc w; \<not> Rr (xs @ [Suc w]); x \<le> w; Rr (xs @ [x])\<rbrakk> \<Longrightarrow> Min {x. x \<le> w \<and> Rr (xs @ [x])} \<in> {x. x \<le> w \<and> Rr (xs @ [x])}
[PROOF STEP]
apply(rule_tac Min_in, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma \<Psi>_Fun_mapsto:
    assumes "C.ide x" and "\<guillemotleft>g : y \<rightarrow>\<^sub>D G x\<guillemotright>"
    shows "\<Psi>.FUN (y, x) \<in> HomD.set (y, G x) \<rightarrow> HomC.set (F y, x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Psi>.FUN (y, x) \<in> HomD.set (y, G x) \<rightarrow> HomC.set (F y, x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Psi>.FUN (y, x) \<in> HomD.set (y, G x) \<rightarrow> HomC.set (F y, x)
[PROOF STEP]
have "S.arr (\<Psi> (y, x)) \<and> \<Psi>.COD (y, x) = HomC.set (F y, x) \<and>
                                \<Psi>.DOM (y, x) = HomD.set (y, G x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S.arr (\<Psi> (y, x)) \<and> \<Psi>.COD (y, x) = HomC.set (F y, x) \<and> \<Psi>.DOM (y, x) = HomD.set (y, G x)
[PROOF STEP]
using assms HomC.set_map HomD.set_map
[PROOF STATE]
proof (prove)
using this:
C.ide x
\<guillemotleft>g : y \<rightarrow>\<^sub>D G x\<guillemotright>
\<lbrakk>C.ide ?a; C.ide ?b\<rbrakk> \<Longrightarrow> S.set (HomC.map (?b, ?a)) = HomC.set (?b, ?a)
\<lbrakk>D.ide ?a; D.ide ?b\<rbrakk> \<Longrightarrow> S.set (HomD.map (?b, ?a)) = HomD.set (?b, ?a)

goal (1 subgoal):
 1. S.arr (\<Psi> (y, x)) \<and> \<Psi>.COD (y, x) = HomC.set (F y, x) \<and> \<Psi>.DOM (y, x) = HomD.set (y, G x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S.arr (\<Psi> (y, x)) \<and> \<Psi>.COD (y, x) = HomC.set (F y, x) \<and> \<Psi>.DOM (y, x) = HomD.set (y, G x)

goal (1 subgoal):
 1. \<Psi>.FUN (y, x) \<in> HomD.set (y, G x) \<rightarrow> HomC.set (F y, x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
S.arr (\<Psi> (y, x)) \<and> \<Psi>.COD (y, x) = HomC.set (F y, x) \<and> \<Psi>.DOM (y, x) = HomD.set (y, G x)

goal (1 subgoal):
 1. \<Psi>.FUN (y, x) \<in> HomD.set (y, G x) \<rightarrow> HomC.set (F y, x)
[PROOF STEP]
using S.Fun_mapsto
[PROOF STATE]
proof (prove)
using this:
S.arr (\<Psi> (y, x)) \<and> \<Psi>.COD (y, x) = HomC.set (F y, x) \<and> \<Psi>.DOM (y, x) = HomD.set (y, G x)
S.arr ?f \<Longrightarrow> S.Fun ?f \<in> extensional (S.Dom ?f) \<inter> (S.Dom ?f \<rightarrow> S.Cod ?f)

goal (1 subgoal):
 1. \<Psi>.FUN (y, x) \<in> HomD.set (y, G x) \<rightarrow> HomC.set (F y, x)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<Psi>.FUN (y, x) \<in> HomD.set (y, G x) \<rightarrow> HomC.set (F y, x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fiter_induct_eq: "c\<^sup>\<star>;d = gfp (\<lambda> x. c;x \<sqinter> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
define F where "F = (\<lambda> x. x;d)"
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) = (\<lambda>x::'a::refinement_lattice. x ; (d::'a::refinement_lattice))

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
define G where "G = (\<lambda> x. nil \<sqinter> c;x)"
[PROOF STATE]
proof (state)
this:
(G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) = (\<lambda>x::'a::refinement_lattice. nil \<sqinter> (c::'a::refinement_lattice) ; x)

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
define H where "H = (\<lambda> x. c;x \<sqinter> d)"
[PROOF STATE]
proof (state)
this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) = (\<lambda>x::'a::refinement_lattice. (c::'a::refinement_lattice) ; x \<sqinter> (d::'a::refinement_lattice))

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have FG: "F \<circ> G = (\<lambda> x. c;x;d \<sqinter> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<circ> G = (\<lambda>x::'a. c ; x ; d \<sqinter> d)
variables:
c, d :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
F, G :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: F_def G_def comp_def inf_commute inf_seq_distrib)
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) = (\<lambda>x::'a::refinement_lattice. (c::'a::refinement_lattice) ; x ; (d::'a::refinement_lattice) \<sqinter> d)

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have HF: "H \<circ> F = (\<lambda> x. c;x;d \<sqinter> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H \<circ> F = (\<lambda>x::'a. c ; x ; d \<sqinter> d)
variables:
c, d :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
F, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis comp_def seq_assoc H_def F_def)
[PROOF STATE]
proof (state)
this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) = (\<lambda>x::'a::refinement_lattice. (c::'a::refinement_lattice) ; x ; (d::'a::refinement_lattice) \<sqinter> d)

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have adjoint: "dist_over_inf F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist_over_inf F
variables:
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using Inf_seq_distrib F_def
[PROOF STATE]
proof (prove)
using this:
\<Sqinter> (?C::'a::refinement_lattice set) ; (?d::'a::refinement_lattice) = (\<Sqinter>c::'a::refinement_lattice\<in>?C. c ; ?d)
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) = (\<lambda>x::'a::refinement_lattice. x ; (d::'a::refinement_lattice))

goal (1 subgoal):
 1. dist_over_inf F
variables:
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist_over_inf (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have monoH: "mono H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono H
variables:
H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis H_def inf_mono_left monoI seq_distrib_left.seq_mono_right seq_distrib_left_axioms)
[PROOF STATE]
proof (state)
this:
mono (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have monoG: "mono G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono G
variables:
G :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis G_def inf_mono_right mono_def seq_mono_right)
[PROOF STATE]
proof (state)
this:
mono (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "\<forall> x. ((F \<circ> G) x = (H \<circ> F) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x::'a. (F \<circ> G) x = (H \<circ> F) x
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using FG HF
[PROOF STATE]
proof (prove)
using this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) = (\<lambda>x::'a::refinement_lattice. (c::'a::refinement_lattice) ; x ; (d::'a::refinement_lattice) \<sqinter> d)
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) = (\<lambda>x::'a::refinement_lattice. (c::'a::refinement_lattice) ; x ; (d::'a::refinement_lattice) \<sqinter> d)

goal (1 subgoal):
 1. \<forall>x::'a. (F \<circ> G) x = (H \<circ> F) x
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x::'a::refinement_lattice. ((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) x = ((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F) x

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x::'a::refinement_lattice. ((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) x = ((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F) x
[PROOF STEP]
have "F (gfp G) = gfp H"
[PROOF STATE]
proof (prove)
using this:
\<forall>x::'a::refinement_lattice. ((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) x = ((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F) x

goal (1 subgoal):
 1. F (gfp G) = gfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using adjoint monoG monoH fusion_gfp_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>x::'a::refinement_lattice. ((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) x = ((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F) x
dist_over_inf (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)
mono (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)
mono (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)
\<lbrakk>mono (?H::?'a::refinement_lattice \<Rightarrow> ?'a::refinement_lattice); mono (?G::?'a::refinement_lattice \<Rightarrow> ?'a::refinement_lattice); dist_over_inf (?F::?'a::refinement_lattice \<Rightarrow> ?'a::refinement_lattice); \<And>x::?'a::refinement_lattice. (?F \<circ> ?G) x = (?H \<circ> ?F) x\<rbrakk> \<Longrightarrow> ?F (gfp ?G) = gfp ?H

goal (1 subgoal):
 1. F (gfp G) = gfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) = gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) = gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)
[PROOF STEP]
have "(gfp (\<lambda> x. nil \<sqinter> c;x));d = gfp (\<lambda> x. c;x \<sqinter> d)"
[PROOF STATE]
proof (prove)
using this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) = gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. gfp (\<lambda>x::'a. nil \<sqinter> c ; x) ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using F_def G_def H_def inf_commute
[PROOF STATE]
proof (prove)
using this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (gfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) = gfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) = (\<lambda>x::'a::refinement_lattice. x ; (d::'a::refinement_lattice))
(G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) = (\<lambda>x::'a::refinement_lattice. nil \<sqinter> (c::'a::refinement_lattice) ; x)
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) = (\<lambda>x::'a::refinement_lattice. (c::'a::refinement_lattice) ; x \<sqinter> (d::'a::refinement_lattice))
(?x::?'a::semilattice_inf) \<sqinter> (?y::?'a::semilattice_inf) = ?y \<sqinter> ?x

goal (1 subgoal):
 1. gfp (\<lambda>x::'a. nil \<sqinter> c ; x) ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gfp (\<lambda>x::'a::refinement_lattice. nil \<sqinter> (c::'a::refinement_lattice) ; x) ; (d::'a::refinement_lattice) = gfp (\<lambda>x::'a::refinement_lattice. c ; x \<sqinter> d)

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
gfp (\<lambda>x::'a::refinement_lattice. nil \<sqinter> (c::'a::refinement_lattice) ; x) ; (d::'a::refinement_lattice) = gfp (\<lambda>x::'a::refinement_lattice. c ; x \<sqinter> d)

goal (1 subgoal):
 1. c\<^sup>\<star> ; d = gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis fiter_def)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<star> ; (d::'a::refinement_lattice) = gfp (\<lambda>x::'a::refinement_lattice. c ; x \<sqinter> d)

goal:
No subgoals!
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed