[STATEMENT]
lemma complete_digraph_are_iso:
  assumes "K\<^bsub>n\<^esub> G" "K\<^bsub>n\<^esub> H" shows "digraph_iso G H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
interpret G: graph G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
K\<^bsub>n\<^esub> G
K\<^bsub>n\<^esub> H

goal (1 subgoal):
 1. graph G
[PROOF STEP]
by (simp add: complete_digraph_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
interpret H: graph H
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph H
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
K\<^bsub>n\<^esub> G
K\<^bsub>n\<^esub> H

goal (1 subgoal):
 1. graph H
[PROOF STEP]
by (simp add: complete_digraph_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
K\<^bsub>n\<^esub> G
K\<^bsub>n\<^esub> H
[PROOF STEP]
have "card (verts G) = n" "card (verts H) = n"
[PROOF STATE]
proof (prove)
using this:
K\<^bsub>n\<^esub> G
K\<^bsub>n\<^esub> H

goal (1 subgoal):
 1. card (verts G) = n &&& card (verts H) = n
[PROOF STEP]
by (auto simp: complete_digraph_def)
[PROOF STATE]
proof (state)
this:
card (verts G) = n
card (verts H) = n

goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
with G.finite_verts H.finite_verts
[PROOF STATE]
proof (chain)
picking this:
finite (verts G)
finite (verts H)
card (verts G) = n
card (verts H) = n
[PROOF STEP]
obtain fv where "bij_betw fv (verts G) (verts H)"
[PROOF STATE]
proof (prove)
using this:
finite (verts G)
finite (verts H)
card (verts G) = n
card (verts H) = n

goal (1 subgoal):
 1. (\<And>fv. bij_betw fv (verts G) (verts H) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis finite_same_card_bij)
[PROOF STATE]
proof (state)
this:
bij_betw fv (verts G) (verts H)

goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw fv (verts G) (verts H)
[PROOF STEP]
have fv: "inj_on fv (verts G)" "verts H = fv ` verts G"
[PROOF STATE]
proof (prove)
using this:
bij_betw fv (verts G) (verts H)

goal (1 subgoal):
 1. inj_on fv (verts G) &&& verts H = fv ` verts G
[PROOF STEP]
by (auto simp: bij_betw_def)
[PROOF STATE]
proof (state)
this:
inj_on fv (verts G)
verts H = fv ` verts G

goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
have "arcs_ends H = {(u,v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arcs_ends H = {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
using \<open>K\<^bsub>n\<^esub> H\<close>
[PROOF STATE]
proof (prove)
using this:
K\<^bsub>n\<^esub> H

goal (1 subgoal):
 1. arcs_ends H = {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
by (auto simp: complete_digraph_def)
[PROOF STATE]
proof (state)
this:
arcs_ends H = {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}

goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
arcs_ends H = {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}

goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
have "\<dots> = pairself fv ` {(u,v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v} = pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
[PROOF STEP]
proof (intro set_eqI iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v} \<Longrightarrow> x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
 2. \<And>x. x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} \<Longrightarrow> x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v} \<Longrightarrow> x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
 2. \<And>x. x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} \<Longrightarrow> x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
assume "x \<in> ?L"
[PROOF STATE]
proof (state)
this:
x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}

goal (2 subgoals):
 1. \<And>x. x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v} \<Longrightarrow> x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
 2. \<And>x. x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} \<Longrightarrow> x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
have "fst x \<in> fv ` verts G" "snd x \<in> fv ` verts G" "fst x \<noteq> snd x"
[PROOF STATE]
proof (prove)
using this:
x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}

goal (1 subgoal):
 1. fst x \<in> fv ` verts G &&& snd x \<in> fv ` verts G &&& fst x \<noteq> snd x
[PROOF STEP]
using fv
[PROOF STATE]
proof (prove)
using this:
x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
inj_on fv (verts G)
verts H = fv ` verts G

goal (1 subgoal):
 1. fst x \<in> fv ` verts G &&& snd x \<in> fv ` verts G &&& fst x \<noteq> snd x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst x \<in> fv ` verts G
snd x \<in> fv ` verts G
fst x \<noteq> snd x

goal (2 subgoals):
 1. \<And>x. x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v} \<Longrightarrow> x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
 2. \<And>x. x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} \<Longrightarrow> x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fst x \<in> fv ` verts G
snd x \<in> fv ` verts G
fst x \<noteq> snd x
[PROOF STEP]
obtain u v where "fst x = fv u" "snd x = fv v" "u \<in> verts G" "v \<in> verts G"
[PROOF STATE]
proof (prove)
using this:
fst x \<in> fv ` verts G
snd x \<in> fv ` verts G
fst x \<noteq> snd x

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>fst x = fv u; snd x = fv v; u \<in> verts G; v \<in> verts G\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst x = fv u
snd x = fv v
u \<in> verts G
v \<in> verts G

goal (2 subgoals):
 1. \<And>x. x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v} \<Longrightarrow> x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
 2. \<And>x. x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} \<Longrightarrow> x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fst x = fv u
snd x = fv v
u \<in> verts G
v \<in> verts G
[PROOF STEP]
have "(fst x, snd x) \<in> ?R"
[PROOF STATE]
proof (prove)
using this:
fst x = fv u
snd x = fv v
u \<in> verts G
v \<in> verts G

goal (1 subgoal):
 1. (fst x, snd x) \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
[PROOF STEP]
using \<open>x \<in> ?L\<close>
[PROOF STATE]
proof (prove)
using this:
fst x = fv u
snd x = fv v
u \<in> verts G
v \<in> verts G
x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}

goal (1 subgoal):
 1. (fst x, snd x) \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
[PROOF STEP]
by (auto simp: pairself_def)
[PROOF STATE]
proof (state)
this:
(fst x, snd x) \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}

goal (2 subgoals):
 1. \<And>x. x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v} \<Longrightarrow> x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
 2. \<And>x. x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} \<Longrightarrow> x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(fst x, snd x) \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
[PROOF STEP]
show "x \<in> ?R"
[PROOF STATE]
proof (prove)
using this:
(fst x, snd x) \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}

goal (1 subgoal):
 1. x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}

goal (1 subgoal):
 1. \<And>x. x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} \<Longrightarrow> x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} \<Longrightarrow> x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} \<Longrightarrow> x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
assume "x \<in> ?R"
[PROOF STATE]
proof (state)
this:
x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}

goal (1 subgoal):
 1. \<And>x. x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} \<Longrightarrow> x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
[PROOF STEP]
show "x \<in> ?L"
[PROOF STATE]
proof (prove)
using this:
x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}

goal (1 subgoal):
 1. x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
using fv
[PROOF STATE]
proof (prove)
using this:
x \<in> pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}
inj_on fv (verts G)
verts H = fv ` verts G

goal (1 subgoal):
 1. x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}
[PROOF STEP]
by (auto simp: pairself_def dest: inj_onD)
[PROOF STATE]
proof (state)
this:
x \<in> {(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v} = pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}

goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{(u, v). u \<in> verts H \<and> v \<in> verts H \<and> u \<noteq> v} = pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v}

goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
have "\<dots> = pairself fv ` arcs_ends G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} = pairself fv ` arcs_ends G
[PROOF STEP]
using \<open>K\<^bsub>n\<^esub> G\<close>
[PROOF STATE]
proof (prove)
using this:
K\<^bsub>n\<^esub> G

goal (1 subgoal):
 1. pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} = pairself fv ` arcs_ends G
[PROOF STEP]
by (auto simp: complete_digraph_def)
[PROOF STATE]
proof (state)
this:
pairself fv ` {(u, v). u \<in> verts G \<and> v \<in> verts G \<and> u \<noteq> v} = pairself fv ` arcs_ends G

goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
arcs_ends H = pairself fv ` arcs_ends G
[PROOF STEP]
have arcs_ends: "arcs_ends H = pairself fv ` arcs_ends G"
[PROOF STATE]
proof (prove)
using this:
arcs_ends H = pairself fv ` arcs_ends G

goal (1 subgoal):
 1. arcs_ends H = pairself fv ` arcs_ends G
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
arcs_ends H = pairself fv ` arcs_ends G

goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
using H.nomulti_digraph fv arcs_ends
[PROOF STATE]
proof (prove)
using this:
nomulti_digraph H
inj_on fv (verts G)
verts H = fv ` verts G
arcs_ends H = pairself fv ` arcs_ends G

goal (1 subgoal):
 1. digraph_iso G H
[PROOF STEP]
by (rule G.digraph_iso_mk_iso_nomulti)
[PROOF STATE]
proof (state)
this:
digraph_iso G H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma one_reducible_to_via_trans: "\<lbrakk> one_reducible_to_via A B f; one_reducible_to_via B C g \<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g o f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
assume A1: "one_reducible_to_via A B f"
[PROOF STATE]
proof (state)
this:
one_reducible_to_via A B f

goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
assume A2: "one_reducible_to_via B C g"
[PROOF STATE]
proof (state)
this:
one_reducible_to_via B C g

goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
one_reducible_to_via A B f
[PROOF STEP]
have f_tr: "total_recursive f"
[PROOF STATE]
proof (prove)
using this:
one_reducible_to_via A B f

goal (1 subgoal):
 1. total_recursive f
[PROOF STEP]
by (unfold one_reducible_to_via_def, auto)
[PROOF STATE]
proof (state)
this:
total_recursive f

goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
one_reducible_to_via A B f
[PROOF STEP]
have f_inj: "inj f"
[PROOF STATE]
proof (prove)
using this:
one_reducible_to_via A B f

goal (1 subgoal):
 1. inj f
[PROOF STEP]
by (unfold one_reducible_to_via_def, auto)
[PROOF STATE]
proof (state)
this:
inj f

goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
one_reducible_to_via A B f
[PROOF STEP]
have L1: "\<forall> x. (x \<in> A) = (f x \<in> B)"
[PROOF STATE]
proof (prove)
using this:
one_reducible_to_via A B f

goal (1 subgoal):
 1. \<forall>x. (x \<in> A) = (f x \<in> B)
[PROOF STEP]
by (unfold one_reducible_to_via_def, auto)
[PROOF STATE]
proof (state)
this:
\<forall>x. (x \<in> A) = (f x \<in> B)

goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
from A2
[PROOF STATE]
proof (chain)
picking this:
one_reducible_to_via B C g
[PROOF STEP]
have g_tr: "total_recursive g"
[PROOF STATE]
proof (prove)
using this:
one_reducible_to_via B C g

goal (1 subgoal):
 1. total_recursive g
[PROOF STEP]
by (unfold one_reducible_to_via_def, auto)
[PROOF STATE]
proof (state)
this:
total_recursive g

goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
from A2
[PROOF STATE]
proof (chain)
picking this:
one_reducible_to_via B C g
[PROOF STEP]
have g_inj: "inj g"
[PROOF STATE]
proof (prove)
using this:
one_reducible_to_via B C g

goal (1 subgoal):
 1. inj g
[PROOF STEP]
by (unfold one_reducible_to_via_def, auto)
[PROOF STATE]
proof (state)
this:
inj g

goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
from A2
[PROOF STATE]
proof (chain)
picking this:
one_reducible_to_via B C g
[PROOF STEP]
have L2: "\<forall> x. (x \<in> B) = (g x \<in> C)"
[PROOF STATE]
proof (prove)
using this:
one_reducible_to_via B C g

goal (1 subgoal):
 1. \<forall>x. (x \<in> B) = (g x \<in> C)
[PROOF STEP]
by (unfold one_reducible_to_via_def, auto)
[PROOF STATE]
proof (state)
this:
\<forall>x. (x \<in> B) = (g x \<in> C)

goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
from g_tr f_tr
[PROOF STATE]
proof (chain)
picking this:
total_recursive g
total_recursive f
[PROOF STEP]
have fg_tr: "total_recursive (g o f)"
[PROOF STATE]
proof (prove)
using this:
total_recursive g
total_recursive f

goal (1 subgoal):
 1. total_recursive (g \<circ> f)
[PROOF STEP]
by (rule comp_tot_rec)
[PROOF STATE]
proof (state)
this:
total_recursive (g \<circ> f)

goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
from g_inj f_inj
[PROOF STATE]
proof (chain)
picking this:
inj g
inj f
[PROOF STEP]
have fg_inj: "inj (g o f)"
[PROOF STATE]
proof (prove)
using this:
inj g
inj f

goal (1 subgoal):
 1. inj (g \<circ> f)
[PROOF STEP]
by (rule inj_compose)
[PROOF STATE]
proof (state)
this:
inj (g \<circ> f)

goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
from L1 L2
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. (x \<in> A) = (f x \<in> B)
\<forall>x. (x \<in> B) = (g x \<in> C)
[PROOF STEP]
have L3: "(\<forall> x. (x \<in> A) = ((g o f) x \<in> C))"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. (x \<in> A) = (f x \<in> B)
\<forall>x. (x \<in> B) = (g x \<in> C)

goal (1 subgoal):
 1. \<forall>x. (x \<in> A) = ((g \<circ> f) x \<in> C)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x. (x \<in> A) = ((g \<circ> f) x \<in> C)

goal (1 subgoal):
 1. \<lbrakk>one_reducible_to_via A B f; one_reducible_to_via B C g\<rbrakk> \<Longrightarrow> one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
with fg_tr fg_inj
[PROOF STATE]
proof (chain)
picking this:
total_recursive (g \<circ> f)
inj (g \<circ> f)
\<forall>x. (x \<in> A) = ((g \<circ> f) x \<in> C)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
total_recursive (g \<circ> f)
inj (g \<circ> f)
\<forall>x. (x \<in> A) = ((g \<circ> f) x \<in> C)

goal (1 subgoal):
 1. one_reducible_to_via A C (g \<circ> f)
[PROOF STEP]
by (unfold one_reducible_to_via_def, auto)
[PROOF STATE]
proof (state)
this:
one_reducible_to_via A C (g \<circ> f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powa_minus_one:
  assumes "1 \<le> a" shows "a powa -1 = inverse a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a powa - 1 = inverse a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a powa - 1 = inverse a
[PROOF STEP]
have "(\<lambda>n. a pow\<^sub>\<rat> - 1) \<longlonglongrightarrow> inverse a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> - 1) \<longlonglongrightarrow> inverse a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> a

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> - 1) \<longlonglongrightarrow> inverse a
[PROOF STEP]
by (simp add: powrat_minus)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. a pow\<^sub>\<rat> - 1) \<longlonglongrightarrow> inverse a

goal (1 subgoal):
 1. a powa - 1 = inverse a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. a pow\<^sub>\<rat> - 1) \<longlonglongrightarrow> inverse a
[PROOF STEP]
have "(\<lambda>n. a pow\<^sub>\<rat> incseq_of (- 1) n) \<longlonglongrightarrow> inverse a"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> - 1) \<longlonglongrightarrow> inverse a

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> incseq_of (- 1) n) \<longlonglongrightarrow> inverse a
[PROOF STEP]
using powa_indep_incseq_of' [of a "\<lambda>n. -1"] assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> - 1) \<longlonglongrightarrow> inverse a
\<lbrakk>1 \<le> a; incseq (\<lambda>n. - 1); (\<lambda>n. real_of_rat (- 1)) \<longlonglongrightarrow> ?x; (\<lambda>n. a pow\<^sub>\<rat> - 1) \<longlonglongrightarrow> ?y\<rbrakk> \<Longrightarrow> (\<lambda>n. a pow\<^sub>\<rat> incseq_of ?x n) \<longlonglongrightarrow> ?y
1 \<le> a

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> incseq_of (- 1) n) \<longlonglongrightarrow> inverse a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. a pow\<^sub>\<rat> incseq_of (- 1) n) \<longlonglongrightarrow> inverse a

goal (1 subgoal):
 1. a powa - 1 = inverse a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. a pow\<^sub>\<rat> incseq_of (- 1) n) \<longlonglongrightarrow> inverse a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> incseq_of (- 1) n) \<longlonglongrightarrow> inverse a

goal (1 subgoal):
 1. a powa - 1 = inverse a
[PROOF STEP]
using powa_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> incseq_of (- 1) n) \<longlonglongrightarrow> inverse a
?a powa ?x = (THE y. (\<lambda>n. ?a pow\<^sub>\<rat> incseq_of ?x n) \<longlonglongrightarrow> y)

goal (1 subgoal):
 1. a powa - 1 = inverse a
[PROOF STEP]
by (metis Lim_def limI)
[PROOF STATE]
proof (state)
this:
a powa - 1 = inverse a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_map_vec[simp]:
  "i < dim_vec v \<Longrightarrow> map_vec f v $ i = f (v $ i)"
  "dim_vec (map_vec f v) = dim_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i < dim_vec v \<Longrightarrow> map_vec f v $ i = f (v $ i)) &&& dim_vec (map_vec f v) = dim_vec v
[PROOF STEP]
unfolding map_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i < dim_vec v \<Longrightarrow> vec (dim_vec v) (\<lambda>i. f (v $ i)) $ i = f (v $ i)) &&& dim_vec (vec (dim_vec v) (\<lambda>i. f (v $ i))) = dim_vec v
[PROOF STEP]
by auto


[STATEMENT]
lemma dfs_isNode:
  assumes S: "invariant S"
      and xs: "list_all isNode xs"
  shows "set_of (dfs S xs) \<subseteq> {x . isNode x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (dfs S xs) \<subseteq> {x. isNode x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
invariant S
list_all isNode xs

goal (1 subgoal):
 1. set_of (dfs S xs) \<subseteq> {x. isNode x}
[PROOF STEP]
by (induct S xs rule: dfs_induct) (auto simp: set_of_def)


[STATEMENT]
lemma approx_from_above_dense_linorder:
  fixes x::"'a::{dense_linorder, linorder_topology, first_countable_topology}"
  assumes "x < y"
  shows "\<exists>u. (\<forall>n. u n > x) \<and> (u \<longlonglongrightarrow> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
obtain A :: "nat \<Rightarrow> 'a set" where A: "\<And>i. open (A i)" "\<And>i. x \<in> A i"
                                      "\<And>F. (\<forall>n. F n \<in> A n) \<Longrightarrow> F \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. \<lbrakk>\<And>i. open (A i); \<And>i. x \<in> A i; \<And>F. \<forall>n. F n \<in> A n \<Longrightarrow> F \<longlonglongrightarrow> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis first_countable_topology_class.countable_basis)
[PROOF STATE]
proof (state)
this:
open (A ?i)
x \<in> A ?i
\<forall>n. ?F n \<in> A n \<Longrightarrow> ?F \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
define u where "u = (\<lambda>n. SOME z. z \<in> A n \<and> z > x)"
[PROOF STATE]
proof (state)
this:
u = (\<lambda>n. SOME z. z \<in> A n \<and> x < z)

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
have "\<exists>z. z \<in> U \<and> x < z" if "x \<in> U" "open U" for U
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. z \<in> U \<and> x < z
[PROOF STEP]
using open_right[OF \<open>open U\<close> \<open>x \<in> U\<close> \<open>x < y\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>b>x. {x..<b} \<subseteq> U

goal (1 subgoal):
 1. \<exists>z. z \<in> U \<and> x < z
[PROOF STEP]
by (meson atLeastLessThan_iff dense less_imp_le subset_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>x \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> x < z

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> x < z
[PROOF STEP]
have *: "u n \<in> A n \<and> x < u n" for n
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> x < z

goal (1 subgoal):
 1. u n \<in> A n \<and> x < u n
[PROOF STEP]
using \<open>x \<in> A n\<close> \<open>open (A n)\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> x < z
x \<in> A n
open (A n)

goal (1 subgoal):
 1. u n \<in> A n \<and> x < u n
[PROOF STEP]
unfolding u_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> x < z
x \<in> A n
open (A n)

goal (1 subgoal):
 1. (SOME z. z \<in> A n \<and> x < z) \<in> A n \<and> x < (SOME z. z \<in> A n \<and> x < z)
[PROOF STEP]
by (metis (no_types, lifting) someI_ex)
[PROOF STATE]
proof (state)
this:
u ?n \<in> A ?n \<and> x < u ?n

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u ?n \<in> A ?n \<and> x < u ?n
[PROOF STEP]
have "u \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
using this:
u ?n \<in> A ?n \<and> x < u ?n

goal (1 subgoal):
 1. u \<longlonglongrightarrow> x
[PROOF STEP]
using A(3)
[PROOF STATE]
proof (prove)
using this:
u ?n \<in> A ?n \<and> x < u ?n
\<forall>n. ?F n \<in> A n \<Longrightarrow> ?F \<longlonglongrightarrow> x

goal (1 subgoal):
 1. u \<longlonglongrightarrow> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<longlonglongrightarrow> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> x
u ?n \<in> A ?n \<and> x < u ?n

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mtf2_moves_to_frontm1: "distinct xs \<Longrightarrow> q \<in> set xs \<Longrightarrow> index (mtf2 (length xs -1) q xs) q  = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (mtf2 (length xs - 1) q xs) q = 0
[PROOF STEP]
unfolding mtf2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0
[PROOF STEP]
assume distxs: "distinct xs"
[PROOF STATE]
proof (state)
this:
distinct xs

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0
[PROOF STEP]
assume qinxs: "q \<in> set xs"
[PROOF STATE]
proof (state)
this:
q \<in> set xs

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0
[PROOF STEP]
have " index (if q \<in> set xs then swaps [index xs q - (length xs -1)..<index xs q] xs else xs) q
    = index ( swaps [index xs q - (length xs -1)..<index xs q] xs) q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = index (swaps [index xs q - (length xs - 1)..<index xs q] xs) q
[PROOF STEP]
using qinxs
[PROOF STATE]
proof (prove)
using this:
q \<in> set xs

goal (1 subgoal):
 1. index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = index (swaps [index xs q - (length xs - 1)..<index xs q] xs) q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = index (swaps [index xs q - (length xs - 1)..<index xs q] xs) q

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = index (swaps [index xs q - (length xs - 1)..<index xs q] xs) q

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0
[PROOF STEP]
have "\<dots> = index xs q - (length xs -1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index (swaps [index xs q - (length xs - 1)..<index xs q] xs) q = index xs q - (length xs - 1)
[PROOF STEP]
apply(rule swapsthrough)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. distinct xs
 2. q \<in> set xs
[PROOF STEP]
using distxs qinxs
[PROOF STATE]
proof (prove)
using this:
distinct xs
q \<in> set xs

goal (2 subgoals):
 1. distinct xs
 2. q \<in> set xs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
index (swaps [index xs q - (length xs - 1)..<index xs q] xs) q = index xs q - (length xs - 1)

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
index (swaps [index xs q - (length xs - 1)..<index xs q] xs) q = index xs q - (length xs - 1)

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index xs q - (length xs - 1) = 0
[PROOF STEP]
using index_less_size_conv qinxs
[PROOF STATE]
proof (prove)
using this:
(index ?xs ?x < length ?xs) = (?x \<in> set ?xs)
q \<in> set xs

goal (1 subgoal):
 1. index xs q - (length xs - 1) = 0
[PROOF STEP]
by (metis Suc_pred' gr0I length_pos_if_in_set less_irrefl less_trans_Suc zero_less_diff)
[PROOF STATE]
proof (state)
this:
index xs q - (length xs - 1) = 0

goal (1 subgoal):
 1. \<lbrakk>distinct xs; q \<in> set xs\<rbrakk> \<Longrightarrow> index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0
[PROOF STEP]
show "index (if q \<in> set xs then swaps [index xs q - (length xs -1)..<index xs q] xs else xs) q = 0"
[PROOF STATE]
proof (prove)
using this:
index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0

goal (1 subgoal):
 1. index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
index (if q \<in> set xs then swaps [index xs q - (length xs - 1)..<index xs q] xs else xs) q = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma delete_edge_was_path:
    assumes "is_path_undir (delete_edge a b c G) x p y"
    shows "is_path_undir G x p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_path_undir G x p y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_path_undir (delete_edge a b c G) x p y

goal (1 subgoal):
 1. is_path_undir G x p y
[PROOF STEP]
by (induction p arbitrary: x y) auto


[STATEMENT]
lemma bad_pair_sym:
  assumes "bad_pair v u S c" shows "bad_pair u v S c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bad_pair u v S c
[PROOF STEP]
using assms bad_pair_def codegree_normalized_def
[PROOF STATE]
proof (prove)
using this:
bad_pair v u S c
bad_pair ?v ?u ?S ?c \<equiv> codegree_normalized ?v ?u ?S < ?c
codegree_normalized ?v ?u ?S \<equiv> real (codegree ?v ?u) / real (card ?S)

goal (1 subgoal):
 1. bad_pair u v S c
[PROOF STEP]
by (simp add: codegree_normalized_sym)


[STATEMENT]
lemma i_set_mult_1_eq_i_set: "i_set_mult (Suc 0) = i_set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i_set_mult (Suc 0) = i_set
[PROOF STEP]
apply (rule set_eqI, rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> i_set_mult (Suc 0) \<Longrightarrow> x \<in> i_set
 2. \<And>x. x \<in> i_set \<Longrightarrow> x \<in> i_set_mult (Suc 0)
[PROOF STEP]
apply (rename_tac x, induct_tac x rule: i_set_mult.induct[of _ 1])
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<And>x. x \<in> i_set_mult (Suc 0) \<Longrightarrow> x \<in> i_set_mult 1
 2. \<And>x n. x \<in> i_set_mult (Suc 0) \<Longrightarrow> [n\<dots>] \<in> i_set
 3. \<And>x n. x \<in> i_set_mult (Suc 0) \<Longrightarrow> [\<dots>n] \<in> i_set
 4. \<And>x n d. x \<in> i_set_mult (Suc 0) \<Longrightarrow> [n\<dots>,d] \<in> i_set
 5. \<And>x r m. x \<in> i_set_mult (Suc 0) \<Longrightarrow> [ r, mod m * 1 ] \<in> i_set
 6. \<And>x r m c. x \<in> i_set_mult (Suc 0) \<Longrightarrow> [ r, mod m * 1, c ] \<in> i_set
 7. \<And>x. x \<in> i_set \<Longrightarrow> x \<in> i_set_mult (Suc 0)
[PROOF STEP]
apply (simp_all add: i_set_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> i_set \<Longrightarrow> x \<in> i_set_mult (Suc 0)
[PROOF STEP]
apply (simp add: i_set_i_set_ind_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> i_set_ind \<Longrightarrow> x \<in> i_set_mult (Suc 0)
[PROOF STEP]
apply (rename_tac x, induct_tac x rule: i_set_ind.induct)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>x. x \<in> i_set_ind \<Longrightarrow> x \<in> i_set_ind
 2. \<And>x n. x \<in> i_set_ind \<Longrightarrow> [n\<dots>] \<in> i_set_mult (Suc 0)
 3. \<And>x n. x \<in> i_set_ind \<Longrightarrow> [\<dots>n] \<in> i_set_mult (Suc 0)
 4. \<And>x n d. x \<in> i_set_ind \<Longrightarrow> [n\<dots>,d] \<in> i_set_mult (Suc 0)
 5. \<And>x r m. x \<in> i_set_ind \<Longrightarrow> [ r, mod m ] \<in> i_set_mult (Suc 0)
 6. \<And>x r m c. x \<in> i_set_ind \<Longrightarrow> [ r, mod m, c ] \<in> i_set_mult (Suc 0)
[PROOF STEP]
apply (simp_all add: i_set_mult.intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x r m. x \<in> i_set_ind \<Longrightarrow> [ r, mod m ] \<in> i_set_mult (Suc 0)
 2. \<And>x r m c. x \<in> i_set_ind \<Longrightarrow> [ r, mod m, c ] \<in> i_set_mult (Suc 0)
[PROOF STEP]
apply (rule_tac t=m and s="m * Suc 0" in subst, simp, rule i_set_mult.intros)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma param_rbtreeify[param]:
    "(rbtreeify, rbtreeify) \<in> \<langle>\<langle>Ra,Rb\<rangle>prod_rel\<rangle>list_rel \<rightarrow> \<langle>Ra,Rb\<rangle>rbt_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rbtreeify, rbtreeify) \<in> \<langle>Ra \<times>\<^sub>r Rb\<rangle>list_rel \<rightarrow> \<langle>Ra, Rb\<rangle>rbt_rel
[PROOF STEP]
unfolding rbtreeify_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>kvs. fst (rbtreeify_g (Suc (length kvs)) kvs), \<lambda>kvs. fst (rbtreeify_g (Suc (length kvs)) kvs)) \<in> \<langle>Ra \<times>\<^sub>r Rb\<rangle>list_rel \<rightarrow> \<langle>Ra, Rb\<rangle>rbt_rel
[PROOF STEP]
apply parametricity
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a a'. (a, a') \<in> \<langle>Ra \<times>\<^sub>r Rb\<rangle>list_rel \<Longrightarrow> Suc (length a) \<le> Suc (length a)
[PROOF STEP]
by simp


[STATEMENT]
lemma inj_minus:
  assumes x: "(x :: nat) < q"
    and ya: "ya < q"
    and map: "(y + q - x) mod q = (y + q - ya) mod q"
  shows  "x = ya"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = ya
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = ya
[PROOF STEP]
have "(y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q
[PROOF STEP]
have "(y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> [y + q - x = y + q - ya] (mod q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> [y + q - x = y + q - ya] (mod q)
[PROOF STEP]
using cong_def
[PROOF STATE]
proof (prove)
using this:
[?b = ?c] (mod ?a) = (?b mod ?a = ?c mod ?a)

goal (1 subgoal):
 1. (y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> [y + q - x = y + q - ya] (mod q)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> [y + q - x = y + q - ya] (mod q)

goal (1 subgoal):
 1. (y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> [y + q - x = y + q - ya] (mod q)

goal (1 subgoal):
 1. (y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q
[PROOF STEP]
have "[y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q - x = q - ya] (mod q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q - x = q - ya] (mod q)
[PROOF STEP]
using x ya cong_add_lcancel_nat
[PROOF STATE]
proof (prove)
using this:
x < q
ya < q
[?a + ?x = ?a + ?y] (mod ?n) = [?x = ?y] (mod ?n)

goal (1 subgoal):
 1. [y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q - x = q - ya] (mod q)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
[y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q - x = q - ya] (mod q)

goal (1 subgoal):
 1. (y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q - x = q - ya] (mod q)

goal (1 subgoal):
 1. (y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q
[PROOF STEP]
have "[y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q + x = q + ya] (mod q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q + x = q + ya] (mod q)
[PROOF STEP]
by (metis add_diff_inverse_nat calculation(2) cong_add_lcancel_nat cong_add_rcancel_nat cong_sym less_imp_le_nat not_le x ya)
[PROOF STATE]
proof (state)
this:
[y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q + x = q + ya] (mod q)

goal (1 subgoal):
 1. (y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> [y + q - x = y + q - ya] (mod q)
[y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q - x = q - ya] (mod q)
[y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q + x = q + ya] (mod q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> [y + q - x = y + q - ya] (mod q)
[y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q - x = q - ya] (mod q)
[y + q - x = y + q - ya] (mod q) \<Longrightarrow> [q + x = q + ya] (mod q)

goal (1 subgoal):
 1. x mod q = ya mod q
[PROOF STEP]
by (simp add: cong_def map)
[PROOF STATE]
proof (state)
this:
x mod q = ya mod q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q

goal (1 subgoal):
 1. x = ya
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q

goal (1 subgoal):
 1. x = ya
[PROOF STEP]
have "x mod q = ya mod q \<Longrightarrow> x = ya"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod q = ya mod q \<Longrightarrow> x = ya
[PROOF STEP]
by(simp add: x ya)
[PROOF STATE]
proof (state)
this:
x mod q = ya mod q \<Longrightarrow> x = ya

goal (1 subgoal):
 1. x = ya
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q
x mod q = ya mod q \<Longrightarrow> x = ya
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(y + q - x) mod q = (y + q - ya) mod q \<Longrightarrow> x mod q = ya mod q
x mod q = ya mod q \<Longrightarrow> x = ya

goal (1 subgoal):
 1. x = ya
[PROOF STEP]
by(simp add: map)
[PROOF STATE]
proof (state)
this:
x = ya

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lmeasurable_open: "bounded S \<Longrightarrow> open S \<Longrightarrow> S \<in> lmeasurable"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bounded S; open S\<rbrakk> \<Longrightarrow> S \<in> lmeasurable
[PROOF STEP]
using emeasure_bounded_finite[of S]
[PROOF STATE]
proof (prove)
using this:
bounded S \<Longrightarrow> emeasure lborel S < \<infinity>

goal (1 subgoal):
 1. \<lbrakk>bounded S; open S\<rbrakk> \<Longrightarrow> S \<in> lmeasurable
[PROOF STEP]
by (intro fmeasurableI) (auto simp: borel_open)


[STATEMENT]
lemma next_conj_distrib:
  "(\<circle>(P \<^bold>\<and> Q)) = (\<circle>P \<^bold>\<and> \<circle>Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<circle>(\<lambda>s. P s \<and> Q s) = (\<lambda>s. (\<circle>P) s \<and> (\<circle>Q) s)
[PROOF STEP]
unfolding defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>\<sigma>. P (\<sigma> |\<^sub>s 1) \<and> Q (\<sigma> |\<^sub>s 1)) = (\<lambda>s. P (s |\<^sub>s 1) \<and> Q (s |\<^sub>s 1))
[PROOF STEP]
by auto


[STATEMENT]
lemma inter_inter_aform_plane_ortho:
  assumes "inter_aform_plane_ortho p Z n g = Some X"
  shows "Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> Affine X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> Affine X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> Affine X
[PROOF STEP]
note inter_overappr[of "Affine Z" n g]
[PROOF STATE]
proof (state)
this:
Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> {x. \<forall>i\<in>Basis. x \<bullet> i \<in> {y. (g, y) \<in> (\<lambda>x. (x \<bullet> n, x \<bullet> i)) ` Affine Z}}

goal (1 subgoal):
 1. Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> Affine X
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> {x. \<forall>i\<in>Basis. x \<bullet> i \<in> {y. (g, y) \<in> (\<lambda>x. (x \<bullet> n, x \<bullet> i)) ` Affine Z}}

goal (1 subgoal):
 1. Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> Affine X
[PROOF STEP]
note inter_aform_plane_ortho_overappr[OF assms]
[PROOF STATE]
proof (state)
this:
{x. \<forall>i\<in>Basis. x \<bullet> i \<in> {y. (g, y) \<in> (\<lambda>x. (x \<bullet> n, x \<bullet> i)) ` Affine Z}} \<subseteq> Affine X

goal (1 subgoal):
 1. Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> Affine X
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> Affine X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> Affine X

goal (1 subgoal):
 1. Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> Affine X
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Affine Z \<inter> {x. x \<bullet> n = g} \<subseteq> Affine X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linear_injective_imp_surjective:
  assumes lf: "linear s1 s2 f" and sf: "inj f" and eq: "vs2.dim UNIV = vs1.dim UNIV"
    shows "surj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. surj f
[PROOF STEP]
interpret linear s1 s2 f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (*a) (*b) f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. surj f
[PROOF STEP]
have *: False if b: "b \<notin> vs2.span (f ` B1)" for b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
have *: "vs2.independent (f ` B1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs2.independent (f ` B1)
[PROOF STEP]
using vs1.independent_Basis
[PROOF STATE]
proof (prove)
using this:
vs1.independent B1

goal (1 subgoal):
 1. vs2.independent (f ` B1)
[PROOF STEP]
by (intro independent_injective_image inj_on_subset[OF sf]) auto
[PROOF STATE]
proof (state)
this:
vs2.independent (f ` B1)

goal (1 subgoal):
 1. False
[PROOF STEP]
have **: "vs2.independent (insert b (f ` B1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs2.independent (insert b (f ` B1))
[PROOF STEP]
using b *
[PROOF STATE]
proof (prove)
using this:
b \<notin> vs2.span (f ` B1)
vs2.independent (f ` B1)

goal (1 subgoal):
 1. vs2.independent (insert b (f ` B1))
[PROOF STEP]
by (rule vs2.independent_insertI)
[PROOF STATE]
proof (state)
this:
vs2.independent (insert b (f ` B1))

goal (1 subgoal):
 1. False
[PROOF STEP]
have "b \<notin> f ` B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<notin> f ` B1
[PROOF STEP]
using vs2.span_base[of b "f ` B1"] b
[PROOF STATE]
proof (prove)
using this:
b \<in> f ` B1 \<Longrightarrow> b \<in> vs2.span (f ` B1)
b \<notin> vs2.span (f ` B1)

goal (1 subgoal):
 1. b \<notin> f ` B1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<notin> f ` B1

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<notin> f ` B1
[PROOF STEP]
have "Suc (card B1) = card (insert b (f ` B1))"
[PROOF STATE]
proof (prove)
using this:
b \<notin> f ` B1

goal (1 subgoal):
 1. Suc (card B1) = card (insert b (f ` B1))
[PROOF STEP]
using sf[THEN inj_on_subset, of B1]
[PROOF STATE]
proof (prove)
using this:
b \<notin> f ` B1
B1 \<subseteq> UNIV \<Longrightarrow> inj_on f B1

goal (1 subgoal):
 1. Suc (card B1) = card (insert b (f ` B1))
[PROOF STEP]
by (subst card.insert_remove) (auto intro: vs1.finite_Basis simp: card_image)
[PROOF STATE]
proof (state)
this:
Suc (card B1) = card (insert b (f ` B1))

goal (1 subgoal):
 1. False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc (card B1) = card (insert b (f ` B1))

goal (1 subgoal):
 1. False
[PROOF STEP]
have "\<dots> = vs2.dim (insert b (f ` B1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert b (f ` B1)) = vs2.dim (insert b (f ` B1))
[PROOF STEP]
using vs2.dim_eq_card_independent[OF **]
[PROOF STATE]
proof (prove)
using this:
vs2.dim (insert b (f ` B1)) = card (insert b (f ` B1))

goal (1 subgoal):
 1. card (insert b (f ` B1)) = vs2.dim (insert b (f ` B1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (insert b (f ` B1)) = vs2.dim (insert b (f ` B1))

goal (1 subgoal):
 1. False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (insert b (f ` B1)) = vs2.dim (insert b (f ` B1))

goal (1 subgoal):
 1. False
[PROOF STEP]
have "vs2.dim (insert b (f ` B1)) \<le> vs2.dim B2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs2.dim (insert b (f ` B1)) \<le> vs2.dim B2
[PROOF STEP]
by (rule vs2.dim_mono) (auto simp: vs2.span_Basis)
[PROOF STATE]
proof (state)
this:
vs2.dim (insert b (f ` B1)) \<le> vs2.dim B2

goal (1 subgoal):
 1. False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vs2.dim (insert b (f ` B1)) \<le> vs2.dim B2

goal (1 subgoal):
 1. False
[PROOF STEP]
have "\<dots> = card B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs2.dim B2 = card B1
[PROOF STEP]
using vs1.dim_span[of B1] vs2.dim_span[of B2]
[PROOF STATE]
proof (prove)
using this:
vs1.dim (vs1.span B1) = vs1.dim B1
vs2.dim (vs2.span B2) = vs2.dim B2

goal (1 subgoal):
 1. vs2.dim B2 = card B1
[PROOF STEP]
unfolding vs1.span_Basis vs2.span_Basis eq
        vs1.dim_eq_card_independent[OF vs1.independent_Basis]
[PROOF STATE]
proof (prove)
using this:
vs1.dim UNIV = card B1
vs1.dim UNIV = vs2.dim B2

goal (1 subgoal):
 1. vs2.dim B2 = card B1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vs2.dim B2 = card B1

goal (1 subgoal):
 1. False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Suc (card B1) \<le> card B1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
Suc (card B1) \<le> card B1

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:
?b \<notin> vs2.span (f ` B1) \<Longrightarrow> False

goal (1 subgoal):
 1. surj f
[PROOF STEP]
have "f ` UNIV = f ` vs1.span B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range f = f ` vs1.span B1
[PROOF STEP]
unfolding vs1.span_Basis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range f = range f
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
range f = f ` vs1.span B1

goal (1 subgoal):
 1. surj f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
range f = f ` vs1.span B1

goal (1 subgoal):
 1. surj f
[PROOF STEP]
have "\<dots> = vs2.span (f ` B1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` vs1.span B1 = vs2.span (f ` B1)
[PROOF STEP]
unfolding span_image
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` vs1.span B1 = f ` vs1.span B1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
f ` vs1.span B1 = vs2.span (f ` B1)

goal (1 subgoal):
 1. surj f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f ` vs1.span B1 = vs2.span (f ` B1)

goal (1 subgoal):
 1. surj f
[PROOF STEP]
have "\<dots> = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs2.span (f ` B1) = UNIV
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
?b \<notin> vs2.span (f ` B1) \<Longrightarrow> False

goal (1 subgoal):
 1. vs2.span (f ` B1) = UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vs2.span (f ` B1) = UNIV

goal (1 subgoal):
 1. surj f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
surj f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
surj f

goal (1 subgoal):
 1. surj f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
surj f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isometry_on_subset:
  assumes "isometry_on X f"
          "Y \<subseteq> X"
  shows "isometry_on Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isometry_on Y f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isometry_on X f
Y \<subseteq> X

goal (1 subgoal):
 1. isometry_on Y f
[PROOF STEP]
unfolding isometry_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>X. \<forall>y\<in>X. dist (f x) (f y) = dist x y
Y \<subseteq> X

goal (1 subgoal):
 1. \<forall>x\<in>Y. \<forall>y\<in>Y. dist (f x) (f y) = dist x y
[PROOF STEP]
by auto


[STATEMENT]
theorem Gamma_series_euler':
  assumes z: "(z :: 'a :: Gamma) \<notin> \<int>\<^sub>\<le>\<^sub>0"
  shows "(\<lambda>n. Gamma_series_euler' z n) \<longlonglongrightarrow> Gamma z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma_series_euler' z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
proof (rule Gamma_seriesI, rule Lim_transform_eventually)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?f2 \<longlonglongrightarrow> (1::'a)
 2. \<forall>\<^sub>F x in sequentially. ?f2 x = Gamma_series_euler' z x / Gamma_series z x
[PROOF STEP]
let ?f = "\<lambda>n. fact n * exp (z * of_real (ln (of_nat n + 1))) / pochhammer z (n + 1)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?f2 \<longlonglongrightarrow> (1::'a)
 2. \<forall>\<^sub>F x in sequentially. ?f2 x = Gamma_series_euler' z x / Gamma_series z x
[PROOF STEP]
let ?r = "\<lambda>n. ?f n / Gamma_series z n"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?f2 \<longlonglongrightarrow> (1::'a)
 2. \<forall>\<^sub>F x in sequentially. ?f2 x = Gamma_series_euler' z x / Gamma_series z x
[PROOF STEP]
let ?r' = "\<lambda>n. exp (z * of_real (ln (of_nat (Suc n) / of_nat n)))"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?f2 \<longlonglongrightarrow> (1::'a)
 2. \<forall>\<^sub>F x in sequentially. ?f2 x = Gamma_series_euler' z x / Gamma_series z x
[PROOF STEP]
from z
[PROOF STATE]
proof (chain)
picking this:
z \<notin> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
have z': "z \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
z \<notin> \<int>\<^sub>\<le>\<^sub>0

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

goal (2 subgoals):
 1. ?f2 \<longlonglongrightarrow> (1::'a)
 2. \<forall>\<^sub>F x in sequentially. ?f2 x = Gamma_series_euler' z x / Gamma_series z x
[PROOF STEP]
have "eventually (\<lambda>n. ?r' n = ?r n) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. exp (z * of_real (ln (real (Suc n) / real n))) = fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
z \<notin> \<int>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. exp (z * of_real (ln (real (Suc n) / real n))) = fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n
[PROOF STEP]
by (auto simp: field_split_simps Gamma_series_def ring_distribs exp_diff ln_div
                     intro: eventually_mono eventually_gt_at_top[of "0::nat"] dest: pochhammer_eq_0_imp_nonpos_Int)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. exp (z * of_real (ln (real (Suc n) / real n))) = fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n

goal (2 subgoals):
 1. ?f2 \<longlonglongrightarrow> (1::'a)
 2. \<forall>\<^sub>F x in sequentially. ?f2 x = Gamma_series_euler' z x / Gamma_series z x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. exp (z * of_real (ln (real (Suc n) / real n))) = fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n

goal (2 subgoals):
 1. ?f2 \<longlonglongrightarrow> (1::'a)
 2. \<forall>\<^sub>F x in sequentially. ?f2 x = Gamma_series_euler' z x / Gamma_series z x
[PROOF STEP]
have "?r' \<longlonglongrightarrow> exp (z * of_real (ln 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. exp (z * of_real (ln (real (Suc n) / real n)))) \<longlonglongrightarrow> exp (z * of_real (ln 1))
[PROOF STEP]
by (intro tendsto_intros LIMSEQ_Suc_n_over_n) simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>n. exp (z * of_real (ln (real (Suc n) / real n)))) \<longlonglongrightarrow> exp (z * of_real (ln 1))

goal (2 subgoals):
 1. ?f2 \<longlonglongrightarrow> (1::'a)
 2. \<forall>\<^sub>F x in sequentially. ?f2 x = Gamma_series_euler' z x / Gamma_series z x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. exp (z * of_real (ln (real (Suc n) / real n))) = fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n
(\<lambda>n. exp (z * of_real (ln (real (Suc n) / real n)))) \<longlonglongrightarrow> exp (z * of_real (ln 1))
[PROOF STEP]
show "?r \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. exp (z * of_real (ln (real (Suc n) / real n))) = fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n
(\<lambda>n. exp (z * of_real (ln (real (Suc n) / real n)))) \<longlonglongrightarrow> exp (z * of_real (ln 1))

goal (1 subgoal):
 1. (\<lambda>n. fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n) \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
by (force intro: Lim_transform_eventually)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n) \<longlonglongrightarrow> (1::'a)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. fact x * exp (z * of_real (ln (real x + 1))) / pochhammer z (x + 1) / Gamma_series z x = Gamma_series_euler' z x / Gamma_series z x
[PROOF STEP]
from eventually_gt_at_top[of "0::nat"]
[PROOF STATE]
proof (chain)
picking this:
eventually ((<) 0) sequentially
[PROOF STEP]
show "eventually (\<lambda>n. ?r n = Gamma_series_euler' z n / Gamma_series z n) sequentially"
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n
[PROOF STEP]
assume n: "n > 0"
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n
[PROOF STEP]
from n z'
[PROOF STATE]
proof (chain)
picking this:
0 < n
z \<noteq> (0::'a)
[PROOF STEP]
have "Gamma_series_euler' z n =
      exp (z * of_real (ln (of_nat n + 1))) / (z * (\<Prod>k=1..n. (1 + z / of_nat k)))"
[PROOF STATE]
proof (prove)
using this:
0 < n
z \<noteq> (0::'a)

goal (1 subgoal):
 1. Gamma_series_euler' z n = exp (z * of_real (ln (real n + 1))) / (z * (\<Prod>k = 1..n. (1::'a) + z / of_nat k))
[PROOF STEP]
by (subst Gamma_euler'_aux1)
         (simp_all add: Gamma_series_euler'_def prod.distrib
                        prod_inversef[symmetric] divide_inverse)
[PROOF STATE]
proof (state)
this:
Gamma_series_euler' z n = exp (z * of_real (ln (real n + 1))) / (z * (\<Prod>k = 1..n. (1::'a) + z / of_nat k))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Gamma_series_euler' z n = exp (z * of_real (ln (real n + 1))) / (z * (\<Prod>k = 1..n. (1::'a) + z / of_nat k))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n
[PROOF STEP]
have "(\<Prod>k=1..n. (1 + z / of_nat k)) = pochhammer (z + 1) n / fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>k = 1..n. (1::'a) + z / of_nat k) = pochhammer (z + (1::'a)) n / fact n
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Prod>k = 1..n. (1::'a) + z / of_nat k) = pochhammer (z + (1::'a)) n / fact n
 2. \<And>nat. n = Suc nat \<Longrightarrow> (\<Prod>k = 1..n. (1::'a) + z / of_nat k) = pochhammer (z + (1::'a)) n / fact n
[PROOF STEP]
case (Suc n')
[PROOF STATE]
proof (state)
this:
n = Suc n'

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Prod>k = 1..n. (1::'a) + z / of_nat k) = pochhammer (z + (1::'a)) n / fact n
 2. \<And>nat. n = Suc nat \<Longrightarrow> (\<Prod>k = 1..n. (1::'a) + z / of_nat k) = pochhammer (z + (1::'a)) n / fact n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = Suc n'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc n'

goal (1 subgoal):
 1. (\<Prod>k = 1..n. (1::'a) + z / of_nat k) = pochhammer (z + (1::'a)) n / fact n
[PROOF STEP]
unfolding pochhammer_prod fact_prod
[PROOF STATE]
proof (prove)
using this:
n = Suc n'

goal (1 subgoal):
 1. (\<Prod>k = 1..n. (1::'a) + z / of_nat k) = (\<Prod>i = 0..<n. z + (1::'a) + of_nat i) / of_nat (\<Prod>{1..n})
[PROOF STEP]
by (simp add:  atLeastLessThanSuc_atLeastAtMost field_simps prod_dividef
                  prod.atLeast_Suc_atMost_Suc_shift del: prod.cl_ivl_Suc)
[PROOF STATE]
proof (state)
this:
(\<Prod>k = 1..n. (1::'a) + z / of_nat k) = pochhammer (z + (1::'a)) n / fact n

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> (\<Prod>k = 1..n. (1::'a) + z / of_nat k) = pochhammer (z + (1::'a)) n / fact n
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<Prod>k = 1..n. (1::'a) + z / of_nat k) = pochhammer (z + (1::'a)) n / fact n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>k = 1..n. (1::'a) + z / of_nat k) = pochhammer (z + (1::'a)) n / fact n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n
[PROOF STEP]
have "z * \<dots> = pochhammer z (Suc n) / fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z * (pochhammer (z + (1::'a)) n / fact n) = pochhammer z (Suc n) / fact n
[PROOF STEP]
by (simp add: pochhammer_rec)
[PROOF STATE]
proof (state)
this:
z * (pochhammer (z + (1::'a)) n / fact n) = pochhammer z (Suc n) / fact n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Gamma_series_euler' z n = exp (z * of_real (ln (real n + 1))) / (pochhammer z (Suc n) / fact n)
[PROOF STEP]
show "?r n = Gamma_series_euler' z n / Gamma_series z n"
[PROOF STATE]
proof (prove)
using this:
Gamma_series_euler' z n = exp (z * of_real (ln (real n + 1))) / (pochhammer z (Suc n) / fact n)

goal (1 subgoal):
 1. fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. fact n * exp (z * of_real (ln (real n + 1))) / pochhammer z (n + 1) / Gamma_series z n = Gamma_series_euler' z n / Gamma_series z n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diff_Union_pairwise_disjoint:
  assumes "pairwise disjnt \" "\ \<subseteq> \"
  shows "\<Union>\ - \<Union>\ = \<Union>(\ - \)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> \ - \<Union> \ = \<Union> (\ - \)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> \ - \<Union> \ = \<Union> (\ - \)
[PROOF STEP]
have "False"
    if x: "x \<in> A" "x \<in> B" and AB: "A \<in> \" "A \<notin> \" "B \<in> \" for x A B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
have "A \<inter> B = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> B = {}
[PROOF STEP]
using assms disjointD AB
[PROOF STATE]
proof (prove)
using this:
disjoint \
\ \<subseteq> \
\<lbrakk>disjoint ?A; ?a \<in> ?A; ?b \<in> ?A; ?a \<noteq> ?b\<rbrakk> \<Longrightarrow> ?a \<inter> ?b = {}
A \<in> \
A \<notin> \
B \<in> \

goal (1 subgoal):
 1. A \<inter> B = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<inter> B = {}

goal (1 subgoal):
 1. False
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
x \<in> B
A \<inter> B = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> A
x \<in> B
A \<inter> B = {}

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> ?A; ?x \<in> ?B; ?A \<in> \; ?A \<notin> \; ?B \<in> \\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<Union> \ - \<Union> \ = \<Union> (\ - \)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x \<in> ?A; ?x \<in> ?B; ?A \<in> \; ?A \<notin> \; ?B \<in> \\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> ?A; ?x \<in> ?B; ?A \<in> \; ?A \<notin> \; ?B \<in> \\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<Union> \ - \<Union> \ = \<Union> (\ - \)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> \ - \<Union> \ = \<Union> (\ - \)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_ext: "a \<^bold>\<approx> b \<Longrightarrow>  a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>w. a w = b w \<Longrightarrow> a = b
[PROOF STEP]
using ext
[PROOF STATE]
proof (prove)
using this:
(\<And>x. ?f x = ?g x) \<Longrightarrow> ?f = ?g

goal (1 subgoal):
 1. \<forall>w. a w = b w \<Longrightarrow> a = b
[PROOF STEP]
by blast


[STATEMENT]
lemma least_exists: "P n \<Longrightarrow> \<exists>n. is_least P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P n \<Longrightarrow> \<exists>n. is_least P n
[PROOF STEP]
using exists_least_iff
[PROOF STATE]
proof (prove)
using this:
(\<exists>n. ?P n) = (\<exists>n. ?P n \<and> (\<forall>m<n. \<not> ?P m))

goal (1 subgoal):
 1. P n \<Longrightarrow> \<exists>n. is_least P n
[PROOF STEP]
unfolding is_least_def
[PROOF STATE]
proof (prove)
using this:
(\<exists>n. ?P n) = (\<exists>n. ?P n \<and> (\<forall>m<n. \<not> ?P m))

goal (1 subgoal):
 1. P n \<Longrightarrow> \<exists>n. P n \<and> (\<forall>n'<n. \<not> P n')
[PROOF STEP]
by auto


[STATEMENT]
lemma frestriction_fconst_on_ex:
  assumes "c \<in>\<^sub>\<circ> B"
  shows "(fconst_on A c) \<restriction>\<^sub>\<bullet> B = fconst_on (A \<inter>\<^sub>\<circ> B) c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fconst_on A c \<restriction>\<^sub>\<bullet> B = fconst_on (A \<inter>\<^sub>\<circ> B) c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<in>\<^sub>\<circ> B

goal (1 subgoal):
 1. fconst_on A c \<restriction>\<^sub>\<bullet> B = fconst_on (A \<inter>\<^sub>\<circ> B) c
[PROOF STEP]
by auto


[STATEMENT]
lemma isPREFIX_sublist:
  fixes x y
  assumes "prefix x y"
  shows "subseq x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subseq x y
[PROOF STEP]
using assms prefix_order.dual_order.antisym
[PROOF STATE]
proof (prove)
using this:
prefix x y
\<lbrakk>prefix ?b ?a; prefix ?a ?b\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. subseq x y
[PROOF STEP]
by blast


[STATEMENT]
lemma ev_at_unique: "ev_at P n \<omega> \<Longrightarrow> ev_at P m \<omega> \<Longrightarrow> n = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ev_at P n \<omega>; ev_at P m \<omega>\<rbrakk> \<Longrightarrow> n = m
[PROOF STEP]
proof (induction arbitrary: m rule: ev_at.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<omega> m. \<lbrakk>P \<omega>; ev_at P m \<omega>\<rbrakk> \<Longrightarrow> 0 = m
 2. \<And>\<omega> n m. \<lbrakk>\<not> P \<omega>; ev_at P n (stl \<omega>); \<And>m. ev_at P m (stl \<omega>) \<Longrightarrow> n = m; ev_at P m \<omega>\<rbrakk> \<Longrightarrow> Suc n = m
[PROOF STEP]
case (base \<omega>)
[PROOF STATE]
proof (state)
this:
P \<omega>
ev_at P m \<omega>

goal (2 subgoals):
 1. \<And>\<omega> m. \<lbrakk>P \<omega>; ev_at P m \<omega>\<rbrakk> \<Longrightarrow> 0 = m
 2. \<And>\<omega> n m. \<lbrakk>\<not> P \<omega>; ev_at P n (stl \<omega>); \<And>m. ev_at P m (stl \<omega>) \<Longrightarrow> n = m; ev_at P m \<omega>\<rbrakk> \<Longrightarrow> Suc n = m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P \<omega>
ev_at P m \<omega>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
P \<omega>
ev_at P m \<omega>

goal (1 subgoal):
 1. 0 = m
[PROOF STEP]
by (simp add: ev_at.simps[of _ _ \<omega>])
[PROOF STATE]
proof (state)
this:
0 = m

goal (1 subgoal):
 1. \<And>\<omega> n m. \<lbrakk>\<not> P \<omega>; ev_at P n (stl \<omega>); \<And>m. ev_at P m (stl \<omega>) \<Longrightarrow> n = m; ev_at P m \<omega>\<rbrakk> \<Longrightarrow> Suc n = m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<omega> n m. \<lbrakk>\<not> P \<omega>; ev_at P n (stl \<omega>); \<And>m. ev_at P m (stl \<omega>) \<Longrightarrow> n = m; ev_at P m \<omega>\<rbrakk> \<Longrightarrow> Suc n = m
[PROOF STEP]
case (step \<omega> n)
[PROOF STATE]
proof (state)
this:
\<not> P \<omega>
ev_at P n (stl \<omega>)
ev_at P ?m (stl \<omega>) \<Longrightarrow> n = ?m
ev_at P m \<omega>

goal (1 subgoal):
 1. \<And>\<omega> n m. \<lbrakk>\<not> P \<omega>; ev_at P n (stl \<omega>); \<And>m. ev_at P m (stl \<omega>) \<Longrightarrow> n = m; ev_at P m \<omega>\<rbrakk> \<Longrightarrow> Suc n = m
[PROOF STEP]
from step.prems step.hyps step.IH[of "m - 1"]
[PROOF STATE]
proof (chain)
picking this:
ev_at P m \<omega>
\<not> P \<omega>
ev_at P n (stl \<omega>)
ev_at P (m - 1) (stl \<omega>) \<Longrightarrow> n = m - 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ev_at P m \<omega>
\<not> P \<omega>
ev_at P n (stl \<omega>)
ev_at P (m - 1) (stl \<omega>) \<Longrightarrow> n = m - 1

goal (1 subgoal):
 1. Suc n = m
[PROOF STEP]
by (auto simp add: ev_at.simps[of _ _ \<omega>])
[PROOF STATE]
proof (state)
this:
Suc n = m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in prob_space) emeasure_le_1: "emeasure M S \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M S \<le> 1
[PROOF STEP]
unfolding ennreal_1[symmetric] emeasure_eq_measure
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (prob S) \<le> ennreal 1
[PROOF STEP]
by (subst ennreal_le_iff) auto


[STATEMENT]
lemma in_mtx_nonzeroN[simp]: "(u,v) \<in> mtx_nonzero c \<Longrightarrow> u<N \<and> v<N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u, v) \<in> mtx_nonzero c \<Longrightarrow> u < N \<and> v < N
[PROOF STEP]
using mtx_nonzeroN
[PROOF STATE]
proof (prove)
using this:
mtx_nonzero c \<subseteq> {0..<N} \<times> {0..<N}

goal (1 subgoal):
 1. (u, v) \<in> mtx_nonzero c \<Longrightarrow> u < N \<and> v < N
[PROOF STEP]
by auto


[STATEMENT]
lemma coeff_poly_shift: "coeff (poly_shift n p) i = coeff p (i + n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (poly_shift n p) i = coeff p (i + n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coeff (poly_shift n p) i = coeff p (i + n)
[PROOF STEP]
from MOST_coeff_eq_0[of p]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>\<infinity>n. coeff p n = (0::'a)
[PROOF STEP]
obtain m where "\<forall>k>m. coeff p k = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>\<infinity>n. coeff p n = (0::'a)

goal (1 subgoal):
 1. (\<And>m. \<forall>k>m. coeff p k = (0::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: MOST_nat)
[PROOF STATE]
proof (state)
this:
\<forall>k>m. coeff p k = (0::'a)

goal (1 subgoal):
 1. coeff (poly_shift n p) i = coeff p (i + n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>k>m. coeff p k = (0::'a)
[PROOF STEP]
have "\<forall>k>m. coeff p (k + n) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>k>m. coeff p k = (0::'a)

goal (1 subgoal):
 1. \<forall>k>m. coeff p (k + n) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>k>m. coeff p (k + n) = (0::'a)

goal (1 subgoal):
 1. coeff (poly_shift n p) i = coeff p (i + n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>k>m. coeff p (k + n) = (0::'a)
[PROOF STEP]
have "\<forall>\<^sub>\<infinity>k. coeff p (k + n) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>k>m. coeff p (k + n) = (0::'a)

goal (1 subgoal):
 1. \<forall>\<^sub>\<infinity>k. coeff p (k + n) = (0::'a)
[PROOF STEP]
by (auto simp: MOST_nat)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>\<infinity>k. coeff p (k + n) = (0::'a)

goal (1 subgoal):
 1. coeff (poly_shift n p) i = coeff p (i + n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>\<infinity>k. coeff p (k + n) = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>\<infinity>k. coeff p (k + n) = (0::'a)

goal (1 subgoal):
 1. coeff (poly_shift n p) i = coeff p (i + n)
[PROOF STEP]
by (simp add: poly_shift_def poly.Abs_poly_inverse)
[PROOF STATE]
proof (state)
this:
coeff (poly_shift n p) i = coeff p (i + n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connecting_path_length_bound: "u \<noteq> v \<Longrightarrow> connecting_path u v p \<Longrightarrow> walk_length p \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<noteq> v; connecting_path u v p\<rbrakk> \<Longrightarrow> 1 \<le> walk_length p
[PROOF STEP]
using walk_length_def
[PROOF STATE]
proof (prove)
using this:
walk_length ?p \<equiv> length (walk_edges ?p)

goal (1 subgoal):
 1. \<lbrakk>u \<noteq> v; connecting_path u v p\<rbrakk> \<Longrightarrow> 1 \<le> walk_length p
[PROOF STEP]
by (metis connecting_path_def is_gen_path_def is_walk_not_empty2 last_ConsL le_refl length_0_conv
less_one list.exhaust_sel  nat_less_le nat_neq_iff neq_Nil_conv walk_edges.simps(3))


[STATEMENT]
lemma finite_is_arg_max: "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> \<exists>x. is_arg_max (f :: 'c \<Rightarrow> real) (\<lambda>x. x \<in> X) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>x. is_arg_max f (\<lambda>x. x \<in> X) x
[PROOF STEP]
unfolding is_arg_max_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> X \<and> (\<nexists>y. y \<in> X \<and> f x < f y)
[PROOF STEP]
proof (induction rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {} \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> {} \<and> (\<nexists>y. y \<in> {} \<and> f x < f y)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y); insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y)
insert x F \<noteq> {}

goal (2 subgoals):
 1. {} \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> {} \<and> (\<nexists>y. y \<in> {} \<and> f x < f y)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y); insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y)
insert x F \<noteq> {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y)
insert x F \<noteq> {}

goal (1 subgoal):
 1. \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
[PROOF STEP]
proof (cases "\<forall>y \<in> F. f y \<le> f x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y); insert x F \<noteq> {}; \<forall>y\<in>F. f y \<le> f x\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
 2. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y); insert x F \<noteq> {}; \<not> (\<forall>y\<in>F. f y \<le> f x)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>F. f y \<le> f x

goal (2 subgoals):
 1. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y); insert x F \<noteq> {}; \<forall>y\<in>F. f y \<le> f x\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
 2. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y); insert x F \<noteq> {}; \<not> (\<forall>y\<in>F. f y \<le> f x)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>y\<in>F. f y \<le> f x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>F. f y \<le> f x

goal (1 subgoal):
 1. \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
[PROOF STEP]
by (auto intro!: exI[of _ x])
[PROOF STATE]
proof (state)
this:
\<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)

goal (1 subgoal):
 1. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y); insert x F \<noteq> {}; \<not> (\<forall>y\<in>F. f y \<le> f x)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y); insert x F \<noteq> {}; \<not> (\<forall>y\<in>F. f y \<le> f x)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>y\<in>F. f y \<le> f x)

goal (1 subgoal):
 1. \<lbrakk>finite F; x \<notin> F; F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y); insert x F \<noteq> {}; \<not> (\<forall>y\<in>F. f y \<le> f x)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>y\<in>F. f y \<le> f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>y\<in>F. f y \<le> f x)

goal (1 subgoal):
 1. \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>y\<in>F. f y \<le> f x)
finite F
x \<notin> F
F \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> F \<and> (\<nexists>y. y \<in> F \<and> f x < f y)
insert x F \<noteq> {}

goal (1 subgoal):
 1. \<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>xa. xa \<in> insert x F \<and> (\<nexists>y. y \<in> insert x F \<and> f xa < f y)

goal (1 subgoal):
 1. {} \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> {} \<and> (\<nexists>y. y \<in> {} \<and> f x < f y)
[PROOF STEP]
qed simp


[STATEMENT]
lemma unit_disc_fix_moebius_uminus [simp]:
  assumes "unit_disc_fix M"
  shows "unit_disc_fix (-M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix (- M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M

goal (1 subgoal):
 1. unit_disc_fix (- M)
[PROOF STEP]
unfolding unit_disc_fix_iff_ounit_circle
[PROOF STATE]
proof (prove)
using this:
moebius_ocircline M ounit_circle = ounit_circle

goal (1 subgoal):
 1. moebius_ocircline (- M) ounit_circle = ounit_circle
[PROOF STEP]
by (metis moebius_ocircline_comp_inv_left uminus_moebius_def)


[STATEMENT]
lemma neg_numeral_less_ceiling [simp]: "- numeral v < \<lceil>x\<rceil> \<longleftrightarrow> - numeral v < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- numeral v < \<lceil>x\<rceil>) = (- numeral v < x)
[PROOF STEP]
by (simp add: less_ceiling_iff)


[STATEMENT]
lemma proj_at_index_list_length[simp]:
  assumes "S \<subseteq> indices_of as"
  shows "length (project_at_indices S as) = card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (nths as S) = card S
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length (nths as S) = card S
[PROOF STEP]
have "S = {i. i < length as \<and> i \<in> S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = {i. i < length as \<and> i \<in> S}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> indices_of as

goal (1 subgoal):
 1. S = {i. i < length as \<and> i \<in> S}
[PROOF STEP]
unfolding indices_of_def
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> {..<length as}

goal (1 subgoal):
 1. S = {i. i < length as \<and> i \<in> S}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S = {i. i < length as \<and> i \<in> S}

goal (1 subgoal):
 1. length (nths as S) = card S
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
S = {i. i < length as \<and> i \<in> S}

goal (1 subgoal):
 1. length (nths as S) = card S
[PROOF STEP]
using length_nths[of as S]
[PROOF STATE]
proof (prove)
using this:
S = {i. i < length as \<and> i \<in> S}
length (nths as S) = card {i. i < length as \<and> i \<in> S}

goal (1 subgoal):
 1. length (nths as S) = card S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (nths as S) = card S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_Ln [tendsto_intros]:
  fixes L F
  assumes "(f \<longlongrightarrow> L) F" "L \<notin> \<real>\<^sub>\<le>\<^sub>0"
  shows   "((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F
[PROOF STEP]
have "nhds L \<ge> filtermap f F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap f F \<le> nhds L
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> L) F

goal (1 subgoal):
 1. filtermap f F \<le> nhds L
[PROOF STEP]
by (simp add: filterlim_def)
[PROOF STATE]
proof (state)
this:
filtermap f F \<le> nhds L

goal (1 subgoal):
 1. ((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
filtermap f F \<le> nhds L

goal (1 subgoal):
 1. ((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F
[PROOF STEP]
have "\<forall>\<^sub>F y in nhds L. y \<in> - \<real>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F y in nhds L. y \<in> - \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
using eventually_nhds_in_open[of "- \<real>\<^sub>\<le>\<^sub>0" L] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>open (- \<real>\<^sub>\<le>\<^sub>0); L \<in> - \<real>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F y in nhds L. y \<in> - \<real>\<^sub>\<le>\<^sub>0
(f \<longlongrightarrow> L) F
L \<notin> \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. \<forall>\<^sub>F y in nhds L. y \<in> - \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (auto simp: open_Compl)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in nhds L. y \<in> - \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. ((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
filtermap f F \<le> nhds L
\<forall>\<^sub>F y in nhds L. y \<in> - \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
have "\<forall>\<^sub>F y in filtermap f F. y \<in> - \<real>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
using this:
filtermap f F \<le> nhds L
\<forall>\<^sub>F y in nhds L. y \<in> - \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. \<forall>\<^sub>F y in filtermap f F. y \<in> - \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (rule filter_leD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in filtermap f F. y \<in> - \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. ((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in filtermap f F. y \<in> - \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. ((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F
[PROOF STEP]
have "continuous_on (-\<real>\<^sub>\<le>\<^sub>0) Ln"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (- \<real>\<^sub>\<le>\<^sub>0) Ln
[PROOF STEP]
by (rule continuous_on_Ln) auto
[PROOF STATE]
proof (state)
this:
continuous_on (- \<real>\<^sub>\<le>\<^sub>0) Ln

goal (1 subgoal):
 1. ((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F y in filtermap f F. y \<in> - \<real>\<^sub>\<le>\<^sub>0
continuous_on (- \<real>\<^sub>\<le>\<^sub>0) Ln
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in filtermap f F. y \<in> - \<real>\<^sub>\<le>\<^sub>0
continuous_on (- \<real>\<^sub>\<le>\<^sub>0) Ln

goal (1 subgoal):
 1. ((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F
[PROOF STEP]
using continuous_on_tendsto_compose[of "- \<real>\<^sub>\<le>\<^sub>0" Ln f L F] assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in filtermap f F. y \<in> - \<real>\<^sub>\<le>\<^sub>0
continuous_on (- \<real>\<^sub>\<le>\<^sub>0) Ln
\<lbrakk>continuous_on (- \<real>\<^sub>\<le>\<^sub>0) Ln; (f \<longlongrightarrow> L) F; L \<in> - \<real>\<^sub>\<le>\<^sub>0; \<forall>\<^sub>F x in F. f x \<in> - \<real>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> ((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F
(f \<longlongrightarrow> L) F
L \<notin> \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. ((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F
[PROOF STEP]
by (simp add: eventually_filtermap)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. Ln (f x)) \<longlongrightarrow> Ln L) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linear_injective_imp_surjective:
  assumes lf: "linear s1 s2 f" and sf: "inj f" and eq: "vs2.dim UNIV = vs1.dim UNIV"
    shows "surj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. surj f
[PROOF STEP]
interpret linear s1 s2 f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (*a) (*b) f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. surj f
[PROOF STEP]
have *: False if b: "b \<notin> vs2.span (f ` B1)" for b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
have *: "vs2.independent (f ` B1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs2.independent (f ` B1)
[PROOF STEP]
using vs1.independent_Basis
[PROOF STATE]
proof (prove)
using this:
vs1.independent B1

goal (1 subgoal):
 1. vs2.independent (f ` B1)
[PROOF STEP]
by (intro independent_injective_image inj_on_subset[OF sf]) auto
[PROOF STATE]
proof (state)
this:
vs2.independent (f ` B1)

goal (1 subgoal):
 1. False
[PROOF STEP]
have **: "vs2.independent (insert b (f ` B1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs2.independent (insert b (f ` B1))
[PROOF STEP]
using b *
[PROOF STATE]
proof (prove)
using this:
b \<notin> vs2.span (f ` B1)
vs2.independent (f ` B1)

goal (1 subgoal):
 1. vs2.independent (insert b (f ` B1))
[PROOF STEP]
by (rule vs2.independent_insertI)
[PROOF STATE]
proof (state)
this:
vs2.independent (insert b (f ` B1))

goal (1 subgoal):
 1. False
[PROOF STEP]
have "b \<notin> f ` B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<notin> f ` B1
[PROOF STEP]
using vs2.span_base[of b "f ` B1"] b
[PROOF STATE]
proof (prove)
using this:
b \<in> f ` B1 \<Longrightarrow> b \<in> vs2.span (f ` B1)
b \<notin> vs2.span (f ` B1)

goal (1 subgoal):
 1. b \<notin> f ` B1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<notin> f ` B1

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<notin> f ` B1
[PROOF STEP]
have "Suc (card B1) = card (insert b (f ` B1))"
[PROOF STATE]
proof (prove)
using this:
b \<notin> f ` B1

goal (1 subgoal):
 1. Suc (card B1) = card (insert b (f ` B1))
[PROOF STEP]
using sf[THEN inj_on_subset, of B1]
[PROOF STATE]
proof (prove)
using this:
b \<notin> f ` B1
B1 \<subseteq> UNIV \<Longrightarrow> inj_on f B1

goal (1 subgoal):
 1. Suc (card B1) = card (insert b (f ` B1))
[PROOF STEP]
by (subst card.insert_remove) (auto intro: vs1.finite_Basis simp: card_image)
[PROOF STATE]
proof (state)
this:
Suc (card B1) = card (insert b (f ` B1))

goal (1 subgoal):
 1. False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc (card B1) = card (insert b (f ` B1))

goal (1 subgoal):
 1. False
[PROOF STEP]
have "\<dots> = vs2.dim (insert b (f ` B1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert b (f ` B1)) = vs2.dim (insert b (f ` B1))
[PROOF STEP]
using vs2.dim_eq_card_independent[OF **]
[PROOF STATE]
proof (prove)
using this:
vs2.dim (insert b (f ` B1)) = card (insert b (f ` B1))

goal (1 subgoal):
 1. card (insert b (f ` B1)) = vs2.dim (insert b (f ` B1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (insert b (f ` B1)) = vs2.dim (insert b (f ` B1))

goal (1 subgoal):
 1. False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (insert b (f ` B1)) = vs2.dim (insert b (f ` B1))

goal (1 subgoal):
 1. False
[PROOF STEP]
have "vs2.dim (insert b (f ` B1)) \<le> vs2.dim B2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs2.dim (insert b (f ` B1)) \<le> vs2.dim B2
[PROOF STEP]
by (rule vs2.dim_mono) (auto simp: vs2.span_Basis)
[PROOF STATE]
proof (state)
this:
vs2.dim (insert b (f ` B1)) \<le> vs2.dim B2

goal (1 subgoal):
 1. False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vs2.dim (insert b (f ` B1)) \<le> vs2.dim B2

goal (1 subgoal):
 1. False
[PROOF STEP]
have "\<dots> = card B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs2.dim B2 = card B1
[PROOF STEP]
using vs1.dim_span[of B1] vs2.dim_span[of B2]
[PROOF STATE]
proof (prove)
using this:
vs1.dim (vs1.span B1) = vs1.dim B1
vs2.dim (vs2.span B2) = vs2.dim B2

goal (1 subgoal):
 1. vs2.dim B2 = card B1
[PROOF STEP]
unfolding vs1.span_Basis vs2.span_Basis eq
        vs1.dim_eq_card_independent[OF vs1.independent_Basis]
[PROOF STATE]
proof (prove)
using this:
vs1.dim UNIV = card B1
vs1.dim UNIV = vs2.dim B2

goal (1 subgoal):
 1. vs2.dim B2 = card B1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vs2.dim B2 = card B1

goal (1 subgoal):
 1. False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Suc (card B1) \<le> card B1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
Suc (card B1) \<le> card B1

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:
?b \<notin> vs2.span (f ` B1) \<Longrightarrow> False

goal (1 subgoal):
 1. surj f
[PROOF STEP]
have "f ` UNIV = f ` vs1.span B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range f = f ` vs1.span B1
[PROOF STEP]
unfolding vs1.span_Basis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range f = range f
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
range f = f ` vs1.span B1

goal (1 subgoal):
 1. surj f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
range f = f ` vs1.span B1

goal (1 subgoal):
 1. surj f
[PROOF STEP]
have "\<dots> = vs2.span (f ` B1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` vs1.span B1 = vs2.span (f ` B1)
[PROOF STEP]
unfolding span_image
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` vs1.span B1 = f ` vs1.span B1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
f ` vs1.span B1 = vs2.span (f ` B1)

goal (1 subgoal):
 1. surj f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f ` vs1.span B1 = vs2.span (f ` B1)

goal (1 subgoal):
 1. surj f
[PROOF STEP]
have "\<dots> = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs2.span (f ` B1) = UNIV
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
?b \<notin> vs2.span (f ` B1) \<Longrightarrow> False

goal (1 subgoal):
 1. vs2.span (f ` B1) = UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vs2.span (f ` B1) = UNIV

goal (1 subgoal):
 1. surj f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
surj f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
surj f

goal (1 subgoal):
 1. surj f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
surj f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_less_of_nat_mult:
  fixes x :: "'a::archimedean_field"
  assumes "0 < x"
  shows "\<exists>n. y < of_nat n * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. y < of_nat n * x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n. y < of_nat n * x
[PROOF STEP]
obtain n where "y / x < of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. y / x < of_nat n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using reals_Archimedean2
[PROOF STATE]
proof (prove)
using this:
\<exists>n. ?x < of_nat n

goal (1 subgoal):
 1. (\<And>n. y / x < of_nat n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y / x < of_nat n

goal (1 subgoal):
 1. \<exists>n. y < of_nat n * x
[PROOF STEP]
with \<open>0 < x\<close>
[PROOF STATE]
proof (chain)
picking this:
(0::'a) < x
y / x < of_nat n
[PROOF STEP]
have "y < of_nat n * x"
[PROOF STATE]
proof (prove)
using this:
(0::'a) < x
y / x < of_nat n

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

goal (1 subgoal):
 1. \<exists>n. y < of_nat n * x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y < of_nat n * x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y < of_nat n * x

goal (1 subgoal):
 1. \<exists>n. y < of_nat n * x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>n. y < of_nat n * x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma STAR_cos_Infinitesimal_approx2:
  fixes x :: hypreal
  assumes "x \<in> Infinitesimal"
  shows "( *f* cos) x \<approx> 1 - (x\<^sup>2)/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*f* cos) x \<approx> 1 - x\<^sup>2 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (*f* cos) x \<approx> 1 - x\<^sup>2 / 2
[PROOF STEP]
have "1 \<approx> 1 - x\<^sup>2 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<approx> 1 - x\<^sup>2 / 2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> Infinitesimal

goal (1 subgoal):
 1. 1 \<approx> 1 - x\<^sup>2 / 2
[PROOF STEP]
by (auto intro: Infinitesimal_SReal_divide simp add: Infinitesimal_approx_minus [symmetric] numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
1 \<approx> 1 - x\<^sup>2 / 2

goal (1 subgoal):
 1. (*f* cos) x \<approx> 1 - x\<^sup>2 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<approx> 1 - x\<^sup>2 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 \<approx> 1 - x\<^sup>2 / 2

goal (1 subgoal):
 1. (*f* cos) x \<approx> 1 - x\<^sup>2 / 2
[PROOF STEP]
using STAR_cos_Infinitesimal approx_trans assms
[PROOF STATE]
proof (prove)
using this:
1 \<approx> 1 - x\<^sup>2 / 2
?x \<in> Infinitesimal \<Longrightarrow> (*f* cos) ?x \<approx> 1
\<lbrakk>?x \<approx> ?y; ?y \<approx> ?z\<rbrakk> \<Longrightarrow> ?x \<approx> ?z
x \<in> Infinitesimal

goal (1 subgoal):
 1. (*f* cos) x \<approx> 1 - x\<^sup>2 / 2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(*f* cos) x \<approx> 1 - x\<^sup>2 / 2

goal:
No subgoals!
[PROOF STEP]
qed