[STATEMENT]
lemma uniform_limit_flow0_state:\<comment> \<open>TODO: is that something more general?\<close>
  assumes "compact C"
  assumes "C \<subseteq> X"
  shows "uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)
[PROOF STEP]
proof (cases "C = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. C = {} \<Longrightarrow> uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)
 2. C \<noteq> {} \<Longrightarrow> uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
C = {}

goal (2 subgoals):
 1. C = {} \<Longrightarrow> uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)
 2. C \<noteq> {} \<Longrightarrow> uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
C = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
C = {}

goal (1 subgoal):
 1. uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)

goal (1 subgoal):
 1. C \<noteq> {} \<Longrightarrow> uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. C \<noteq> {} \<Longrightarrow> uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
C \<noteq> {}

goal (1 subgoal):
 1. C \<noteq> {} \<Longrightarrow> uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)
[PROOF STEP]
proof (rule uniform_limitI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
fix e::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
assume "0 < e"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
assume "x \<in> C"
[PROOF STATE]
proof (state)
this:
x \<in> C

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
compact C
C \<subseteq> X
x \<in> C
[PROOF STEP]
have "x \<in> X"
[PROOF STATE]
proof (prove)
using this:
compact C
C \<subseteq> X
x \<in> C

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

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
from existence_ivl_cballs[OF UNIV_I \<open>x \<in> X\<close>]
[PROOF STATE]
proof (chain)
picking this:
(\<And>t u L. \<lbrakk>\<And>y. y \<in> cball x u \<Longrightarrow> cball 0 t \<subseteq> existence_ivl0 y; \<And>s y. \<lbrakk>y \<in> cball x u; s \<in> cball 0 t\<rbrakk> \<Longrightarrow> flow0 y s \<in> cball y u; L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t); \<And>y. y \<in> cball x u \<Longrightarrow> cball y u \<subseteq> X; 0 < t; 0 < u\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain t L u where "\<And>y. y \<in> cball x u \<Longrightarrow> cball 0 t \<subseteq> existence_ivl0 y"
        "\<And>s y. y \<in> cball x u \<Longrightarrow> s \<in> cball 0 t \<Longrightarrow> flow0 y s \<in> cball y u"
        "L-lipschitz_on (cball 0 t\<times>cball x u) (\<lambda>(t, x). flow0 x t)"
        "\<And>y. y \<in> cball x u \<Longrightarrow> cball y u \<subseteq> X"
        "0 < t" "0 < u"
[PROOF STATE]
proof (prove)
using this:
(\<And>t u L. \<lbrakk>\<And>y. y \<in> cball x u \<Longrightarrow> cball 0 t \<subseteq> existence_ivl0 y; \<And>s y. \<lbrakk>y \<in> cball x u; s \<in> cball 0 t\<rbrakk> \<Longrightarrow> flow0 y s \<in> cball y u; L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t); \<And>y. y \<in> cball x u \<Longrightarrow> cball y u \<subseteq> X; 0 < t; 0 < u\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>u t L. \<lbrakk>\<And>y. y \<in> cball x u \<Longrightarrow> cball 0 t \<subseteq> existence_ivl0 y; \<And>s y. \<lbrakk>y \<in> cball x u; s \<in> cball 0 t\<rbrakk> \<Longrightarrow> flow0 y s \<in> cball y u; L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t); \<And>y. y \<in> cball x u \<Longrightarrow> cball y u \<subseteq> X; 0 < t; 0 < u\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?y2 \<in> cball x u \<Longrightarrow> cball 0 t \<subseteq> existence_ivl0 ?y2
\<lbrakk>?y2 \<in> cball x u; ?s2 \<in> cball 0 t\<rbrakk> \<Longrightarrow> flow0 ?y2 ?s2 \<in> cball ?y2 u
L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t)
?y2 \<in> cball x u \<Longrightarrow> cball ?y2 u \<subseteq> X
0 < t
0 < u

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?y2 \<in> cball x u \<Longrightarrow> cball 0 t \<subseteq> existence_ivl0 ?y2
\<lbrakk>?y2 \<in> cball x u; ?s2 \<in> cball 0 t\<rbrakk> \<Longrightarrow> flow0 ?y2 ?s2 \<in> cball ?y2 u
L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t)
?y2 \<in> cball x u \<Longrightarrow> cball ?y2 u \<subseteq> X
0 < t
0 < u
[PROOF STEP]
have "\<exists>L. \<exists>u>0. \<exists>t>0. L-lipschitz_on (cball 0 t\<times>cball x u) (\<lambda>(t, x). flow0 x t)"
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> cball x u \<Longrightarrow> cball 0 t \<subseteq> existence_ivl0 ?y2
\<lbrakk>?y2 \<in> cball x u; ?s2 \<in> cball 0 t\<rbrakk> \<Longrightarrow> flow0 ?y2 ?s2 \<in> cball ?y2 u
L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t)
?y2 \<in> cball x u \<Longrightarrow> cball ?y2 u \<subseteq> X
0 < t
0 < u

goal (1 subgoal):
 1. \<exists>L u. 0 < u \<and> (\<exists>t>0. L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>L u. 0 < u \<and> (\<exists>t>0. L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x4 \<in> C \<Longrightarrow> \<exists>L u. 0 < u \<and> (\<exists>t>0. L-lipschitz_on (cball 0 t \<times> cball ?x4 u) (\<lambda>(t, x). flow0 x t))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x4 \<in> C \<Longrightarrow> \<exists>L u. 0 < u \<and> (\<exists>t>0. L-lipschitz_on (cball 0 t \<times> cball ?x4 u) (\<lambda>(t, x). flow0 x t))
[PROOF STEP]
have "\<forall>x\<in>C. \<exists>L. \<exists>u>0. \<exists>t>0. L-lipschitz_on (cball 0 t\<times>cball x u) (\<lambda>(t, x). flow0 x t)"
[PROOF STATE]
proof (prove)
using this:
?x4 \<in> C \<Longrightarrow> \<exists>L u. 0 < u \<and> (\<exists>t>0. L-lipschitz_on (cball 0 t \<times> cball ?x4 u) (\<lambda>(t, x). flow0 x t))

goal (1 subgoal):
 1. \<forall>x\<in>C. \<exists>L u. 0 < u \<and> (\<exists>t>0. L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>C. \<exists>L u. 0 < u \<and> (\<exists>t>0. L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>C. \<exists>L u. 0 < u \<and> (\<exists>t>0. L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t))
[PROOF STEP]
obtain L d' u' where
      L: "\<And>x. x \<in> C \<Longrightarrow> (L x)-lipschitz_on (cball 0 (d' x)\<times>cball x (u' x)) (\<lambda>(t, x). flow0 x t)"
      and d': "\<And>x. x \<in> C \<Longrightarrow> d' x > 0"
      and u': "\<And>x. x \<in> C \<Longrightarrow> u' x > 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>C. \<exists>L u. 0 < u \<and> (\<exists>t>0. L-lipschitz_on (cball 0 t \<times> cball x u) (\<lambda>(t, x). flow0 x t))

goal (1 subgoal):
 1. (\<And>L d' u'. \<lbrakk>\<And>x. x \<in> C \<Longrightarrow> (L x)-lipschitz_on (cball 0 (d' x) \<times> cball x (u' x)) (\<lambda>(t, x). flow0 x t); \<And>x. x \<in> C \<Longrightarrow> 0 < d' x; \<And>x. x \<in> C \<Longrightarrow> 0 < u' x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?x2 \<in> C \<Longrightarrow> (L ?x2)-lipschitz_on (cball 0 (d' ?x2) \<times> cball ?x2 (u' ?x2)) (\<lambda>(t, x). flow0 x t)
?x2 \<in> C \<Longrightarrow> 0 < d' ?x2
?x2 \<in> C \<Longrightarrow> 0 < u' ?x2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
have "C \<subseteq> (\<Union>c\<in>C. ball c (u' c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<subseteq> (\<Union>c\<in>C. ball c (u' c))
[PROOF STEP]
using u'
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> C \<Longrightarrow> 0 < u' ?x2

goal (1 subgoal):
 1. C \<subseteq> (\<Union>c\<in>C. ball c (u' c))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C \<subseteq> (\<Union>c\<in>C. ball c (u' c))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
from compactE_image[OF \<open>compact C\<close> _ this]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>T. T \<in> C \<Longrightarrow> open (ball T (u' T)); \<And>C'. \<lbrakk>C' \<subseteq> C; finite C'; C \<subseteq> (\<Union>c\<in>C'. ball c (u' c))\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
obtain C' where "C' \<subseteq> C" and [simp]: "finite C'" and C'_cover: "C \<subseteq> (\<Union>c\<in>C'. ball c (u' c))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>T. T \<in> C \<Longrightarrow> open (ball T (u' T)); \<And>C'. \<lbrakk>C' \<subseteq> C; finite C'; C \<subseteq> (\<Union>c\<in>C'. ball c (u' c))\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>C'. \<lbrakk>C' \<subseteq> C; finite C'; C \<subseteq> (\<Union>c\<in>C'. ball c (u' c))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C' \<subseteq> C
finite C'
C \<subseteq> (\<Union>c\<in>C'. ball c (u' c))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
from C'_cover
[PROOF STATE]
proof (chain)
picking this:
C \<subseteq> (\<Union>c\<in>C'. ball c (u' c))
[PROOF STEP]
obtain c' where c': "x \<in> C \<Longrightarrow> x \<in> ball (c' x) (u' (c' x))" "x \<in> C \<Longrightarrow> c' x \<in> C'" for x
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> (\<Union>c\<in>C'. ball c (u' c))

goal (1 subgoal):
 1. (\<And>c'. \<lbrakk>\<And>x. x \<in> C \<Longrightarrow> x \<in> ball (c' x) (u' (c' x)); \<And>x. x \<in> C \<Longrightarrow> c' x \<in> C'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: subset_iff) metis
[PROOF STATE]
proof (state)
this:
?x2 \<in> C \<Longrightarrow> ?x2 \<in> ball (c' ?x2) (u' (c' ?x2))
?x2 \<in> C \<Longrightarrow> c' ?x2 \<in> C'

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
have "\<forall>\<^sub>F s in at 0. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e" if "c \<in> C'" for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
have cC: "c \<in> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> C
[PROOF STEP]
using c' \<open>c \<in> C'\<close> d' \<open>C' \<subseteq> C\<close>
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> C \<Longrightarrow> ?x2 \<in> ball (c' ?x2) (u' (c' ?x2))
?x2 \<in> C \<Longrightarrow> c' ?x2 \<in> C'
c \<in> C'
?x2 \<in> C \<Longrightarrow> 0 < d' ?x2
C' \<subseteq> C

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

goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
have *: "dist (flow0 x s) (flow0 x 0) \<le> L c * \<bar>s\<bar>"
        if "x\<in>ball c (u' c)"
          "s \<in> cball 0 (d' c)"
        for x s
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (flow0 x s) (flow0 x 0) \<le> L c * \<bar>s\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist (flow0 x s) (flow0 x 0) \<le> L c * \<bar>s\<bar>
[PROOF STEP]
from L[OF cC, THEN lipschitz_onD, of "(0, x)" "(s, x)"] d'[OF cC] that
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>(0, x) \<in> cball 0 (d' c) \<times> cball c (u' c); (s, x) \<in> cball 0 (d' c) \<times> cball c (u' c)\<rbrakk> \<Longrightarrow> dist (case (0, x) of (t, x) \<Rightarrow> flow0 x t) (case (s, x) of (t, x) \<Rightarrow> flow0 x t) \<le> L c * dist (0, x) (s, x)
0 < d' c
x \<in> ball c (u' c)
s \<in> cball 0 (d' c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(0, x) \<in> cball 0 (d' c) \<times> cball c (u' c); (s, x) \<in> cball 0 (d' c) \<times> cball c (u' c)\<rbrakk> \<Longrightarrow> dist (case (0, x) of (t, x) \<Rightarrow> flow0 x t) (case (s, x) of (t, x) \<Rightarrow> flow0 x t) \<le> L c * dist (0, x) (s, x)
0 < d' c
x \<in> ball c (u' c)
s \<in> cball 0 (d' c)

goal (1 subgoal):
 1. dist (flow0 x s) (flow0 x 0) \<le> L c * \<bar>s\<bar>
[PROOF STEP]
by (auto simp: dist_prod_def dist_commute)
[PROOF STATE]
proof (state)
this:
dist (flow0 x s) (flow0 x 0) \<le> L c * \<bar>s\<bar>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x2 \<in> ball c (u' c); ?s2 \<in> cball 0 (d' c)\<rbrakk> \<Longrightarrow> dist (flow0 ?x2 ?s2) (flow0 ?x2 0) \<le> L c * \<bar>?s2\<bar>

goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
have "\<forall>\<^sub>F s in at 0. abs s < d' c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. \<bar>s\<bar> < d' c
[PROOF STEP]
by (rule order_tendstoD tendsto_intros)+ (use d' cC in auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F s in at 0. \<bar>s\<bar> < d' c

goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F s in at 0. \<bar>s\<bar> < d' c

goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
have "\<forall>\<^sub>F s in at 0. L c * \<bar>s\<bar> < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. L c * \<bar>s\<bar> < e
[PROOF STEP]
by (rule order_tendstoD tendsto_intros)+ (use \<open>0 < e\<close> in auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F s in at 0. L c * \<bar>s\<bar> < e

goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F s in at 0. \<bar>s\<bar> < d' c
\<forall>\<^sub>F s in at 0. L c * \<bar>s\<bar> < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F s in at 0. \<bar>s\<bar> < d' c
\<forall>\<^sub>F s in at 0. L c * \<bar>s\<bar> < e

goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. \<lbrakk>\<bar>s\<bar> < d' c; L c * \<bar>s\<bar> < e\<rbrakk> \<Longrightarrow> \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
apply (use * in auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s x. \<lbrakk>\<bar>s\<bar> < d' c; L c * \<bar>s\<bar> < e; \<And>x s. \<lbrakk>dist c x < u' c; \<bar>s\<bar> \<le> d' c\<rbrakk> \<Longrightarrow> dist (flow0 x s) (flow0 x 0) \<le> L c * \<bar>s\<bar>; dist c x < u' c\<rbrakk> \<Longrightarrow> dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
by smt
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F s in at 0. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?c2 \<in> C' \<Longrightarrow> \<forall>\<^sub>F s in at 0. \<forall>x\<in>ball ?c2 (u' ?c2). dist (flow0 x s) (flow0 x 0) < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?c2 \<in> C' \<Longrightarrow> \<forall>\<^sub>F s in at 0. \<forall>x\<in>ball ?c2 (u' ?c2). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
have "\<forall>\<^sub>F s in at 0. \<forall>c\<in>C'. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e"
[PROOF STATE]
proof (prove)
using this:
?c2 \<in> C' \<Longrightarrow> \<forall>\<^sub>F s in at 0. \<forall>x\<in>ball ?c2 (u' ?c2). dist (flow0 x s) (flow0 x 0) < e

goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. \<forall>c\<in>C'. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
by (simp add: eventually_ball_finite_distrib)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F s in at 0. \<forall>c\<in>C'. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in at 0. \<forall>x\<in>C. dist (flow0 x n) (flow0 x 0) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F s in at 0. \<forall>c\<in>C'. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
show "\<forall>\<^sub>F s in at 0. \<forall>x\<in>C. dist (flow0 x s) (flow0 x 0) < e"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F s in at 0. \<forall>c\<in>C'. \<forall>x\<in>ball c (u' c). dist (flow0 x s) (flow0 x 0) < e

goal (1 subgoal):
 1. \<forall>\<^sub>F s in at 0. \<forall>x\<in>C. dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. \<forall>c\<in>C'. \<forall>sa\<in>ball c (u' c). dist (flow0 sa s) (flow0 sa 0) < e \<Longrightarrow> \<forall>x\<in>C. dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s x. \<lbrakk>\<forall>c\<in>C'. \<forall>sa\<in>ball c (u' c). dist (flow0 sa s) (flow0 sa 0) < e; x \<in> C\<rbrakk> \<Longrightarrow> dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
subgoal for s x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>c\<in>C'. \<forall>sa\<in>ball c (u' c). dist (flow0 sa s) (flow0 sa 0) < e; x \<in> C\<rbrakk> \<Longrightarrow> dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
apply (drule bspec[where x="c' x"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> C \<Longrightarrow> c' x \<in> C'
 2. \<lbrakk>x \<in> C; \<forall>sa\<in>ball (c' x) (u' (c' x)). dist (flow0 sa s) (flow0 sa 0) < e\<rbrakk> \<Longrightarrow> dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
apply (simp add: c'(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> C; \<forall>sa\<in>ball (c' x) (u' (c' x)). dist (flow0 sa s) (flow0 sa 0) < e\<rbrakk> \<Longrightarrow> dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
apply (drule bspec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> C \<Longrightarrow> ?s3 \<in> ball (c' x) (u' (c' x))
 2. \<lbrakk>x \<in> C; dist (flow0 ?s3 s) (flow0 ?s3 0) < e\<rbrakk> \<Longrightarrow> dist (flow0 x s) (flow0 x 0) < e
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> C; dist (flow0 ?s3 s) (flow0 ?s3 0) < e\<rbrakk> \<Longrightarrow> dist (flow0 x s) (flow0 x 0) < e
 2. x \<in> C \<Longrightarrow> ?s3 \<in> ball (c' x) (u' (c' x))
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> C \<Longrightarrow> x \<in> ball (c' x) (u' (c' x))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> C \<Longrightarrow> dist (c' x) x < u' (c' x)
[PROOF STEP]
using c'(1)
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> C \<Longrightarrow> ?x2 \<in> ball (c' ?x2) (u' (c' ?x2))

goal (1 subgoal):
 1. x \<in> C \<Longrightarrow> dist (c' x) x < u' (c' x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F s in at 0. \<forall>x\<in>C. dist (flow0 x s) (flow0 x 0) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
uniform_limit C (\<lambda>s x. flow0 x s) (\<lambda>x. flow0 x 0) (at 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma permutation_insert_base:
  assumes p: "p permutes {0..<n}"
  shows "permutation_insert n n p = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutation_insert n n p = p
[PROOF STEP]
proof (rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. permutation_insert n n p x = p x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. permutation_insert n n p x = p x
[PROOF STEP]
show "permutation_insert n n p x = p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutation_insert n n p x = p x
[PROOF STEP]
apply (cases rule: linorder_cases[of "x" "n"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. x < n \<Longrightarrow> permutation_insert n n p x = p x
 2. x = n \<Longrightarrow> permutation_insert n n p x = p x
 3. n < x \<Longrightarrow> permutation_insert n n p x = p x
[PROOF STEP]
unfolding permutation_insert_expand
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. x < n \<Longrightarrow> (if x < n then if p x < n then p x else Suc (p x) else if x = n then n else if p (x - 1) < n then p (x - 1) else Suc (p (x - 1))) = p x
 2. x = n \<Longrightarrow> (if x < n then if p x < n then p x else Suc (p x) else if x = n then n else if p (x - 1) < n then p (x - 1) else Suc (p (x - 1))) = p x
 3. n < x \<Longrightarrow> (if x < n then if p x < n then p x else Suc (p x) else if x = n then n else if p (x - 1) < n then p (x - 1) else Suc (p (x - 1))) = p x
[PROOF STEP]
using permutes_others[OF p] p
[PROOF STATE]
proof (prove)
using this:
?x \<notin> {0..<n} \<Longrightarrow> p ?x = ?x
p permutes {0..<n}

goal (3 subgoals):
 1. x < n \<Longrightarrow> (if x < n then if p x < n then p x else Suc (p x) else if x = n then n else if p (x - 1) < n then p (x - 1) else Suc (p (x - 1))) = p x
 2. x = n \<Longrightarrow> (if x < n then if p x < n then p x else Suc (p x) else if x = n then n else if p (x - 1) < n then p (x - 1) else Suc (p (x - 1))) = p x
 3. n < x \<Longrightarrow> (if x < n then if p x < n then p x else Suc (p x) else if x = n then n else if p (x - 1) < n then p (x - 1) else Suc (p (x - 1))) = p x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
permutation_insert n n p x = p x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zip_null_iff: "\<lbrakk>length xs = k; length ys = k; zip xs ys = []\<rbrakk> \<Longrightarrow> xs = [] \<and> ys = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = k; length ys = k; zip xs ys = []\<rbrakk> \<Longrightarrow> xs = [] \<and> ys = []
[PROOF STEP]
apply(cases xs, simp, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nat_upto_subs_top_removal:
  "S \<subseteq> {0..n::nat} \<Longrightarrow> n \<notin> S \<Longrightarrow> S \<subseteq> {0..n - 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> {0..n}; n \<notin> S\<rbrakk> \<Longrightarrow> S \<subseteq> {0..n - 1}
[PROOF STEP]
using nat_upto_subs_top_removal'
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?S \<subseteq> {0..Suc ?n}; Suc ?n \<notin> ?S\<rbrakk> \<Longrightarrow> ?S \<subseteq> {0..?n}

goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> {0..n}; n \<notin> S\<rbrakk> \<Longrightarrow> S \<subseteq> {0..n - 1}
[PROOF STEP]
by (cases n; simp)


[STATEMENT]
lemma last_lift: "\<lbrakk>xs\<noteq>[]; fst(xs!(length xs - (Suc 0)))=None\<rbrakk>
 \<Longrightarrow> fst((map (lift P) xs)!(length (map (lift P) xs)- (Suc 0)))=(Some P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<noteq> []; fst (xs ! (length xs - Suc 0)) = None\<rbrakk> \<Longrightarrow> fst (map (lift P) xs ! (length (map (lift P) xs) - Suc 0)) = Some P
[PROOF STEP]
by (cases "(xs ! (length xs - (Suc 0)))") (simp add:lift_def)


[STATEMENT]
lemma moebius_similarity_id [simp]:
  shows "moebius_similarity 1 0 = id_moebius"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_similarity 1 0 = id_moebius
[PROOF STEP]
unfolding moebius_similarity_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_moebius 1 0 0 1 = id_moebius
[PROOF STEP]
by simp


[STATEMENT]
lemma del_left_mset:
  "del_left t = (x,t') \<Longrightarrow> t \<noteq> Leaf
  \<Longrightarrow> x \<in># mset_tree t \<and> mset_tree t' = mset_tree t - {#x#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>del_left t = (x, t'); t \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> x \<in># mset_tree t \<and> mset_tree t' = mset_tree t - {#x#}
[PROOF STEP]
by (simp add: del_left_mset_plus)


[STATEMENT]
lemma invertible_Gauss_Jordan_up_to_k:
  fixes A::"'a::{field}^'n::{mod_type}^'m::{mod_type}"
  shows "\<exists>P. invertible P \<and> (Gauss_Jordan_upt_k A k) = P**A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A
[PROOF STEP]
proof (induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A 0 = P ** A
 2. \<And>k. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (Suc k) = P ** A
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A 0 = P ** A
 2. \<And>k. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (Suc k) = P ** A
[PROOF STEP]
have rw: "[0..<Suc 0] = [0]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [0..<Suc 0] = [0]
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
[0..<Suc 0] = [0]

goal (2 subgoals):
 1. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A 0 = P ** A
 2. \<And>k. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (Suc k) = P ** A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A 0 = P ** A
[PROOF STEP]
unfolding Gauss_Jordan_upt_k_def rw foldl.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (0, A) 0) = P ** A
[PROOF STEP]
using invertible_Gauss_Jordan_column_k
[PROOF STATE]
proof (prove)
using this:
\<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (?i, ?A) ?k) = P ** ?A

goal (1 subgoal):
 1. \<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (0, A) 0) = P ** A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<exists>P. invertible P \<and> Gauss_Jordan_upt_k A 0 = P ** A

goal (1 subgoal):
 1. \<And>k. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (Suc k) = P ** A
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
\<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A

goal (1 subgoal):
 1. \<And>k. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (Suc k) = P ** A
[PROOF STEP]
have rw2: "[0..<Suc (Suc k)] = [0..< Suc k] @ [(Suc k)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [0..<Suc (Suc k)] = [0..<Suc k] @ [Suc k]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[0..<Suc (Suc k)] = [0..<Suc k] @ [Suc k]

goal (1 subgoal):
 1. \<And>k. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (Suc k) = P ** A
[PROOF STEP]
obtain P' where inv_P': "invertible P'" and Gk_eq_P'A: "Gauss_Jordan_upt_k A k = P' ** A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P'. \<lbrakk>invertible P'; Gauss_Jordan_upt_k A k = P' ** A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Suc.hyps
[PROOF STATE]
proof (prove)
using this:
\<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A

goal (1 subgoal):
 1. (\<And>P'. \<lbrakk>invertible P'; Gauss_Jordan_upt_k A k = P' ** A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
invertible P'
Gauss_Jordan_upt_k A k = P' ** A

goal (1 subgoal):
 1. \<And>k. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (Suc k) = P ** A
[PROOF STEP]
have g: "Gauss_Jordan_upt_k A k = snd (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan_upt_k A k = snd (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k])
[PROOF STEP]
unfolding Gauss_Jordan_upt_k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]) = snd (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gauss_Jordan_upt_k A k = snd (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k])

goal (1 subgoal):
 1. \<And>k. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A \<Longrightarrow> \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (Suc k) = P ** A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (Suc k) = P ** A
[PROOF STEP]
unfolding Gauss_Jordan_upt_k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> snd (foldl Gauss_Jordan_column_k (0, A) [0..<Suc (Suc k)]) = P ** A
[PROOF STEP]
unfolding rw2 foldl_append foldl.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]) (Suc k)) = P ** A
[PROOF STEP]
apply (subst prod.collapse[symmetric, of "(foldl Gauss_Jordan_column_k (0, A) [0..<Suc k])", unfolded g[symmetric]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (fst (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]), Gauss_Jordan_upt_k A k) (Suc k)) = P ** A
[PROOF STEP]
using invertible_Gauss_Jordan_column_k
[PROOF STATE]
proof (prove)
using this:
\<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (?i, ?A) ?k) = P ** ?A

goal (1 subgoal):
 1. \<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (fst (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]), Gauss_Jordan_upt_k A k) (Suc k)) = P ** A
[PROOF STEP]
using Suc.hyps
[PROOF STATE]
proof (prove)
using this:
\<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (?i, ?A) ?k) = P ** ?A
\<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A

goal (1 subgoal):
 1. \<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (fst (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]), Gauss_Jordan_upt_k A k) (Suc k)) = P ** A
[PROOF STEP]
using invertible_mult matrix_mul_assoc
[PROOF STATE]
proof (prove)
using this:
\<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (?i, ?A) ?k) = P ** ?A
\<exists>P. invertible P \<and> Gauss_Jordan_upt_k A k = P ** A
\<lbrakk>invertible ?A; invertible ?B\<rbrakk> \<Longrightarrow> invertible (?A ** ?B)
?A ** (?B ** ?C) = ?A ** ?B ** ?C

goal (1 subgoal):
 1. \<exists>P. invertible P \<and> snd (Gauss_Jordan_column_k (fst (foldl Gauss_Jordan_column_k (0, A) [0..<Suc k]), Gauss_Jordan_upt_k A k) (Suc k)) = P ** A
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>P. invertible P \<and> Gauss_Jordan_upt_k A (Suc k) = P ** A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Id_compose: "f \<in> A \<rightarrow> B \<Longrightarrow> f \<in> extensional A \<Longrightarrow> compose A (\<lambda>y\<in>B. y) f = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; f \<in> extensional A\<rbrakk> \<Longrightarrow> compose A (\<lambda>y\<in>B. y) f = f
[PROOF STEP]
by (auto simp add: fun_eq_iff compose_def extensional_def Pi_def)


[STATEMENT]
lemma finite_dom_finite_map_graph:
  "finite (dom f) \<Longrightarrow> finite (map_graph f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (dom f) \<Longrightarrow> finite (map_graph f)
[PROOF STEP]
apply(simp add: dom_def map_graph_def fun_graph_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {a. \<exists>y. f a = Some y} \<Longrightarrow> finite {(x, y). Some y = f x}
[PROOF STEP]
apply(erule finite_surj[where f="\<lambda>x. (x, the (f x))"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y). Some y = f x} \<subseteq> (\<lambda>x. (x, the (f x))) ` {a. \<exists>y. f a = Some y}
[PROOF STEP]
apply(clarsimp simp add: image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. Some b = f a \<Longrightarrow> (\<exists>y. f a = Some y) \<and> b = the (f a)
[PROOF STEP]
by (metis option.sel)


[STATEMENT]
lemma tagged_division_of_self_real: "x \<in> {a .. b::real} \<Longrightarrow> {(x,{a .. b})} tagged_division_of {a .. b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {a..b} \<Longrightarrow> {(x, {a..b})} tagged_division_of {a..b}
[PROOF STEP]
unfolding box_real[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> cbox a b \<Longrightarrow> {(x, cbox a b)} tagged_division_of cbox a b
[PROOF STEP]
by (rule tagged_division_of_self)


[STATEMENT]
theorem update_append_some:
  assumes "lookup env xs = Some e"
  shows "lookup (update (xs @ y # ys) opt env) xs = Some (update (y # ys) opt e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (update (xs @ y # ys) opt env) xs = Some (update (y # ys) opt e)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
lookup env xs = Some e

goal (1 subgoal):
 1. lookup (update (xs @ y # ys) opt env) xs = Some (update (y # ys) opt e)
[PROOF STEP]
proof (induct xs arbitrary: env e)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>env e. lookup env [] = Some e \<Longrightarrow> lookup (update ([] @ y # ys) opt env) [] = Some (update (y # ys) opt e)
 2. \<And>a xs env e. \<lbrakk>\<And>env e. lookup env xs = Some e \<Longrightarrow> lookup (update (xs @ y # ys) opt env) xs = Some (update (y # ys) opt e); lookup env (a # xs) = Some e\<rbrakk> \<Longrightarrow> lookup (update ((a # xs) @ y # ys) opt env) (a # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
lookup env [] = Some e

goal (2 subgoals):
 1. \<And>env e. lookup env [] = Some e \<Longrightarrow> lookup (update ([] @ y # ys) opt env) [] = Some (update (y # ys) opt e)
 2. \<And>a xs env e. \<lbrakk>\<And>env e. lookup env xs = Some e \<Longrightarrow> lookup (update (xs @ y # ys) opt env) xs = Some (update (y # ys) opt e); lookup env (a # xs) = Some e\<rbrakk> \<Longrightarrow> lookup (update ((a # xs) @ y # ys) opt env) (a # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lookup env [] = Some e
[PROOF STEP]
have "env = e"
[PROOF STATE]
proof (prove)
using this:
lookup env [] = Some e

goal (1 subgoal):
 1. env = e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
env = e

goal (2 subgoals):
 1. \<And>env e. lookup env [] = Some e \<Longrightarrow> lookup (update ([] @ y # ys) opt env) [] = Some (update (y # ys) opt e)
 2. \<And>a xs env e. \<lbrakk>\<And>env e. lookup env xs = Some e \<Longrightarrow> lookup (update (xs @ y # ys) opt env) xs = Some (update (y # ys) opt e); lookup env (a # xs) = Some e\<rbrakk> \<Longrightarrow> lookup (update ((a # xs) @ y # ys) opt env) (a # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
env = e
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
env = e

goal (1 subgoal):
 1. lookup (update ([] @ y # ys) opt env) [] = Some (update (y # ys) opt e)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lookup (update ([] @ y # ys) opt env) [] = Some (update (y # ys) opt e)

goal (1 subgoal):
 1. \<And>a xs env e. \<lbrakk>\<And>env e. lookup env xs = Some e \<Longrightarrow> lookup (update (xs @ y # ys) opt env) xs = Some (update (y # ys) opt e); lookup env (a # xs) = Some e\<rbrakk> \<Longrightarrow> lookup (update ((a # xs) @ y # ys) opt env) (a # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs env e. \<lbrakk>\<And>env e. lookup env xs = Some e \<Longrightarrow> lookup (update (xs @ y # ys) opt env) xs = Some (update (y # ys) opt e); lookup env (a # xs) = Some e\<rbrakk> \<Longrightarrow> lookup (update ((a # xs) @ y # ys) opt env) (a # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
lookup ?env xs = Some ?e \<Longrightarrow> lookup (update (xs @ y # ys) opt ?env) xs = Some (update (y # ys) opt ?e)
lookup env (x # xs) = Some e

goal (1 subgoal):
 1. \<And>a xs env e. \<lbrakk>\<And>env e. lookup env xs = Some e \<Longrightarrow> lookup (update (xs @ y # ys) opt env) xs = Some (update (y # ys) opt e); lookup env (a # xs) = Some e\<rbrakk> \<Longrightarrow> lookup (update ((a # xs) @ y # ys) opt env) (a # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
note hyp = Cons.hyps
    and asm = \<open>lookup env (x # xs) = Some e\<close>
[PROOF STATE]
proof (state)
this:
lookup ?env xs = Some ?e \<Longrightarrow> lookup (update (xs @ y # ys) opt ?env) xs = Some (update (y # ys) opt ?e)
lookup env (x # xs) = Some e

goal (1 subgoal):
 1. \<And>a xs env e. \<lbrakk>\<And>env e. lookup env xs = Some e \<Longrightarrow> lookup (update (xs @ y # ys) opt env) xs = Some (update (y # ys) opt e); lookup env (a # xs) = Some e\<rbrakk> \<Longrightarrow> lookup (update ((a # xs) @ y # ys) opt env) (a # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
show "lookup (update ((x # xs) @ y # ys) opt env) (x # xs) =
      Some (update (y # ys) opt e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
proof (cases env)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x1. env = Val x1 \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
 2. \<And>x21 x22. env = Env x21 x22 \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
case (Val a)
[PROOF STATE]
proof (state)
this:
env = Val a

goal (2 subgoals):
 1. \<And>x1. env = Val x1 \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
 2. \<And>x21 x22. env = Env x21 x22 \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
with asm
[PROOF STATE]
proof (chain)
picking this:
lookup env (x # xs) = Some e
env = Val a
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
lookup env (x # xs) = Some e
env = Val a

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

goal (2 subgoals):
 1. \<And>x1. env = Val x1 \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
 2. \<And>x21 x22. env = Env x21 x22 \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)

goal (1 subgoal):
 1. \<And>x21 x22. env = Env x21 x22 \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x21 x22. env = Env x21 x22 \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
case (Env b es)
[PROOF STATE]
proof (state)
this:
env = Env b es

goal (1 subgoal):
 1. \<And>x21 x22. env = Env x21 x22 \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
proof (cases "es x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. es x = None \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
 2. \<And>a. es x = Some a \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
case None
[PROOF STATE]
proof (state)
this:
es x = None

goal (2 subgoals):
 1. es x = None \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
 2. \<And>a. es x = Some a \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
with asm Env
[PROOF STATE]
proof (chain)
picking this:
lookup env (x # xs) = Some e
env = Env b es
es x = None
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
lookup env (x # xs) = Some e
env = Env b es
es x = None

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

goal (2 subgoals):
 1. es x = None \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
 2. \<And>a. es x = Some a \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)

goal (1 subgoal):
 1. \<And>a. es x = Some a \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. es x = Some a \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
case (Some e')
[PROOF STATE]
proof (state)
this:
es x = Some e'

goal (1 subgoal):
 1. \<And>a. es x = Some a \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
note es = \<open>es x = Some e'\<close>
[PROOF STATE]
proof (state)
this:
es x = Some e'

goal (1 subgoal):
 1. \<And>a. es x = Some a \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
proof (cases xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs = [] \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
 2. \<And>a list. xs = a # list \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
xs = []

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
 2. \<And>a list. xs = a # list \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
with asm Env es
[PROOF STATE]
proof (chain)
picking this:
lookup env (x # xs) = Some e
env = Env b es
es x = Some e'
xs = []
[PROOF STEP]
have "e = e'"
[PROOF STATE]
proof (prove)
using this:
lookup env (x # xs) = Some e
env = Env b es
es x = Some e'
xs = []

goal (1 subgoal):
 1. e = e'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
e = e'

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
 2. \<And>a list. xs = a # list \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
with Env es Nil
[PROOF STATE]
proof (chain)
picking this:
env = Env b es
es x = Some e'
xs = []
e = e'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
env = Env b es
es x = Some e'
xs = []
e = e'

goal (1 subgoal):
 1. lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
case (Cons x' xs')
[PROOF STATE]
proof (state)
this:
xs = x' # xs'

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
from asm Env es
[PROOF STATE]
proof (chain)
picking this:
lookup env (x # xs) = Some e
env = Env b es
es x = Some e'
[PROOF STEP]
have "lookup e' xs = Some e"
[PROOF STATE]
proof (prove)
using this:
lookup env (x # xs) = Some e
env = Env b es
es x = Some e'

goal (1 subgoal):
 1. lookup e' xs = Some e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lookup e' xs = Some e

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lookup e' xs = Some e
[PROOF STEP]
have "lookup (update (xs @ y # ys) opt e') xs =
          Some (update (y # ys) opt e)"
[PROOF STATE]
proof (prove)
using this:
lookup e' xs = Some e

goal (1 subgoal):
 1. lookup (update (xs @ y # ys) opt e') xs = Some (update (y # ys) opt e)
[PROOF STEP]
by (rule hyp)
[PROOF STATE]
proof (state)
this:
lookup (update (xs @ y # ys) opt e') xs = Some (update (y # ys) opt e)

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
with Env es Cons
[PROOF STATE]
proof (chain)
picking this:
env = Env b es
es x = Some e'
xs = x' # xs'
lookup (update (xs @ y # ys) opt e') xs = Some (update (y # ys) opt e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
env = Env b es
es x = Some e'
xs = x' # xs'
lookup (update (xs @ y # ys) opt e') xs = Some (update (y # ys) opt e)

goal (1 subgoal):
 1. lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lookup (update ((x # xs) @ y # ys) opt env) (x # xs) = Some (update (y # ys) opt e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integrable_real_geometric_pmf:
  assumes "p \<in> {0<..1}"
  shows   "integrable (geometric_pmf p) real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (measure_pmf (local.geometric_pmf p)) real
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integrable (measure_pmf (local.geometric_pmf p)) real
[PROOF STEP]
have "summable (\<lambda>x. p * ((1 - p) ^ x * real x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>x. p * ((1 - p) ^ x * real x))
[PROOF STEP]
using geometric_sums_times_norm[of "1 - p"] assms
[PROOF STATE]
proof (prove)
using this:
norm (1 - p) < 1 \<Longrightarrow> (\<lambda>n. norm ((1 - p) ^ n * real n)) sums (norm (1 - p) / (1 - norm (1 - p))\<^sup>2)
p \<in> {0<..1}

goal (1 subgoal):
 1. summable (\<lambda>x. p * ((1 - p) ^ x * real x))
[PROOF STEP]
by (intro summable_mult) (auto simp: sums_iff)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>x. p * ((1 - p) ^ x * real x))

goal (1 subgoal):
 1. integrable (measure_pmf (local.geometric_pmf p)) real
[PROOF STEP]
hence "summable (\<lambda>x. (1 - p) ^ x * real x)"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>x. p * ((1 - p) ^ x * real x))

goal (1 subgoal):
 1. summable (\<lambda>x. (1 - p) ^ x * real x)
[PROOF STEP]
by (rule summable_mult_D) (use assms in auto)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>x. (1 - p) ^ x * real x)

goal (1 subgoal):
 1. integrable (measure_pmf (local.geometric_pmf p)) real
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>x. (1 - p) ^ x * real x)

goal (1 subgoal):
 1. integrable (measure_pmf (local.geometric_pmf p)) real
[PROOF STEP]
unfolding measure_pmf_eq_density
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>x. (1 - p) ^ x * real x)

goal (1 subgoal):
 1. integrable (density (count_space UNIV) (\<lambda>x. ennreal (pmf (local.geometric_pmf p) x))) real
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>x. (1 - p) ^ x * real x)
p \<in> {0<..1}

goal (1 subgoal):
 1. integrable (density (count_space UNIV) (\<lambda>x. ennreal (pmf (local.geometric_pmf p) x))) real
[PROOF STEP]
by (subst integrable_density)
       (auto simp: integrable_count_space_nat_iff mult_ac)
[PROOF STATE]
proof (state)
this:
integrable (measure_pmf (local.geometric_pmf p)) real

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conv_abscissa_add_le:
  "conv_abscissa (f + g :: 'a :: dirichlet_series fds) \<le> max (conv_abscissa f) (conv_abscissa g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_abscissa (f + g) \<le> max (conv_abscissa f) (conv_abscissa g)
[PROOF STEP]
by (rule conv_abscissa_leI_weak) (auto intro!: fds_converges_add intro: fds_converges)


[STATEMENT]
lemma zmultiset_eqI: "(\<And>x. zcount A x = zcount B x) \<Longrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. zcount A x = zcount B x) \<Longrightarrow> A = B
[PROOF STEP]
using zmultiset_eq_iff
[PROOF STATE]
proof (prove)
using this:
(?M = ?N) = (\<forall>a. zcount ?M a = zcount ?N a)

goal (1 subgoal):
 1. (\<And>x. zcount A x = zcount B x) \<Longrightarrow> A = B
[PROOF STEP]
by auto


[STATEMENT]
lemma foldl_distrstart: "\<forall>a x y. (f (g x y) a = g x (f y a)) \<Longrightarrow> (foldl f (g x y) l = g x (foldl f y l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a x y. f (g x y) a = g x (f y a) \<Longrightarrow> foldl f (g x y) l = g x (foldl f y l)
[PROOF STEP]
by (induct l arbitrary: x y, auto)


[STATEMENT]
lemma complex_factorization_exists:
  "\<exists>fctrs. is_factorization_of fctrs (p :: complex poly)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
 2. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
 2. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p = 0

goal (1 subgoal):
 1. \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
by (intro exI[of _ "(0, [])"]) (auto simp: is_factorization_of_def interp_factorization_def)
[PROOF STATE]
proof (state)
this:
\<exists>fctrs. is_factorization_of fctrs p

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
hence "\<exists>xs. set xs = {x. poly p x = 0} \<and> distinct xs"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. \<exists>xs. set xs = {x. poly p x = 0} \<and> distinct xs
[PROOF STEP]
by (intro finite_distinct_list poly_roots_finite)
[PROOF STATE]
proof (state)
this:
\<exists>xs. set xs = {x. poly p x = 0} \<and> distinct xs

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>xs. set xs = {x. poly p x = 0} \<and> distinct xs
[PROOF STEP]
obtain xs where [simp]: "set xs = {x. poly p x = 0}" "distinct xs"
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. set xs = {x. poly p x = 0} \<and> distinct xs

goal (1 subgoal):
 1. (\<And>xs. \<lbrakk>set xs = {x. poly p x = 0}; distinct xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set xs = {x. poly p x = 0}
distinct xs

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
have "interp_factorization (lead_coeff p, map (\<lambda>x. (x, order x p - 1)) xs) =
          smult (lead_coeff p) (\<Prod>x\<leftarrow>xs. [:- x, 1:] ^ Suc (order x p - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interp_factorization (lead_coeff p, map (\<lambda>x. (x, order x p - 1)) xs) = smult (lead_coeff p) (\<Prod>x\<leftarrow>xs. [:- x, 1:] ^ Suc (order x p - 1))
[PROOF STEP]
by (simp add: interp_factorization_def o_def)
[PROOF STATE]
proof (state)
this:
interp_factorization (lead_coeff p, map (\<lambda>x. (x, order x p - 1)) xs) = smult (lead_coeff p) (\<Prod>x\<leftarrow>xs. [:- x, 1:] ^ Suc (order x p - 1))

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
interp_factorization (lead_coeff p, map (\<lambda>x. (x, order x p - 1)) xs) = smult (lead_coeff p) (\<Prod>x\<leftarrow>xs. [:- x, 1:] ^ Suc (order x p - 1))

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
have "(\<Prod>x\<leftarrow>xs. [:- x, 1:] ^ Suc (order x p - 1)) =
               (\<Prod>x|poly p x = 0. [:- x, 1:] ^ Suc (order x p - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<leftarrow>xs. [:- x, 1:] ^ Suc (order x p - 1)) = (\<Prod>x\<in>{x. poly p x = 0}. [:- x, 1:] ^ Suc (order x p - 1))
[PROOF STEP]
by (subst prod.distinct_set_conv_list [symmetric]) simp_all
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<leftarrow>xs. [:- x, 1:] ^ Suc (order x p - 1)) = (\<Prod>x\<in>{x. poly p x = 0}. [:- x, 1:] ^ Suc (order x p - 1))

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<leftarrow>xs. [:- x, 1:] ^ Suc (order x p - 1)) = (\<Prod>x\<in>{x. poly p x = 0}. [:- x, 1:] ^ Suc (order x p - 1))

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
have "\<dots> = (\<Prod>x|poly p x = 0. [:- x, 1:] ^ order x p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>{x. poly p x = 0}. [:- x, 1:] ^ Suc (order x p - 1)) = (\<Prod>x\<in>{x. poly p x = 0}. [:- x, 1:] ^ order x p)
[PROOF STEP]
proof (intro prod.cong refl, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. poly p x = 0} \<Longrightarrow> [:- x, 1:] ^ Suc (order x p - 1) = [:- x, 1:] ^ order x p
[PROOF STEP]
case (1 x)
[PROOF STATE]
proof (state)
this:
x \<in> {x. poly p x = 0}

goal (1 subgoal):
 1. \<And>x. x \<in> {x. poly p x = 0} \<Longrightarrow> [:- x, 1:] ^ Suc (order x p - 1) = [:- x, 1:] ^ order x p
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
x \<in> {x. poly p x = 0}
[PROOF STEP]
have "order x p \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
x \<in> {x. poly p x = 0}

goal (1 subgoal):
 1. order x p \<noteq> 0
[PROOF STEP]
by (subst (asm) order_root) auto
[PROOF STATE]
proof (state)
this:
order x p \<noteq> 0

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

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

goal (1 subgoal):
 1. \<And>x. x \<in> {x. poly p x = 0} \<Longrightarrow> [:- x, 1:] ^ Suc (order x p - 1) = [:- x, 1:] ^ order x p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- x, 1:] ^ Suc (order x p - 1) = [:- x, 1:] ^ order x p
[PROOF STEP]
by (simp only: *)
[PROOF STATE]
proof (state)
this:
[:- x, 1:] ^ Suc (order x p - 1) = [:- x, 1:] ^ order x p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>{x. poly p x = 0}. [:- x, 1:] ^ Suc (order x p - 1)) = (\<Prod>x\<in>{x. poly p x = 0}. [:- x, 1:] ^ order x p)

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>{x. poly p x = 0}. [:- x, 1:] ^ Suc (order x p - 1)) = (\<Prod>x\<in>{x. poly p x = 0}. [:- x, 1:] ^ order x p)

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
have "smult (lead_coeff p) \<dots> = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (lead_coeff p) (\<Prod>x\<in>{x. poly p x = 0}. [:- x, 1:] ^ order x p) = p
[PROOF STEP]
by (rule complex_poly_decompose)
[PROOF STATE]
proof (state)
this:
smult (lead_coeff p) (\<Prod>x\<in>{x. poly p x = 0}. [:- x, 1:] ^ order x p) = p

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
interp_factorization (lead_coeff p, map (\<lambda>x. (x, order x p - 1)) xs) = p
[PROOF STEP]
have "is_factorization_of (lead_coeff p, map (\<lambda>x. (x, order x p - 1)) xs) p"
[PROOF STATE]
proof (prove)
using this:
interp_factorization (lead_coeff p, map (\<lambda>x. (x, order x p - 1)) xs) = p

goal (1 subgoal):
 1. is_factorization_of (lead_coeff p, map (\<lambda>x. (x, order x p - 1)) xs) p
[PROOF STEP]
by (auto simp: is_factorization_of_def o_def)
[PROOF STATE]
proof (state)
this:
is_factorization_of (lead_coeff p, map (\<lambda>x. (x, order x p - 1)) xs) p

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
is_factorization_of (lead_coeff p, map (\<lambda>x. (x, order x p - 1)) xs) p

goal (1 subgoal):
 1. \<exists>fctrs. is_factorization_of fctrs p
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>fctrs. is_factorization_of fctrs p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smallo_trimmed_imp_eventually_greater:
  fixes f g :: "real \<Rightarrow> real"
  assumes "f \<in> o(g)" "(g expands_to G) bs" "basis_wf bs" "trimmed_neg G"
  shows   "eventually (\<lambda>x. f x > g x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. g x < f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. g x < f x
[PROOF STEP]
from assms(2-4)
[PROOF STATE]
proof (chain)
picking this:
(g expands_to G) bs
basis_wf bs
trimmed_neg G
[PROOF STEP]
have pos: "eventually (\<lambda>x. g x < 0) at_top"
[PROOF STATE]
proof (prove)
using this:
(g expands_to G) bs
basis_wf bs
trimmed_neg G

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. g x < 0
[PROOF STEP]
using expands_to_imp_eventually_neg
[PROOF STATE]
proof (prove)
using this:
(g expands_to G) bs
basis_wf bs
trimmed_neg G
\<lbrakk>basis_wf ?basis; (?f expands_to ?F) ?basis; trimmed_neg ?F\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. ?f x < 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. g x < 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. g x < 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. g x < f x
[PROOF STEP]
have "(1 / 2 :: real) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 1 / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. g x < f x
[PROOF STEP]
from landau_o.smallD[OF assms(1) this] and pos
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. norm (f x) \<le> 1 / 2 * norm (g x)
\<forall>\<^sub>F x in at_top. g x < 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. norm (f x) \<le> 1 / 2 * norm (g x)
\<forall>\<^sub>F x in at_top. g x < 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. g x < f x
[PROOF STEP]
by eventually_elim (simp add: abs_if split: if_splits)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. g x < f x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hpair_in_nonrestrict_iff [simp]: "\<langle>a,b\<rangle> \<^bold>\<in> nonrestrict s X \<longleftrightarrow> \<langle>a,b\<rangle> \<^bold>\<in> s \<and> \<not> a \<^bold>\<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<langle>a, b\<rangle> \<^bold>\<in> nonrestrict s X) = (\<langle>a, b\<rangle> \<^bold>\<in> s \<and> a \<^bold>\<notin> X)
[PROOF STEP]
by (auto simp: nonrestrict_def)


[STATEMENT]
lemma compute_float_down[code]:
  "float_down p (Float m e) =
    (if p + e < 0 then Float (m div power_int 2 (-(p + e))) (-p) else Float m e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. float_down p (Float m e) = (if p + e < 0 then Float (m div Optimize_Integer.power_int 2 (- (p + e))) (- p) else Float m e)
[PROOF STEP]
by (simp add: Float.compute_float_down power_int_def)


[STATEMENT]
lemma finite_divisors_nat [simp]: (* FIXME move *)
  fixes m :: nat
  assumes "m > 0"
  shows "finite {d. d dvd m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {d. d dvd m}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {d. d dvd m}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < m
[PROOF STEP]
have "{d. d dvd m} \<subseteq> {d. d \<le> m}"
[PROOF STATE]
proof (prove)
using this:
0 < m

goal (1 subgoal):
 1. {d. d dvd m} \<subseteq> {d. d \<le> m}
[PROOF STEP]
by (auto dest: dvd_imp_le)
[PROOF STATE]
proof (state)
this:
{d. d dvd m} \<subseteq> {d. d \<le> m}

goal (1 subgoal):
 1. finite {d. d dvd m}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{d. d dvd m} \<subseteq> {d. d \<le> m}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{d. d dvd m} \<subseteq> {d. d \<le> m}

goal (1 subgoal):
 1. finite {d. d dvd m}
[PROOF STEP]
using finite_Collect_le_nat
[PROOF STATE]
proof (prove)
using this:
{d. d dvd m} \<subseteq> {d. d \<le> m}
finite {n. n \<le> ?k}

goal (1 subgoal):
 1. finite {d. d dvd m}
[PROOF STEP]
by (rule finite_subset)
[PROOF STATE]
proof (state)
this:
finite {d. d dvd m}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inv_list_rel_eq[simp]: "(\<langle>R\<rangle>list_rel)\<inverse> = \<langle>R\<inverse>\<rangle>list_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<langle>R\<rangle>list_rel)\<inverse> = \<langle>R\<inverse>\<rangle>list_rel
[PROOF STEP]
unfolding list_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(l, l'). list_all2 (\<lambda>x x'. (x, x') \<in> R) l l'}\<inverse> = {(l, l'). list_all2 (\<lambda>x x'. (x, x') \<in> R\<inverse>) l l'}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. list_all2 (\<lambda>x x'. (x, x') \<in> R) b a \<Longrightarrow> list_all2 (\<lambda>x x'. (x, x') \<in> R\<inverse>) a b
 2. \<And>a b. list_all2 (\<lambda>x x'. (x, x') \<in> R\<inverse>) a b \<Longrightarrow> list_all2 (\<lambda>x x'. (x, x') \<in> R) b a
[PROOF STEP]
apply (subst list.rel_flip[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. list_all2 (\<lambda>x x'. (x, x') \<in> R) b a \<Longrightarrow> list_all2 (\<lambda>x x'. (x, x') \<in> R\<inverse>)\<inverse>\<inverse> b a
 2. \<And>a b. list_all2 (\<lambda>x x'. (x, x') \<in> R\<inverse>) a b \<Longrightarrow> list_all2 (\<lambda>x x'. (x, x') \<in> R) b a
[PROOF STEP]
apply (simp add: conversep_iff[abs_def])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. list_all2 (\<lambda>x x'. (x, x') \<in> R\<inverse>) a b \<Longrightarrow> list_all2 (\<lambda>x x'. (x, x') \<in> R) b a
[PROOF STEP]
apply (subst list.rel_flip[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. list_all2 (\<lambda>x x'. (x, x') \<in> R\<inverse>) a b \<Longrightarrow> list_all2 (\<lambda>x x'. (x, x') \<in> R)\<inverse>\<inverse> a b
[PROOF STEP]
apply (simp add: conversep_iff[abs_def])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma tendsto_arctan_at_top: "(arctan \<longlongrightarrow> (pi/2)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (arctan \<longlongrightarrow> pi / 2) at_top
[PROOF STEP]
proof (rule tendstoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F x in at_top. dist (arctan x) (pi / 2) < e
[PROOF STEP]
fix e :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F x in at_top. dist (arctan x) (pi / 2) < e
[PROOF STEP]
assume "0 < e"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F x in at_top. dist (arctan x) (pi / 2) < e
[PROOF STEP]
define y where "y = pi/2 - min (pi/2) e"
[PROOF STATE]
proof (state)
this:
y = pi / 2 - min (pi / 2) e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F x in at_top. dist (arctan x) (pi / 2) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = pi / 2 - min (pi / 2) e
[PROOF STEP]
have y: "0 \<le> y" "y < pi/2" "pi/2 \<le> e + y"
[PROOF STATE]
proof (prove)
using this:
y = pi / 2 - min (pi / 2) e

goal (1 subgoal):
 1. 0 \<le> y &&& y < pi / 2 &&& pi / 2 \<le> e + y
[PROOF STEP]
using \<open>0 < e\<close>
[PROOF STATE]
proof (prove)
using this:
y = pi / 2 - min (pi / 2) e
0 < e

goal (1 subgoal):
 1. 0 \<le> y &&& y < pi / 2 &&& pi / 2 \<le> e + y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> y
y < pi / 2
pi / 2 \<le> e + y

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F x in at_top. dist (arctan x) (pi / 2) < e
[PROOF STEP]
show "eventually (\<lambda>x. dist (arctan x) (pi/2) < e) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. dist (arctan x) (pi / 2) < e
[PROOF STEP]
proof (intro eventually_at_top_dense[THEN iffD2] exI allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. ?N2 < n \<Longrightarrow> dist (arctan n) (pi / 2) < e
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. ?N2 < n \<Longrightarrow> dist (arctan n) (pi / 2) < e
[PROOF STEP]
assume "tan y < x"
[PROOF STATE]
proof (state)
this:
tan y < x

goal (1 subgoal):
 1. \<And>n. ?N2 < n \<Longrightarrow> dist (arctan n) (pi / 2) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tan y < x
[PROOF STEP]
have "arctan (tan y) < arctan x"
[PROOF STATE]
proof (prove)
using this:
tan y < x

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

goal (1 subgoal):
 1. \<And>n. ?N2 < n \<Longrightarrow> dist (arctan n) (pi / 2) < e
[PROOF STEP]
with y
[PROOF STATE]
proof (chain)
picking this:
0 \<le> y
y < pi / 2
pi / 2 \<le> e + y
arctan (tan y) < arctan x
[PROOF STEP]
have "y < arctan x"
[PROOF STATE]
proof (prove)
using this:
0 \<le> y
y < pi / 2
pi / 2 \<le> e + y
arctan (tan y) < arctan x

goal (1 subgoal):
 1. y < arctan x
[PROOF STEP]
by (subst (asm) arctan_tan) simp_all
[PROOF STATE]
proof (state)
this:
y < arctan x

goal (1 subgoal):
 1. \<And>n. ?N2 < n \<Longrightarrow> dist (arctan n) (pi / 2) < e
[PROOF STEP]
with arctan_ubound[of x, arith] y \<open>0 < e\<close>
[PROOF STATE]
proof (chain)
picking this:
arctan x < pi / 2
0 \<le> y
y < pi / 2
pi / 2 \<le> e + y
0 < e
y < arctan x
[PROOF STEP]
show "dist (arctan x) (pi/2) < e"
[PROOF STATE]
proof (prove)
using this:
arctan x < pi / 2
0 \<le> y
y < pi / 2
pi / 2 \<le> e + y
0 < e
y < arctan x

goal (1 subgoal):
 1. dist (arctan x) (pi / 2) < e
[PROOF STEP]
by (simp add: dist_real_def)
[PROOF STATE]
proof (state)
this:
dist (arctan x) (pi / 2) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. dist (arctan x) (pi / 2) < e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group_add) nataction_add_eq0_flip:
  assumes "(a+b)+^n = 0"
  shows   "(b+a)+^n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b + a) +^ n = (0::'a)
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (b + a) +^ n = (0::'a)
 2. \<And>nat. n = Suc nat \<Longrightarrow> (b + a) +^ n = (0::'a)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
n = Suc k

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (b + a) +^ n = (0::'a)
 2. \<And>nat. n = Suc nat \<Longrightarrow> (b + a) +^ n = (0::'a)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
(a + b) +^ n = (0::'a)
n = Suc k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a + b) +^ n = (0::'a)
n = Suc k

goal (1 subgoal):
 1. (b + a) +^ n = (0::'a)
[PROOF STEP]
using nataction_add_flip add.assoc[of "-a" "a+b" "(a+b)+^k"]
[PROOF STATE]
proof (prove)
using this:
(a + b) +^ n = (0::'a)
n = Suc k
(?a + ?b) +^ Suc ?n = ?a + (?b + ?a) +^ ?n + ?b
- a + (a + b) + (a + b) +^ k = - a + (a + b + (a + b) +^ k)

goal (1 subgoal):
 1. (b + a) +^ n = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(b + a) +^ n = (0::'a)

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> (b + a) +^ n = (0::'a)
[PROOF STEP]
qed simp


[STATEMENT]
lemma pos_less_minus_divideR_eq [field_simps]:
  "a < - (b /\<^sub>R c) \<longleftrightarrow> c *\<^sub>R a < - b" if "c > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a < - (b /\<^sub>R c)) = (c *\<^sub>R a < - b)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. (a < - (b /\<^sub>R c)) = (c *\<^sub>R a < - b)
[PROOF STEP]
by (metis le_less less_le_not_le pos_divideR_le_eq
    pos_divideR_less_eq pos_le_minus_divideR_eq)


[STATEMENT]
lemma fls_divide_X_power':
  fixes   f :: "'a::{semiring_1,inverse,uminus} fls"
  assumes "inverse (1::'a) = 1"
  shows   "f / (fls_X ^ n) = fls_shift n f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f / fls_X ^ n = fls_shift (int n) f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f / fls_X ^ n = fls_shift (int n) f
[PROOF STEP]
have "fls_base_factor_to_fps ((fls_X::'a fls) ^ n) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor_to_fps (fls_X ^ n) = 1
[PROOF STEP]
by (rule fls_X_power_base_factor_to_fps)
[PROOF STATE]
proof (state)
this:
fls_base_factor_to_fps (fls_X ^ n) = 1

goal (1 subgoal):
 1. f / fls_X ^ n = fls_shift (int n) f
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
inverse (1::'a) = (1::'a)
fls_base_factor_to_fps (fls_X ^ n) = 1
[PROOF STEP]
have
    "f / (fls_X ^ n) =
      fls_shift n (fls_shift (-fls_subdegree f) (fps_to_fls (fls_base_factor_to_fps f)))"
[PROOF STATE]
proof (prove)
using this:
inverse (1::'a) = (1::'a)
fls_base_factor_to_fps (fls_X ^ n) = 1

goal (1 subgoal):
 1. f / fls_X ^ n = fls_shift (int n) (fls_shift (- fls_subdegree f) (fls_regpart_as_fls (fls_base_factor f)))
[PROOF STEP]
by (simp add: fls_divide_def fps_divide_1')
[PROOF STATE]
proof (state)
this:
f / fls_X ^ n = fls_shift (int n) (fls_shift (- fls_subdegree f) (fls_regpart_as_fls (fls_base_factor f)))

goal (1 subgoal):
 1. f / fls_X ^ n = fls_shift (int n) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f / fls_X ^ n = fls_shift (int n) (fls_shift (- fls_subdegree f) (fls_regpart_as_fls (fls_base_factor f)))

goal (1 subgoal):
 1. f / fls_X ^ n = fls_shift (int n) f
[PROOF STEP]
have "\<dots> = fls_shift n f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_shift (int n) (fls_shift (- fls_subdegree f) (fls_regpart_as_fls (fls_base_factor f))) = fls_shift (int n) f
[PROOF STEP]
using fls_conv_base_factor_to_fps_shift_subdegree[of f]
[PROOF STATE]
proof (prove)
using this:
f = fls_shift (- fls_subdegree f) (fls_regpart_as_fls (fls_base_factor f))

goal (1 subgoal):
 1. fls_shift (int n) (fls_shift (- fls_subdegree f) (fls_regpart_as_fls (fls_base_factor f))) = fls_shift (int n) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_shift (int n) (fls_shift (- fls_subdegree f) (fls_regpart_as_fls (fls_base_factor f))) = fls_shift (int n) f

goal (1 subgoal):
 1. f / fls_X ^ n = fls_shift (int n) f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f / fls_X ^ n = fls_shift (int n) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f / fls_X ^ n = fls_shift (int n) f

goal (1 subgoal):
 1. f / fls_X ^ n = fls_shift (int n) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f / fls_X ^ n = fls_shift (int n) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma n_distrib_left: "n x \<cdot> (n y + n z) = (n x \<cdot> n y) + (n x \<cdot> n z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. !x \<cdot> (!y + !z) = !x \<cdot> !y + !x \<cdot> !z
[PROOF STEP]
by (metis (no_types) add_transl local.de_morgan4 local.n_distrib1)


[STATEMENT]
lemma LIMSEQ_iff:
  fixes L :: "'a::real_normed_vector"
  shows "(X \<longlonglongrightarrow> L) = (\<forall>r>0. \<exists>no. \<forall>n \<ge> no. norm (X n - L) < r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<longlonglongrightarrow> L = (\<forall>r>0. \<exists>no. \<forall>n\<ge>no. norm (X n - L) < r)
[PROOF STEP]
unfolding lim_sequentially dist_norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>r>0. \<exists>no. \<forall>n\<ge>no. norm (X n - L) < r) = (\<forall>r>0. \<exists>no. \<forall>n\<ge>no. norm (X n - L) < r)
[PROOF STEP]
..


[STATEMENT]
lemma sets_stream_filteration_le_stream_space: "sets (stream_filtration M n) \<subseteq> sets (stream_space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (stream_filtration M n) \<subseteq> sets (stream_space M)
[PROOF STEP]
unfolding sets_stream_space_eq stream_filtration_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (\<Squnion>i\<in>{x. enat x \<le> n}. vimage_algebra (streams (space M)) (\<lambda>\<omega>. \<omega> !! i) M) \<subseteq> sets (\<Squnion>i. vimage_algebra (streams (space M)) (\<lambda>s. s !! i) M)
[PROOF STEP]
by (intro SUP_subset_mono le_measureD2) (auto simp: space_Sup_eq_UN enat_0 elim!: allE[of _ 0])


[STATEMENT]
lemma countable_image_eq:
   "countable(f ` S) \<longleftrightarrow> (\<exists>T. countable T \<and> T \<subseteq> S \<and> f ` S = f ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (f ` S) = (\<exists>T. countable T \<and> T \<subseteq> S \<and> f ` S = f ` T)
[PROOF STEP]
by (metis countable_image countable_image_inj_eq order_refl subset_image_inj)


[STATEMENT]
lemma sum_pow2_inj:
  "\<lbrakk>finite X; finite Y; (\<Sum>x\<in>X. 2 ^ x :: nat) = (\<Sum>x\<in>Y. 2 ^ x)\<rbrakk> \<Longrightarrow> X = Y"
  (is "_ \<Longrightarrow> _ \<Longrightarrow> ?f X = ?f Y \<Longrightarrow> _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; finite Y; sum ((^) 2) X = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> X = Y
[PROOF STEP]
proof (induct X arbitrary: Y rule: finite_linorder_max_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
case (insert x X)
[PROOF STATE]
proof (state)
this:
finite X
\<forall>a\<in>X. a < x
\<lbrakk>finite ?Y; sum ((^) 2) X = sum ((^) 2) ?Y\<rbrakk> \<Longrightarrow> X = ?Y
finite Y
sum ((^) 2) (insert x X) = sum ((^) 2) Y

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
from insert(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>a\<in>X. a < x
[PROOF STEP]
have "?f X \<le> ?f {0 ..< x}"
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>X. a < x

goal (1 subgoal):
 1. sum ((^) 2) X \<le> sum ((^) 2) {0..<x}
[PROOF STEP]
by (intro sum_mono2) auto
[PROOF STATE]
proof (state)
this:
sum ((^) 2) X \<le> sum ((^) 2) {0..<x}

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((^) 2) X \<le> sum ((^) 2) {0..<x}

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
have "\<dots> < 2 ^ x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) 2) {0..<x} < 2 ^ x
[PROOF STEP]
by (induct x) simp_all
[PROOF STATE]
proof (state)
this:
sum ((^) 2) {0..<x} < 2 ^ x

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum ((^) 2) X < 2 ^ x
[PROOF STEP]
have "?f X < 2 ^ x"
[PROOF STATE]
proof (prove)
using this:
sum ((^) 2) X < 2 ^ x

goal (1 subgoal):
 1. sum ((^) 2) X < 2 ^ x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum ((^) 2) X < 2 ^ x

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum ((^) 2) X < 2 ^ x

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
from insert(1,2)
[PROOF STATE]
proof (chain)
picking this:
finite X
\<forall>a\<in>X. a < x
[PROOF STEP]
have *: "?f X + 2 ^ x = ?f Y"
[PROOF STATE]
proof (prove)
using this:
finite X
\<forall>a\<in>X. a < x

goal (1 subgoal):
 1. sum ((^) 2) X + 2 ^ x = sum ((^) 2) Y
[PROOF STEP]
using trans[OF sym[OF insert(5)] sum.insert]
[PROOF STATE]
proof (prove)
using this:
finite X
\<forall>a\<in>X. a < x
\<lbrakk>finite X; x \<notin> X\<rbrakk> \<Longrightarrow> sum ((^) 2) Y = 2 ^ x + sum ((^) 2) X

goal (1 subgoal):
 1. sum ((^) 2) X + 2 ^ x = sum ((^) 2) Y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum ((^) 2) X + 2 ^ x = sum ((^) 2) Y

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum ((^) 2) X < 2 ^ x
sum ((^) 2) X + 2 ^ x = sum ((^) 2) Y
[PROOF STEP]
have "?f Y < 2 ^ Suc x"
[PROOF STATE]
proof (prove)
using this:
sum ((^) 2) X < 2 ^ x
sum ((^) 2) X + 2 ^ x = sum ((^) 2) Y

goal (1 subgoal):
 1. sum ((^) 2) Y < 2 ^ Suc x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum ((^) 2) Y < 2 ^ Suc x

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
have "\<forall>y \<in> Y. y \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>Y. y \<le> x
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>y\<in>Y. y \<le> x) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<forall>y\<in>Y. y \<le> x)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>y\<in>Y. y \<le> x)

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>Y. y \<le> x) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>y\<in>Y. y \<le> x)
[PROOF STEP]
obtain y where "y \<in> Y" "Suc x \<le> y"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>y\<in>Y. y \<le> x)

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

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>Y. y \<le> x) \<Longrightarrow> False
[PROOF STEP]
from this(2)
[PROOF STATE]
proof (chain)
picking this:
Suc x \<le> y
[PROOF STEP]
have "2 ^ Suc x \<le> (2 ^ y :: nat)"
[PROOF STATE]
proof (prove)
using this:
Suc x \<le> y

goal (1 subgoal):
 1. 2 ^ Suc x \<le> 2 ^ y
[PROOF STEP]
by (intro power_increasing) auto
[PROOF STATE]
proof (state)
this:
2 ^ Suc x \<le> 2 ^ y

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>Y. y \<le> x) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 ^ Suc x \<le> 2 ^ y

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>Y. y \<le> x) \<Longrightarrow> False
[PROOF STEP]
from \<open>y \<in> Y\<close> insert(4)
[PROOF STATE]
proof (chain)
picking this:
y \<in> Y
finite Y
[PROOF STEP]
have "\<dots> \<le> ?f Y"
[PROOF STATE]
proof (prove)
using this:
y \<in> Y
finite Y

goal (1 subgoal):
 1. 2 ^ y \<le> sum ((^) 2) Y
[PROOF STEP]
by (metis order.refl sum.remove trans_le_add1)
[PROOF STATE]
proof (state)
this:
2 ^ y \<le> sum ((^) 2) Y

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>Y. y \<le> x) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 ^ Suc x \<le> sum ((^) 2) Y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
2 ^ Suc x \<le> sum ((^) 2) Y

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>?f Y < 2 ^ Suc x\<close>
[PROOF STATE]
proof (prove)
using this:
2 ^ Suc x \<le> sum ((^) 2) Y
sum ((^) 2) Y < 2 ^ Suc x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>Y. y \<le> x

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>Y. y \<le> x

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
assume "x \<notin> Y"
[PROOF STATE]
proof (state)
this:
x \<notin> Y

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
with \<open>\<forall>y \<in> Y. y \<le> x\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>y\<in>Y. y \<le> x
x \<notin> Y
[PROOF STEP]
have "?f Y \<le> ?f {0 ..< x}"
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>Y. y \<le> x
x \<notin> Y

goal (1 subgoal):
 1. sum ((^) 2) Y \<le> sum ((^) 2) {0..<x}
[PROOF STEP]
by (intro sum_mono2) (auto simp: le_less)
[PROOF STATE]
proof (state)
this:
sum ((^) 2) Y \<le> sum ((^) 2) {0..<x}

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((^) 2) Y \<le> sum ((^) 2) {0..<x}

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
have "\<dots> < 2 ^ x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) 2) {0..<x} < 2 ^ x
[PROOF STEP]
by (induct x) simp_all
[PROOF STATE]
proof (state)
this:
sum ((^) 2) {0..<x} < 2 ^ x

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum ((^) 2) Y < 2 ^ x
[PROOF STEP]
have "?f Y < 2 ^ x"
[PROOF STATE]
proof (prove)
using this:
sum ((^) 2) Y < 2 ^ x

goal (1 subgoal):
 1. sum ((^) 2) Y < 2 ^ x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum ((^) 2) Y < 2 ^ x

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
sum ((^) 2) X + 2 ^ x = sum ((^) 2) Y
sum ((^) 2) Y < 2 ^ x
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
sum ((^) 2) X + 2 ^ x = sum ((^) 2) Y
sum ((^) 2) Y < 2 ^ x

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
x \<notin> Y \<Longrightarrow> False

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<notin> Y \<Longrightarrow> False
[PROOF STEP]
have "x \<in> Y"
[PROOF STATE]
proof (prove)
using this:
x \<notin> Y \<Longrightarrow> False

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

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
from insert(4)
[PROOF STATE]
proof (chain)
picking this:
finite Y
[PROOF STEP]
have "?f (Y - {x}) + 2 ^ x = ?f (insert x (Y - {x}))"
[PROOF STATE]
proof (prove)
using this:
finite Y

goal (1 subgoal):
 1. sum ((^) 2) (Y - {x}) + 2 ^ x = sum ((^) 2) (insert x (Y - {x}))
[PROOF STEP]
by (subst sum.insert) auto
[PROOF STATE]
proof (state)
this:
sum ((^) 2) (Y - {x}) + 2 ^ x = sum ((^) 2) (insert x (Y - {x}))

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((^) 2) (Y - {x}) + 2 ^ x = sum ((^) 2) (insert x (Y - {x}))

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
have "\<dots> = ?f X + 2 ^ x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) 2) (insert x (Y - {x})) = sum ((^) 2) X + 2 ^ x
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) 2) (insert x (Y - {x})) = sum ((^) 2) Y
[PROOF STEP]
using \<open>x \<in> Y\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> Y

goal (1 subgoal):
 1. sum ((^) 2) (insert x (Y - {x})) = sum ((^) 2) Y
[PROOF STEP]
by (simp add: insert_absorb)
[PROOF STATE]
proof (state)
this:
sum ((^) 2) (insert x (Y - {x})) = sum ((^) 2) X + 2 ^ x

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum ((^) 2) (Y - {x}) + 2 ^ x = sum ((^) 2) X + 2 ^ x
[PROOF STEP]
have "?f X = ?f (Y - {x})"
[PROOF STATE]
proof (prove)
using this:
sum ((^) 2) (Y - {x}) + 2 ^ x = sum ((^) 2) X + 2 ^ x

goal (1 subgoal):
 1. sum ((^) 2) X = sum ((^) 2) (Y - {x})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum ((^) 2) X = sum ((^) 2) (Y - {x})

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
with insert(3,4)
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite ?Y; sum ((^) 2) X = sum ((^) 2) ?Y\<rbrakk> \<Longrightarrow> X = ?Y
finite Y
sum ((^) 2) X = sum ((^) 2) (Y - {x})
[PROOF STEP]
have "X = Y - {x}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?Y; sum ((^) 2) X = sum ((^) 2) ?Y\<rbrakk> \<Longrightarrow> X = ?Y
finite Y
sum ((^) 2) X = sum ((^) 2) (Y - {x})

goal (1 subgoal):
 1. X = Y - {x}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X = Y - {x}

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
 2. \<And>b A Y. \<lbrakk>finite A; \<forall>a\<in>A. a < b; \<And>Y. \<lbrakk>finite Y; sum ((^) 2) A = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> A = Y; finite Y; sum ((^) 2) (insert b A) = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> insert b A = Y
[PROOF STEP]
with \<open>x \<in> Y\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> Y
X = Y - {x}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x \<in> Y
X = Y - {x}

goal (1 subgoal):
 1. insert x X = Y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert x X = Y

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>finite Y; sum ((^) 2) {} = sum ((^) 2) Y\<rbrakk> \<Longrightarrow> {} = Y
[PROOF STEP]
qed simp


[STATEMENT]
lemma "abc_steps_l (0,[5,3]) abcP_out_of_pgm_ex (10 +6) = (41, [0, 8])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abc_steps_l (0, [5, 3]) abcP_out_of_pgm_ex (10 + 6) = (41, [0, 8])
[PROOF STEP]
by (simp add: abc_steps_l.simps abc_step_l.simps abc_fetch.simps abc_lm_v.simps abc_lm_s.simps
                numeral_eqs_upto_12
                abcP_out_of_pgm_ex_def )


[STATEMENT]
lemma max_ffilter_below[simp]: "\<lbrakk>x |\<in>| P; x < n\<rbrakk> \<Longrightarrow>
  max n (Suc (fMax (ffilter (\<lambda>i. i < n) P))) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x |\<in>| P; x < n\<rbrakk> \<Longrightarrow> max n (Suc (fMax (ffilter (\<lambda>i. i < n) P))) = n
[PROOF STEP]
by (metis max.absorb1 Suc_leI fMax_in fempty_iff ffmember_filter)


[STATEMENT]
lemma Iff_E:
  "insert A (insert B H) \<turnstile> C \<Longrightarrow> insert (neg A) (insert (neg B) H) \<turnstile> C \<Longrightarrow> insert (A IFF B) H \<turnstile> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>insert A (insert B H) \<turnstile> C; insert (neg A) (insert (neg B) H) \<turnstile> C\<rbrakk> \<Longrightarrow> insert (A IFF B) H \<turnstile> C
[PROOF STEP]
by (simp add: Assume Iff_def anti_deduction cnj_E dsj_EH(2) dsj_I1 insert_commute)


[STATEMENT]
lemma eventually_at_left_real: "a > (b :: real) \<Longrightarrow> eventually (\<lambda>x. x \<in> {b<..<a}) (at_left a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b < a \<Longrightarrow> \<forall>\<^sub>F x in at_left a. x \<in> {b<..<a}
[PROOF STEP]
by (subst eventually_at, rule exI[of _ "a - b"]) (force simp: dist_real_def)