[STATEMENT]
lemma composable_tm0_fix_jumps:
  assumes "length tm \<ge> 2" and "is_even (length tm)"
  shows "composable_tm0 (fix_jumps (length tm div 2) tm)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. composable_tm0 (fix_jumps (length tm div 2) tm)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. composable_tm0 (fix_jumps (length tm div 2) tm)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
2 \<le> length tm
is_even (length tm)
[PROOF STEP]
have "length (fix_jumps (length tm div 2) tm) \<ge> 2 \<and>
                   is_even (length (fix_jumps (length tm div 2) tm)) \<and>
                   (\<forall>x \<in> set (fix_jumps (length tm div 2) tm).
                      (snd x) \<le> length (fix_jumps (length tm div 2) tm) div 2 + 0 \<and> (snd x) \<ge> 0)"
[PROOF STATE]
proof (prove)
using this:
2 \<le> length tm
is_even (length tm)

goal (1 subgoal):
 1. 2 \<le> length (fix_jumps (length tm div 2) tm) \<and> is_even (length (fix_jumps (length tm div 2) tm)) \<and> (\<forall>x\<in>set (fix_jumps (length tm div 2) tm). snd x \<le> length (fix_jumps (length tm div 2) tm) div 2 + 0 \<and> 0 \<le> snd x)
[PROOF STEP]
by (rule composable_tm0_fix_jumps_pre)
[PROOF STATE]
proof (state)
this:
2 \<le> length (fix_jumps (length tm div 2) tm) \<and> is_even (length (fix_jumps (length tm div 2) tm)) \<and> (\<forall>x\<in>set (fix_jumps (length tm div 2) tm). snd x \<le> length (fix_jumps (length tm div 2) tm) div 2 + 0 \<and> 0 \<le> snd x)

goal (1 subgoal):
 1. composable_tm0 (fix_jumps (length tm div 2) tm)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 \<le> length (fix_jumps (length tm div 2) tm) \<and> is_even (length (fix_jumps (length tm div 2) tm)) \<and> (\<forall>x\<in>set (fix_jumps (length tm div 2) tm). snd x \<le> length (fix_jumps (length tm div 2) tm) div 2 + 0 \<and> 0 \<le> snd x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 \<le> length (fix_jumps (length tm div 2) tm) \<and> is_even (length (fix_jumps (length tm div 2) tm)) \<and> (\<forall>x\<in>set (fix_jumps (length tm div 2) tm). snd x \<le> length (fix_jumps (length tm div 2) tm) div 2 + 0 \<and> 0 \<le> snd x)

goal (1 subgoal):
 1. composable_tm0 (fix_jumps (length tm div 2) tm)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
composable_tm0 (fix_jumps (length tm div 2) tm)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_simps [simp]:
    assumes "arr f0" and "arr f1"
    shows "arr (f0 \<otimes> f1)"
    and "dom (f0 \<otimes> f1) = dom f0 \<otimes> dom f1"
    and "cod (f0 \<otimes> f1) = cod f0 \<otimes> cod f1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr (f0 \<otimes> f1) &&& local.dom (f0 \<otimes> f1) = local.dom f0 \<otimes> local.dom f1 &&& cod (f0 \<otimes> f1) = cod f0 \<otimes> cod f1
[PROOF STEP]
using assms prod_in_hom
[PROOF STATE]
proof (prove)
using this:
arr f0
arr f1
\<lbrakk>\<guillemotleft>?f : ?a \<rightarrow> ?c\<guillemotright>; \<guillemotleft>?g : ?b \<rightarrow> ?d\<guillemotright>\<rbrakk> \<Longrightarrow> \<guillemotleft>?f \<otimes> ?g : ?a \<otimes> ?b \<rightarrow> ?c \<otimes> ?d\<guillemotright>

goal (1 subgoal):
 1. arr (f0 \<otimes> f1) &&& local.dom (f0 \<otimes> f1) = local.dom f0 \<otimes> local.dom f1 &&& cod (f0 \<otimes> f1) = cod f0 \<otimes> cod f1
[PROOF STEP]
by blast+


[STATEMENT]
theorem norm_Hahn_Banach:
  fixes V and norm ("\<parallel>_\<parallel>")
  fixes B defines "\<And>V f. B V f \<equiv> {0} \<union> {\<bar>f x\<bar> / \<parallel>x\<parallel> | x. x \<noteq> 0 \<and> x \<in> V}"
  fixes fn_norm ("\<parallel>_\<parallel>\<hyphen>_" [0, 1000] 999)
  defines "\<And>V f. \<parallel>f\<parallel>\<hyphen>V \<equiv> \<Squnion>(B V f)"
  assumes E_norm: "normed_vectorspace E norm" and FE: "subspace F E"
    and linearform: "linearform F f" and "continuous F f norm"
  shows "\<exists>g. linearform E g
     \<and> continuous E g norm
     \<and> (\<forall>x \<in> F. g x = f x)
     \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
interpret normed_vectorspace E norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normed_vectorspace E norm
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
interpret normed_vectorspace_with_fn_norm E norm B fn_norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normed_vectorspace_with_fn_norm E norm &&& (\<And>V f. B V f \<equiv> {0} \<union> {\<bar>f x\<bar> / \<parallel>x\<parallel> |x. x \<noteq> (0::'a) \<and> x \<in> V}) &&& (\<And>f V. \<parallel>f\<parallel>\<hyphen>V \<equiv> \<Squnion>B V f)
[PROOF STEP]
by (auto simp: B_def fn_norm_def) intro_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
interpret subspace F E
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Subspace.subspace F E
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
interpret linearform F f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linearform F f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
interpret continuous F f norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Function_Norm.continuous F f norm
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
have E: "vectorspace E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace E
[PROOF STEP]
by intro_locales
[PROOF STATE]
proof (state)
this:
vectorspace E

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
have F: "vectorspace F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace F
[PROOF STEP]
by rule intro_locales
[PROOF STATE]
proof (state)
this:
vectorspace F

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
have F_norm: "normed_vectorspace F norm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normed_vectorspace F norm
[PROOF STEP]
using FE E_norm
[PROOF STATE]
proof (prove)
using this:
Subspace.subspace F E
normed_vectorspace E norm

goal (1 subgoal):
 1. normed_vectorspace F norm
[PROOF STEP]
by (rule subspace_normed_vs)
[PROOF STATE]
proof (state)
this:
normed_vectorspace F norm

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
have ge_zero: "0 \<le> \<parallel>f\<parallel>\<hyphen>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
by (rule normed_vectorspace_with_fn_norm.fn_norm_ge_zero
      [OF normed_vectorspace_with_fn_norm.intro,
       OF F_norm \<open>continuous F f norm\<close> , folded B_def fn_norm_def])
[PROOF STATE]
proof (state)
this:
0 \<le> \<parallel>f\<parallel>\<hyphen>F

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
txt \<open>We define a function \<open>p\<close> on \<open>E\<close> as follows:
    \<open>p x = \<parallel>f\<parallel> \<cdot> \<parallel>x\<parallel>\<close>\<close>
[PROOF STATE]
proof (state)
this:
0 \<le> \<parallel>f\<parallel>\<hyphen>F

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
define p where "p x = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>" for x
[PROOF STATE]
proof (state)
this:
p ?x = \<parallel>f\<parallel>\<hyphen>F * \<parallel>?x\<parallel>

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
txt \<open>\<open>p\<close> is a seminorm on \<open>E\<close>:\<close>
[PROOF STATE]
proof (state)
this:
p ?x = \<parallel>f\<parallel>\<hyphen>F * \<parallel>?x\<parallel>

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
have q: "seminorm E p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seminorm E p
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> E \<Longrightarrow> 0 \<le> p x
 2. \<And>x a. x \<in> E \<Longrightarrow> p (a \<cdot> x) = \<bar>a\<bar> * p x
 3. \<And>x y. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> p (x + y) \<le> p x + p y
[PROOF STEP]
fix x y a
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> E \<Longrightarrow> 0 \<le> p x
 2. \<And>x a. x \<in> E \<Longrightarrow> p (a \<cdot> x) = \<bar>a\<bar> * p x
 3. \<And>x y. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> p (x + y) \<le> p x + p y
[PROOF STEP]
assume x: "x \<in> E" and y: "y \<in> E"
[PROOF STATE]
proof (state)
this:
x \<in> E
y \<in> E

goal (3 subgoals):
 1. \<And>x. x \<in> E \<Longrightarrow> 0 \<le> p x
 2. \<And>x a. x \<in> E \<Longrightarrow> p (a \<cdot> x) = \<bar>a\<bar> * p x
 3. \<And>x y. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> p (x + y) \<le> p x + p y
[PROOF STEP]
txt \<open>\<open>p\<close> is positive definite:\<close>
[PROOF STATE]
proof (state)
this:
x \<in> E
y \<in> E

goal (3 subgoals):
 1. \<And>x. x \<in> E \<Longrightarrow> 0 \<le> p x
 2. \<And>x a. x \<in> E \<Longrightarrow> p (a \<cdot> x) = \<bar>a\<bar> * p x
 3. \<And>x y. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> p (x + y) \<le> p x + p y
[PROOF STEP]
have "0 \<le> \<parallel>f\<parallel>\<hyphen>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
by (rule ge_zero)
[PROOF STATE]
proof (state)
this:
0 \<le> \<parallel>f\<parallel>\<hyphen>F

goal (3 subgoals):
 1. \<And>x. x \<in> E \<Longrightarrow> 0 \<le> p x
 2. \<And>x a. x \<in> E \<Longrightarrow> p (a \<cdot> x) = \<bar>a\<bar> * p x
 3. \<And>x y. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> p (x + y) \<le> p x + p y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 \<le> \<parallel>f\<parallel>\<hyphen>F

goal (3 subgoals):
 1. \<And>x. x \<in> E \<Longrightarrow> 0 \<le> p x
 2. \<And>x a. x \<in> E \<Longrightarrow> p (a \<cdot> x) = \<bar>a\<bar> * p x
 3. \<And>x y. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> p (x + y) \<le> p x + p y
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> E
[PROOF STEP]
have "0 \<le> \<parallel>x\<parallel>"
[PROOF STATE]
proof (prove)
using this:
x \<in> E

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

goal (3 subgoals):
 1. \<And>x. x \<in> E \<Longrightarrow> 0 \<le> p x
 2. \<And>x a. x \<in> E \<Longrightarrow> p (a \<cdot> x) = \<bar>a\<bar> * p x
 3. \<And>x y. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> p (x + y) \<le> p x + p y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 \<le> \<parallel>f\<parallel>\<hyphen>F
0 \<le> \<parallel>x\<parallel>
[PROOF STEP]
show "0 \<le> p x"
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<parallel>f\<parallel>\<hyphen>F
0 \<le> \<parallel>x\<parallel>

goal (1 subgoal):
 1. 0 \<le> p x
[PROOF STEP]
by (simp add: p_def zero_le_mult_iff)
[PROOF STATE]
proof (state)
this:
0 \<le> p x

goal (2 subgoals):
 1. \<And>x a. x \<in> E \<Longrightarrow> p (a \<cdot> x) = \<bar>a\<bar> * p x
 2. \<And>x y. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> p (x + y) \<le> p x + p y
[PROOF STEP]
txt \<open>\<open>p\<close> is absolutely homogeneous:\<close>
[PROOF STATE]
proof (state)
this:
0 \<le> p x

goal (2 subgoals):
 1. \<And>x a. x \<in> E \<Longrightarrow> p (a \<cdot> x) = \<bar>a\<bar> * p x
 2. \<And>x y. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> p (x + y) \<le> p x + p y
[PROOF STEP]
show "p (a \<cdot> x) = \<bar>a\<bar> * p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p (a \<cdot> x) = \<bar>a\<bar> * p x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p (a \<cdot> x) = \<bar>a\<bar> * p x
[PROOF STEP]
have "p (a \<cdot> x) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>a \<cdot> x\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p (a \<cdot> x) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>a \<cdot> x\<parallel>
[PROOF STEP]
by (simp only: p_def)
[PROOF STATE]
proof (state)
this:
p (a \<cdot> x) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>a \<cdot> x\<parallel>

goal (1 subgoal):
 1. p (a \<cdot> x) = \<bar>a\<bar> * p x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p (a \<cdot> x) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>a \<cdot> x\<parallel>

goal (1 subgoal):
 1. p (a \<cdot> x) = \<bar>a\<bar> * p x
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> E
[PROOF STEP]
have "\<parallel>a \<cdot> x\<parallel> = \<bar>a\<bar> * \<parallel>x\<parallel>"
[PROOF STATE]
proof (prove)
using this:
x \<in> E

goal (1 subgoal):
 1. \<parallel>a \<cdot> x\<parallel> = \<bar>a\<bar> * \<parallel>x\<parallel>
[PROOF STEP]
by (rule abs_homogenous)
[PROOF STATE]
proof (state)
this:
\<parallel>a \<cdot> x\<parallel> = \<bar>a\<bar> * \<parallel>x\<parallel>

goal (1 subgoal):
 1. p (a \<cdot> x) = \<bar>a\<bar> * p x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>a \<cdot> x\<parallel> = \<bar>a\<bar> * \<parallel>x\<parallel>

goal (1 subgoal):
 1. p (a \<cdot> x) = \<bar>a\<bar> * p x
[PROOF STEP]
have "\<parallel>f\<parallel>\<hyphen>F * (\<bar>a\<bar> * \<parallel>x\<parallel>) = \<bar>a\<bar> * (\<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>f\<parallel>\<hyphen>F * (\<bar>a\<bar> * \<parallel>x\<parallel>) = \<bar>a\<bar> * (\<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel>\<hyphen>F * (\<bar>a\<bar> * \<parallel>x\<parallel>) = \<bar>a\<bar> * (\<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>)

goal (1 subgoal):
 1. p (a \<cdot> x) = \<bar>a\<bar> * p x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel>\<hyphen>F * (\<bar>a\<bar> * \<parallel>x\<parallel>) = \<bar>a\<bar> * (\<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>)

goal (1 subgoal):
 1. p (a \<cdot> x) = \<bar>a\<bar> * p x
[PROOF STEP]
have "\<dots> = \<bar>a\<bar> * p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>a\<bar> * (\<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>) = \<bar>a\<bar> * p x
[PROOF STEP]
by (simp only: p_def)
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> * (\<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>) = \<bar>a\<bar> * p x

goal (1 subgoal):
 1. p (a \<cdot> x) = \<bar>a\<bar> * p x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
p (a \<cdot> x) = \<bar>a\<bar> * p x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p (a \<cdot> x) = \<bar>a\<bar> * p x

goal (1 subgoal):
 1. p (a \<cdot> x) = \<bar>a\<bar> * p x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
p (a \<cdot> x) = \<bar>a\<bar> * p x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p (a \<cdot> x) = \<bar>a\<bar> * p x

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> p (x + y) \<le> p x + p y
[PROOF STEP]
txt \<open>Furthermore, \<open>p\<close> is subadditive:\<close>
[PROOF STATE]
proof (state)
this:
p (a \<cdot> x) = \<bar>a\<bar> * p x

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> E; y \<in> E\<rbrakk> \<Longrightarrow> p (x + y) \<le> p x + p y
[PROOF STEP]
show "p (x + y) \<le> p x + p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
have "p (x + y) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x + y\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p (x + y) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x + y\<parallel>
[PROOF STEP]
by (simp only: p_def)
[PROOF STATE]
proof (state)
this:
p (x + y) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x + y\<parallel>

goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p (x + y) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x + y\<parallel>

goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
have a: "0 \<le> \<parallel>f\<parallel>\<hyphen>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
by (rule ge_zero)
[PROOF STATE]
proof (state)
this:
0 \<le> \<parallel>f\<parallel>\<hyphen>F

goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
from x y
[PROOF STATE]
proof (chain)
picking this:
x \<in> E
y \<in> E
[PROOF STEP]
have "\<parallel>x + y\<parallel> \<le> \<parallel>x\<parallel> + \<parallel>y\<parallel>"
[PROOF STATE]
proof (prove)
using this:
x \<in> E
y \<in> E

goal (1 subgoal):
 1. \<parallel>x + y\<parallel> \<le> \<parallel>x\<parallel> + \<parallel>y\<parallel>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<parallel>x + y\<parallel> \<le> \<parallel>x\<parallel> + \<parallel>y\<parallel>

goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
0 \<le> \<parallel>f\<parallel>\<hyphen>F
\<parallel>x + y\<parallel> \<le> \<parallel>x\<parallel> + \<parallel>y\<parallel>
[PROOF STEP]
have " \<parallel>f\<parallel>\<hyphen>F * \<parallel>x + y\<parallel> \<le> \<parallel>f\<parallel>\<hyphen>F * (\<parallel>x\<parallel> + \<parallel>y\<parallel>)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<parallel>f\<parallel>\<hyphen>F
\<parallel>x + y\<parallel> \<le> \<parallel>x\<parallel> + \<parallel>y\<parallel>

goal (1 subgoal):
 1. \<parallel>f\<parallel>\<hyphen>F * \<parallel>x + y\<parallel> \<le> \<parallel>f\<parallel>\<hyphen>F * (\<parallel>x\<parallel> + \<parallel>y\<parallel>)
[PROOF STEP]
by (simp add: mult_left_mono)
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel>\<hyphen>F * \<parallel>x + y\<parallel> \<le> \<parallel>f\<parallel>\<hyphen>F * (\<parallel>x\<parallel> + \<parallel>y\<parallel>)

goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel>\<hyphen>F * \<parallel>x + y\<parallel> \<le> \<parallel>f\<parallel>\<hyphen>F * (\<parallel>x\<parallel> + \<parallel>y\<parallel>)

goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
have "\<dots> = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel> + \<parallel>f\<parallel>\<hyphen>F * \<parallel>y\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>f\<parallel>\<hyphen>F * (\<parallel>x\<parallel> + \<parallel>y\<parallel>) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel> + \<parallel>f\<parallel>\<hyphen>F * \<parallel>y\<parallel>
[PROOF STEP]
by (simp only: distrib_left)
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel>\<hyphen>F * (\<parallel>x\<parallel> + \<parallel>y\<parallel>) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel> + \<parallel>f\<parallel>\<hyphen>F * \<parallel>y\<parallel>

goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel>\<hyphen>F * (\<parallel>x\<parallel> + \<parallel>y\<parallel>) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel> + \<parallel>f\<parallel>\<hyphen>F * \<parallel>y\<parallel>

goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
have "\<dots> = p x + p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel> + \<parallel>f\<parallel>\<hyphen>F * \<parallel>y\<parallel> = p x + p y
[PROOF STEP]
by (simp only: p_def)
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel> + \<parallel>f\<parallel>\<hyphen>F * \<parallel>y\<parallel> = p x + p y

goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
p (x + y) \<le> p x + p y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p (x + y) \<le> p x + p y

goal (1 subgoal):
 1. p (x + y) \<le> p x + p y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
p (x + y) \<le> p x + p y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p (x + y) \<le> p x + p y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
seminorm E p

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
txt \<open>\<open>f\<close> is bounded by \<open>p\<close>.\<close>
[PROOF STATE]
proof (state)
this:
seminorm E p

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
have "\<forall>x \<in> F. \<bar>f x\<bar> \<le> p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>F. \<bar>f x\<bar> \<le> p x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> F \<Longrightarrow> \<bar>f x\<bar> \<le> p x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> F \<Longrightarrow> \<bar>f x\<bar> \<le> p x
[PROOF STEP]
assume "x \<in> F"
[PROOF STATE]
proof (state)
this:
x \<in> F

goal (1 subgoal):
 1. \<And>x. x \<in> F \<Longrightarrow> \<bar>f x\<bar> \<le> p x
[PROOF STEP]
with \<open>continuous F f norm\<close> and linearform
[PROOF STATE]
proof (chain)
picking this:
Function_Norm.continuous F f norm
linearform F f
x \<in> F
[PROOF STEP]
show "\<bar>f x\<bar> \<le> p x"
[PROOF STATE]
proof (prove)
using this:
Function_Norm.continuous F f norm
linearform F f
x \<in> F

goal (1 subgoal):
 1. \<bar>f x\<bar> \<le> p x
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
using this:
Function_Norm.continuous F f norm
linearform F f
x \<in> F

goal (1 subgoal):
 1. \<bar>f x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>
[PROOF STEP]
by (rule normed_vectorspace_with_fn_norm.fn_norm_le_cong
        [OF normed_vectorspace_with_fn_norm.intro,
         OF F_norm, folded B_def fn_norm_def])
[PROOF STATE]
proof (state)
this:
\<bar>f x\<bar> \<le> p x

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

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
txt \<open>Using the fact that \<open>p\<close> is a seminorm and \<open>f\<close> is bounded by \<open>p\<close> we can
    apply the Hahn-Banach Theorem for real vector spaces. So \<open>f\<close> can be
    extended in a norm-preserving way to some function \<open>g\<close> on the whole vector
    space \<open>E\<close>.\<close>
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>F. \<bar>f x\<bar> \<le> p x

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
with E FE linearform q
[PROOF STATE]
proof (chain)
picking this:
vectorspace E
Subspace.subspace F E
linearform F f
seminorm E p
\<forall>x\<in>F. \<bar>f x\<bar> \<le> p x
[PROOF STEP]
obtain g where
      linearformE: "linearform E g"
    and a: "\<forall>x \<in> F. g x = f x"
    and b: "\<forall>x \<in> E. \<bar>g x\<bar> \<le> p x"
[PROOF STATE]
proof (prove)
using this:
vectorspace E
Subspace.subspace F E
linearform F f
seminorm E p
\<forall>x\<in>F. \<bar>f x\<bar> \<le> p x

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>linearform E g; \<forall>x\<in>F. g x = f x; \<forall>x\<in>E. \<bar>g x\<bar> \<le> p x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule abs_Hahn_Banach [elim_format]) iprover
[PROOF STATE]
proof (state)
this:
linearform E g
\<forall>x\<in>F. g x = f x
\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
txt \<open>We furthermore have to show that \<open>g\<close> is also continuous:\<close>
[PROOF STATE]
proof (state)
this:
linearform E g
\<forall>x\<in>F. g x = f x
\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
have g_cont: "continuous E g norm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Function_Norm.continuous E g norm
[PROOF STEP]
using linearformE
[PROOF STATE]
proof (prove)
using this:
linearform E g

goal (1 subgoal):
 1. Function_Norm.continuous E g norm
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> E \<Longrightarrow> \<bar>g x\<bar> \<le> ?c * \<parallel>x\<parallel>
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> E \<Longrightarrow> \<bar>g x\<bar> \<le> ?c * \<parallel>x\<parallel>
[PROOF STEP]
assume "x \<in> E"
[PROOF STATE]
proof (state)
this:
x \<in> E

goal (1 subgoal):
 1. \<And>x. x \<in> E \<Longrightarrow> \<bar>g x\<bar> \<le> ?c * \<parallel>x\<parallel>
[PROOF STEP]
with b
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x
x \<in> E
[PROOF STEP]
show "\<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x
x \<in> E

goal (1 subgoal):
 1. \<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>
[PROOF STEP]
by (simp only: p_def)
[PROOF STATE]
proof (state)
this:
\<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Function_Norm.continuous E g norm

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
txt \<open>To complete the proof, we show that \<open>\<parallel>g\<parallel> = \<parallel>f\<parallel>\<close>.\<close>
[PROOF STATE]
proof (state)
this:
Function_Norm.continuous E g norm

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
have "\<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
proof (rule order_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<parallel>g\<parallel>\<hyphen>E \<le> \<parallel>f\<parallel>\<hyphen>F
 2. \<parallel>f\<parallel>\<hyphen>F \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
txt \<open>
      First we show \<open>\<parallel>g\<parallel> \<le> \<parallel>f\<parallel>\<close>. The function norm \<open>\<parallel>g\<parallel>\<close> is defined as the
      smallest \<open>c \<in> \<real>\<close> such that
      \begin{center}
      \begin{tabular}{l}
      \<open>\<forall>x \<in> E. \<bar>g x\<bar> \<le> c \<cdot> \<parallel>x\<parallel>\<close>
      \end{tabular}
      \end{center}
      \<^noindent> Furthermore holds
      \begin{center}
      \begin{tabular}{l}
      \<open>\<forall>x \<in> E. \<bar>g x\<bar> \<le> \<parallel>f\<parallel> \<cdot> \<parallel>x\<parallel>\<close>
      \end{tabular}
      \end{center}
    \<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<parallel>g\<parallel>\<hyphen>E \<le> \<parallel>f\<parallel>\<hyphen>F
 2. \<parallel>f\<parallel>\<hyphen>F \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
from g_cont _ ge_zero
[PROOF STATE]
proof (chain)
picking this:
Function_Norm.continuous E g norm
PROP ?psi \<Longrightarrow> PROP ?psi
0 \<le> \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
show "\<parallel>g\<parallel>\<hyphen>E \<le> \<parallel>f\<parallel>\<hyphen>F"
[PROOF STATE]
proof (prove)
using this:
Function_Norm.continuous E g norm
PROP ?psi \<Longrightarrow> PROP ?psi
0 \<le> \<parallel>f\<parallel>\<hyphen>F

goal (1 subgoal):
 1. \<parallel>g\<parallel>\<hyphen>E \<le> \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> E \<Longrightarrow> \<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> E \<Longrightarrow> \<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>
[PROOF STEP]
assume "x \<in> E"
[PROOF STATE]
proof (state)
this:
x \<in> E

goal (1 subgoal):
 1. \<And>x. x \<in> E \<Longrightarrow> \<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>
[PROOF STEP]
with b
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x
x \<in> E
[PROOF STEP]
show "\<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>E. \<bar>g x\<bar> \<le> p x
x \<in> E

goal (1 subgoal):
 1. \<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>
[PROOF STEP]
by (simp only: p_def)
[PROOF STATE]
proof (state)
this:
\<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<parallel>g\<parallel>\<hyphen>E \<le> \<parallel>f\<parallel>\<hyphen>F

goal (1 subgoal):
 1. \<parallel>f\<parallel>\<hyphen>F \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
txt \<open>The other direction is achieved by a similar argument.\<close>
[PROOF STATE]
proof (state)
this:
\<parallel>g\<parallel>\<hyphen>E \<le> \<parallel>f\<parallel>\<hyphen>F

goal (1 subgoal):
 1. \<parallel>f\<parallel>\<hyphen>F \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
show "\<parallel>f\<parallel>\<hyphen>F \<le> \<parallel>g\<parallel>\<hyphen>E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>f\<parallel>\<hyphen>F \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
proof (rule normed_vectorspace_with_fn_norm.fn_norm_least
        [OF normed_vectorspace_with_fn_norm.intro,
         OF F_norm, folded B_def fn_norm_def])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. Function_Norm.continuous F f norm
 2. \<And>x. x \<in> F \<Longrightarrow> \<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
 3. 0 \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. Function_Norm.continuous F f norm
 2. \<And>x. x \<in> F \<Longrightarrow> \<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
 3. 0 \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
assume x: "x \<in> F"
[PROOF STATE]
proof (state)
this:
x \<in> F

goal (3 subgoals):
 1. Function_Norm.continuous F f norm
 2. \<And>x. x \<in> F \<Longrightarrow> \<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
 3. 0 \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
show "\<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
[PROOF STEP]
from a x
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>F. g x = f x
x \<in> F
[PROOF STEP]
have "g x = f x"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>F. g x = f x
x \<in> F

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

goal (1 subgoal):
 1. \<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g x = f x
[PROOF STEP]
have "\<bar>f x\<bar> = \<bar>g x\<bar>"
[PROOF STATE]
proof (prove)
using this:
g x = f x

goal (1 subgoal):
 1. \<bar>f x\<bar> = \<bar>g x\<bar>
[PROOF STEP]
by (simp only:)
[PROOF STATE]
proof (state)
this:
\<bar>f x\<bar> = \<bar>g x\<bar>

goal (1 subgoal):
 1. \<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>f x\<bar> = \<bar>g x\<bar>

goal (1 subgoal):
 1. \<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
[PROOF STEP]
from g_cont
[PROOF STATE]
proof (chain)
picking this:
Function_Norm.continuous E g norm
[PROOF STEP]
have "\<dots> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>"
[PROOF STATE]
proof (prove)
using this:
Function_Norm.continuous E g norm

goal (1 subgoal):
 1. \<bar>g x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
[PROOF STEP]
proof (rule fn_norm_le_cong [OF _ linearformE, folded B_def fn_norm_def])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> E
[PROOF STEP]
from FE x
[PROOF STATE]
proof (chain)
picking this:
Subspace.subspace F E
x \<in> F
[PROOF STEP]
show "x \<in> E"
[PROOF STATE]
proof (prove)
using this:
Subspace.subspace F E
x \<in> F

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<bar>g x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>

goal (1 subgoal):
 1. \<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>

goal (1 subgoal):
 1. \<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>

goal (2 subgoals):
 1. Function_Norm.continuous F f norm
 2. 0 \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Function_Norm.continuous F f norm
 2. 0 \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
show "0 \<le> \<parallel>g\<parallel>\<hyphen>E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
using g_cont
[PROOF STATE]
proof (prove)
using this:
Function_Norm.continuous E g norm

goal (1 subgoal):
 1. 0 \<le> \<parallel>g\<parallel>\<hyphen>E
[PROOF STEP]
by (rule fn_norm_ge_zero [of g, folded B_def fn_norm_def])
[PROOF STATE]
proof (state)
this:
0 \<le> \<parallel>g\<parallel>\<hyphen>E

goal (1 subgoal):
 1. Function_Norm.continuous F f norm
[PROOF STEP]
show "continuous F f norm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Function_Norm.continuous F f norm
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
Function_Norm.continuous F f norm

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel>\<hyphen>F \<le> \<parallel>g\<parallel>\<hyphen>E

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
with linearformE a g_cont
[PROOF STATE]
proof (chain)
picking this:
linearform E g
\<forall>x\<in>F. g x = f x
Function_Norm.continuous E g norm
\<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
linearform E g
\<forall>x\<in>F. g x = f x
Function_Norm.continuous E g norm
\<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F

goal (1 subgoal):
 1. \<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>g. linearform E g \<and> Function_Norm.continuous E g norm \<and> (\<forall>x\<in>F. g x = f x) \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma qtable_project_fv: "qtable (Suc n) (fv \<phi>) (mem_restr (lift_envs R)) P X \<Longrightarrow>
    qtable n (MFOTL.fvi (Suc 0) \<phi>) (mem_restr R)
      (\<lambda>v. \<exists>x. P ((if 0 \<in> fv \<phi> then Some x else None) # v)) (tl ` X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qtable (Suc n) (fv \<phi>) (mem_restr (lift_envs R)) P X \<Longrightarrow> qtable n (MFOTL.fvi (Suc 0) \<phi>) (mem_restr R) (\<lambda>v. \<exists>x. P ((if 0 \<in> fv \<phi> then Some x else None) # v)) (tl ` X)
[PROOF STEP]
using neq0_conv
[PROOF STATE]
proof (prove)
using this:
(?n \<noteq> 0) = (0 < ?n)

goal (1 subgoal):
 1. qtable (Suc n) (fv \<phi>) (mem_restr (lift_envs R)) P X \<Longrightarrow> qtable n (MFOTL.fvi (Suc 0) \<phi>) (mem_restr R) (\<lambda>v. \<exists>x. P ((if 0 \<in> fv \<phi> then Some x else None) # v)) (tl ` X)
[PROOF STEP]
by (fastforce simp: image_iff Bex_def fvi_Suc elim!: qtable_cong dest!: qtable_project)


[STATEMENT]
lemma length_add1:"\<Turnstile>((\<^bold>\<l>=x) \<^bold>\<frown> (\<^bold>\<l>= y)) \<^bold>\<rightarrow> (\<^bold>\<l>= x+y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>ts v. (\<exists>va u. v=va\<parallel>u \<and> \<parallel>ext va\<parallel> = x \<and> \<parallel>ext u\<parallel> = y) \<longrightarrow> \<parallel>ext v\<parallel> = x + y
[PROOF STEP]
using hchop_def real_int.rchop_def real_int.length_def
[PROOF STATE]
proof (prove)
using this:
?v=?u\<parallel>?w \<equiv> R_Chop(ext ?v,ext ?u,ext ?w) \<and> lan ?v = lan ?u \<and> lan ?v = lan ?w \<and> own ?v = own ?u \<and> own ?v = own ?w \<and> more ?v = more ?w \<and> more ?v = more ?u
R_Chop(?r,?s,?t) \<equiv> left ?r = left ?s \<and> right ?s = left ?t \<and> right ?r = right ?t
\<parallel>?r\<parallel> \<equiv> right ?r - left ?r

goal (1 subgoal):
 1. \<forall>ts v. (\<exists>va u. v=va\<parallel>u \<and> \<parallel>ext va\<parallel> = x \<and> \<parallel>ext u\<parallel> = y) \<longrightarrow> \<parallel>ext v\<parallel> = x + y
[PROOF STEP]
by fastforce


[STATEMENT]
lemma eSwapBinp_simp2[simp]:
assumes "\<not> liftAll (\<lambda> eA. eA \<noteq> ERR) ebinp"
shows "\<not> liftAll (\<lambda> eA. eA \<noteq> ERR) (eSwapBinp MOD zs z1 z2 ebinp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> liftAll (\<lambda>eA. eA \<noteq> ERR) (eSwapBinp MOD zs z1 z2 ebinp)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> liftAll (\<lambda>eA. eA \<noteq> ERR) ebinp

goal (1 subgoal):
 1. \<not> liftAll (\<lambda>eA. eA \<noteq> ERR) (eSwapBinp MOD zs z1 z2 ebinp)
[PROOF STEP]
unfolding liftAll_def igSwapBinp_def lift_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>i v. ebinp i = Some v \<longrightarrow> v \<noteq> ERR)

goal (1 subgoal):
 1. \<not> (\<forall>i v. (case ebinp i of None \<Rightarrow> None | Some v \<Rightarrow> Some (eSwapAbs MOD zs z1 z2 v)) = Some v \<longrightarrow> v \<noteq> ERR)
[PROOF STEP]
by (auto split: option.splits)


[STATEMENT]
lemma emeasure_count_space_infinite[simp]:
  "X \<subseteq> A \<Longrightarrow> infinite X \<Longrightarrow> emeasure (count_space A) X = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> A; infinite X\<rbrakk> \<Longrightarrow> emeasure (count_space A) X = \<infinity>
[PROOF STEP]
using emeasure_count_space[of X A]
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> A \<Longrightarrow> emeasure (count_space A) X = (if finite X then of_nat (card X) else \<infinity>)

goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> A; infinite X\<rbrakk> \<Longrightarrow> emeasure (count_space A) X = \<infinity>
[PROOF STEP]
by simp


[STATEMENT]
lemma shift_back[simp]:
assumes "II \<subseteq> {brnL cl n ..<+ brn (cl!n)}"
shows "shift cl n (back cl n II) = II"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.shift cl n (back cl n II) = II
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
II \<subseteq> {brnL cl n..<brnL cl n + brn (cl ! n)}

goal (1 subgoal):
 1. local.shift cl n (back cl n II) = II
[PROOF STEP]
unfolding shift_def back_def atLeastLessThan_def
[PROOF STATE]
proof (prove)
using this:
II \<subseteq> {brnL cl n..} \<inter> {..<brnL cl n + brn (cl ! n)}

goal (1 subgoal):
 1. (+) (brnL cl n) ` (\<lambda>ii. ii - brnL cl n) ` II = II
[PROOF STEP]
by force


[STATEMENT]
lemma subseq_interlaced_index_even:
  assumes "incseq r"
  and "incseq s"
  and "(\<lambda>n. of_rat (r n)) \<longlonglongrightarrow> (x::real)"
  and "(\<lambda>n. of_rat (s n)) \<longlonglongrightarrow> (x::real)"
  and "\<forall>n. of_rat (r n) < x"
  and "\<forall>n. of_rat (s n) < x"
  shows "strict_mono (\<lambda>n. interlaced_index r s (2 * n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono (\<lambda>n. interlaced_index r s (2 * n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. strict_mono (\<lambda>n. interlaced_index r s (2 * n))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. strict_mono (\<lambda>n. interlaced_index r s (2 * n))
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. strict_mono (\<lambda>n. interlaced_index r s (2 * n))
[PROOF STEP]
have "interlaced_index r s (2 * n)
         < (LEAST m. r (LEAST m. s (interlaced_index r s (2 * n)) < r m) < s m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interlaced_index r s (2 * n) < (LEAST m. r (LEAST m. s (interlaced_index r s (2 * n)) < r m) < s m)
[PROOF STEP]
proof (rule LeastI2_ex [of "\<lambda> m. s (interlaced_index r s (2 * n)) < r m"])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>a. s (interlaced_index r s (2 * n)) < r a
 2. \<And>x. s (interlaced_index r s (2 * n)) < r x \<Longrightarrow> interlaced_index r s (2 * n) < (LEAST m. r x < s m)
[PROOF STEP]
show "\<exists>a. s (interlaced_index r s (2 * n)) < r a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. s (interlaced_index r s (2 * n)) < r a
[PROOF STEP]
using assms(3) assms(6) lemma_seq_point_gt_ex2
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x
\<forall>n. real_of_rat (s n) < x
\<lbrakk>(\<lambda>n. real_of_rat (?r n)) \<longlonglongrightarrow> ?x; real_of_rat ?y < ?x\<rbrakk> \<Longrightarrow> \<exists>m. ?y < ?r m

goal (1 subgoal):
 1. \<exists>a. s (interlaced_index r s (2 * n)) < r a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>a. s (interlaced_index r s (2 * n)) < r a

goal (1 subgoal):
 1. \<And>x. s (interlaced_index r s (2 * n)) < r x \<Longrightarrow> interlaced_index r s (2 * n) < (LEAST m. r x < s m)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. s (interlaced_index r s (2 * n)) < r x \<Longrightarrow> interlaced_index r s (2 * n) < (LEAST m. r x < s m)
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. s (interlaced_index r s (2 * n)) < r x \<Longrightarrow> interlaced_index r s (2 * n) < (LEAST m. r x < s m)
[PROOF STEP]
assume inter_s: "s (interlaced_index r s (2 * n)) < r m"
[PROOF STATE]
proof (state)
this:
s (interlaced_index r s (2 * n)) < r m

goal (1 subgoal):
 1. \<And>x. s (interlaced_index r s (2 * n)) < r x \<Longrightarrow> interlaced_index r s (2 * n) < (LEAST m. r x < s m)
[PROOF STEP]
show "interlaced_index r s (2 * n) < (LEAST ma. r m < s ma) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interlaced_index r s (2 * n) < (LEAST ma. r m < s ma)
[PROOF STEP]
proof (rule LeastI2_ex)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>a. r m < s a
 2. \<And>x. r m < s x \<Longrightarrow> interlaced_index r s (2 * n) < x
[PROOF STEP]
show "\<exists>a. r m < s a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. r m < s a
[PROOF STEP]
using assms(4) assms(5) lemma_seq_point_gt_ex2
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_rat (s n)) \<longlonglongrightarrow> x
\<forall>n. real_of_rat (r n) < x
\<lbrakk>(\<lambda>n. real_of_rat (?r n)) \<longlonglongrightarrow> ?x; real_of_rat ?y < ?x\<rbrakk> \<Longrightarrow> \<exists>m. ?y < ?r m

goal (1 subgoal):
 1. \<exists>a. r m < s a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>a. r m < s a

goal (1 subgoal):
 1. \<And>x. r m < s x \<Longrightarrow> interlaced_index r s (2 * n) < x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. r m < s x \<Longrightarrow> interlaced_index r s (2 * n) < x
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. r m < s x \<Longrightarrow> interlaced_index r s (2 * n) < x
[PROOF STEP]
assume "r m < s k"
[PROOF STATE]
proof (state)
this:
r m < s k

goal (1 subgoal):
 1. \<And>x. r m < s x \<Longrightarrow> interlaced_index r s (2 * n) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r m < s k
[PROOF STEP]
show "interlaced_index r s (2 * n) < k"
[PROOF STATE]
proof (prove)
using this:
r m < s k

goal (1 subgoal):
 1. interlaced_index r s (2 * n) < k
[PROOF STEP]
using inter_s assms(2) incseqD2 less_trans
[PROOF STATE]
proof (prove)
using this:
r m < s k
s (interlaced_index r s (2 * n)) < r m
incseq s
\<lbrakk>incseq ?r; ?r ?m < ?r ?n\<rbrakk> \<Longrightarrow> ?m < ?n
\<lbrakk>?x < ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. interlaced_index r s (2 * n) < k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
interlaced_index r s (2 * n) < k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
interlaced_index r s (2 * n) < (LEAST ma. r m < s ma)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
interlaced_index r s (2 * n) < (LEAST m. r (LEAST m. s (interlaced_index r s (2 * n)) < r m) < s m)

goal (1 subgoal):
 1. strict_mono (\<lambda>n. interlaced_index r s (2 * n))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
interlaced_index r s (2 * ?n2) < (LEAST m. r (LEAST m. s (interlaced_index r s (2 * ?n2)) < r m) < s m)

goal (1 subgoal):
 1. strict_mono (\<lambda>n. interlaced_index r s (2 * n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
interlaced_index r s (2 * ?n2) < (LEAST m. r (LEAST m. s (interlaced_index r s (2 * ?n2)) < r m) < s m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
interlaced_index r s (2 * ?n2) < (LEAST m. r (LEAST m. s (interlaced_index r s (2 * ?n2)) < r m) < s m)

goal (1 subgoal):
 1. strict_mono (\<lambda>n. interlaced_index r s (2 * n))
[PROOF STEP]
by (simp add: strict_mono_Suc_iff)
[PROOF STATE]
proof (state)
this:
strict_mono (\<lambda>n. interlaced_index r s (2 * n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_set_ConsE: "xs \<in> set_Cons A As \<Longrightarrow> (\<And>y ys. xs = y # ys \<Longrightarrow> y \<in> A \<Longrightarrow> ys \<in> As \<Longrightarrow> P) \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<in> set_Cons A As; \<And>y ys. \<lbrakk>xs = y # ys; y \<in> A; ys \<in> As\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
unfolding set_Cons_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<in> {x # xs |x xs. x \<in> A \<and> xs \<in> As}; \<And>y ys. \<lbrakk>xs = y # ys; y \<in> A; ys \<in> As\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by blast


[STATEMENT]
lemma cut_greater_Max_empty: "finite I \<Longrightarrow> Max I \<le> t \<Longrightarrow> I \<down>> t = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; Max I \<le> t\<rbrakk> \<Longrightarrow> I \<down>> t = {}
[PROOF STEP]
by (fastforce simp: i_cut_defs)


[STATEMENT]
lemma emeasure_stat_not_C:
  assumes "y \<notin> C"
  shows "emeasure (stat C) {y} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (stat C) {y} = 0
[PROOF STEP]
unfolding stat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (point_measure UNIV (\<lambda>x. indicator C x / U' x x)) {y} = 0
[PROOF STEP]
using \<open>y \<notin> C\<close>
[PROOF STATE]
proof (prove)
using this:
y \<notin> C

goal (1 subgoal):
 1. emeasure (point_measure UNIV (\<lambda>x. indicator C x / U' x x)) {y} = 0
[PROOF STEP]
by (subst emeasure_point_measure_finite2) auto


[STATEMENT]
lemma bigo_const2 [intro]: "O(\<lambda>x. c) \<subseteq> O(\<lambda>x. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. O(\<lambda>x. c) \<subseteq> O(\<lambda>x. 1::'b)
[PROOF STEP]
apply (rule bigo_elt_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c) \<in> O(\<lambda>x. 1::'b)
[PROOF STEP]
apply (rule bigo_const1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma extending_leadsTo:
     "extending (%G. UNIV) h F
                (extend_set h A leadsTo extend_set h B) (A leadsTo B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extending (\<lambda>G. UNIV) h F (extend_set h A \<longmapsto> extend_set h B) (A \<longmapsto> B)
[PROOF STEP]
apply (unfold extending_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>G. extend h F ok G \<longrightarrow> F \<squnion> project h UNIV G \<in> A \<longmapsto> B \<longrightarrow> extend h F \<squnion> G \<in> extend_set h A \<longmapsto> extend_set h B
[PROOF STEP]
apply (blast intro: project_leadsTo_D)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prod_2_Rel_ArrVal_vid_on[cat_cs_simps]:
  "prod_2_Rel_ArrVal (vid_on A) (vid_on B) = vid_on (A \<times>\<^sub>\<circ> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_2_Rel_ArrVal (vid_on A) (vid_on B) = vid_on (A \<times>\<^sub>\<circ> B)
[PROOF STEP]
unfolding prod_2_Rel_ArrVal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFC_in_HOL.set {\<langle>\<langle>a, b\<rangle>, c, d\<rangle> |a b c d. \<langle>a, c\<rangle> \<in>\<^sub>\<circ> vid_on A \<and> \<langle>b, d\<rangle> \<in>\<^sub>\<circ> vid_on B} = vid_on (A \<times>\<^sub>\<circ> B)
[PROOF STEP]
by auto


[STATEMENT]
lemma unstream_drop_trans [stream_fusion]: "unstream (drop_trans g) (n, s) = drop n (unstream g s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unstream (drop_trans g) (n, s) = drop n (unstream g s)
[PROOF STEP]
proof (induction s arbitrary: n taking: g rule: unstream.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s n. \<lbrakk>\<And>x2 n. generator g s = Skip x2 \<Longrightarrow> unstream (drop_trans g) (n, x2) = drop n (unstream g x2); \<And>x31 x32 n. generator g s = Yield x31 x32 \<Longrightarrow> unstream (drop_trans g) (n, x32) = drop n (unstream g x32)\<rbrakk> \<Longrightarrow> unstream (drop_trans g) (n, s) = drop n (unstream g s)
[PROOF STEP]
case (1 s)
[PROOF STATE]
proof (state)
this:
generator g s = Skip ?x2.0 \<Longrightarrow> unstream (drop_trans g) (?n, ?x2.0) = drop ?n (unstream g ?x2.0)
generator g s = Yield ?x31.0 ?x32.0 \<Longrightarrow> unstream (drop_trans g) (?n, ?x32.0) = drop ?n (unstream g ?x32.0)

goal (1 subgoal):
 1. \<And>s n. \<lbrakk>\<And>x2 n. generator g s = Skip x2 \<Longrightarrow> unstream (drop_trans g) (n, x2) = drop n (unstream g x2); \<And>x31 x32 n. generator g s = Yield x31 x32 \<Longrightarrow> unstream (drop_trans g) (n, x32) = drop n (unstream g x32)\<rbrakk> \<Longrightarrow> unstream (drop_trans g) (n, s) = drop n (unstream g s)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unstream (drop_trans g) (n, s) = drop n (unstream g s)
[PROOF STEP]
using "1.IH"(1)[of _ n] "1.IH"(2)[of _ _ n] "1.IH"(2)[of _ _ "n - 1"]
[PROOF STATE]
proof (prove)
using this:
generator g s = Skip ?x2.0 \<Longrightarrow> unstream (drop_trans g) (n, ?x2.0) = drop n (unstream g ?x2.0)
generator g s = Yield ?x31.0 ?x32.0 \<Longrightarrow> unstream (drop_trans g) (n, ?x32.0) = drop n (unstream g ?x32.0)
generator g s = Yield ?x31.0 ?x32.0 \<Longrightarrow> unstream (drop_trans g) (n - 1, ?x32.0) = drop (n - 1) (unstream g ?x32.0)

goal (1 subgoal):
 1. unstream (drop_trans g) (n, s) = drop n (unstream g s)
[PROOF STEP]
by(cases "generator g s" "n" rule: step.exhaust[case_product nat.exhaust])
      (simp_all add: drop_trans.rep_eq)
[PROOF STATE]
proof (state)
this:
unstream (drop_trans g) (n, s) = drop n (unstream g s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in finite_boolean_algebra) join_irreducibles_card_log_2:
  "card \<J> = log 2 (card (UNIV :: 'a set))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
proof (cases "card (UNIV :: 'a set) = 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card UNIV = 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
 2. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
card UNIV = 1

goal (2 subgoals):
 1. card UNIV = 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
 2. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
hence "\<exists> x :: 'a. UNIV = {x}"
[PROOF STATE]
proof (prove)
using this:
card UNIV = 1

goal (1 subgoal):
 1. \<exists>x. UNIV = {x}
[PROOF STEP]
using card_1_singletonE
[PROOF STATE]
proof (prove)
using this:
card UNIV = 1
\<lbrakk>card ?A = 1; \<And>x. ?A = {x} \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<exists>x. UNIV = {x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x. UNIV = {x}

goal (2 subgoals):
 1. card UNIV = 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
 2. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
hence "\<forall> x y :: 'a. x \<in> UNIV \<longrightarrow> y \<in> UNIV \<longrightarrow> x = y"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. UNIV = {x}

goal (1 subgoal):
 1. \<forall>x y. x \<in> UNIV \<longrightarrow> y \<in> UNIV \<longrightarrow> x = y
[PROOF STEP]
by (metis (mono_tags) singletonD)
[PROOF STATE]
proof (state)
this:
\<forall>x y. x \<in> UNIV \<longrightarrow> y \<in> UNIV \<longrightarrow> x = y

goal (2 subgoals):
 1. card UNIV = 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
 2. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
hence "\<forall> x y :: 'a. x = y"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x \<in> UNIV \<longrightarrow> y \<in> UNIV \<longrightarrow> x = y

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

goal (2 subgoals):
 1. card UNIV = 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
 2. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
hence "\<forall> x. x = \<bottom>"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x = y

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

goal (2 subgoals):
 1. card UNIV = 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
 2. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
hence "\<J> = {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x = \<bottom>

goal (1 subgoal):
 1. \<J> = {}
[PROOF STEP]
unfolding
      join_irreducible_elements_def
      join_irreducible_is_join_prime
      join_prime_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x = \<bottom>

goal (1 subgoal):
 1. {a. a \<noteq> \<bottom> \<and> (\<forall>y z. a \<le> y \<squnion> z \<longrightarrow> a \<le> y \<or> a \<le> z)} = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<J> = {}

goal (2 subgoals):
 1. card UNIV = 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
 2. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
hence "card \<J> = (0 :: real)"
[PROOF STATE]
proof (prove)
using this:
\<J> = {}

goal (1 subgoal):
 1. real (card \<J>) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (card \<J>) = 0

goal (2 subgoals):
 1. card UNIV = 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
 2. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real (card \<J>) = 0

goal (2 subgoals):
 1. card UNIV = 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
 2. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
have "log 2 (card (UNIV :: 'a set)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log 2 (real (card UNIV)) = 0
[PROOF STEP]
by (simp add: True)
[PROOF STATE]
proof (state)
this:
log 2 (real (card UNIV)) = 0

goal (2 subgoals):
 1. card UNIV = 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
 2. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real (card \<J>) = 0
log 2 (real (card UNIV)) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (card \<J>) = 0
log 2 (real (card UNIV)) = 0

goal (1 subgoal):
 1. real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (card \<J>) = log 2 (real (card UNIV))

goal (1 subgoal):
 1. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
card UNIV \<noteq> 1

goal (1 subgoal):
 1. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
hence "0 < 2 powr (card \<J>)" "2 powr (card \<J>) \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
card UNIV \<noteq> 1

goal (1 subgoal):
 1. 0 < 2 powr real (card \<J>) &&& 2 powr real (card \<J>) \<noteq> 1
[PROOF STEP]
using finite_UNIV_card_ge_0 finite UNIV_card_powr_2
[PROOF STATE]
proof (prove)
using this:
card UNIV \<noteq> 1
finite UNIV \<Longrightarrow> 0 < card UNIV
finite ?A
real (card UNIV) = 2 powr real (card \<J>)

goal (1 subgoal):
 1. 0 < 2 powr real (card \<J>) &&& 2 powr real (card \<J>) \<noteq> 1
[PROOF STEP]
by (simp, linarith)
[PROOF STATE]
proof (state)
this:
0 < 2 powr real (card \<J>)
2 powr real (card \<J>) \<noteq> 1

goal (1 subgoal):
 1. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
hence "log 2 (2 powr (card \<J>)) = card \<J>"
[PROOF STATE]
proof (prove)
using this:
0 < 2 powr real (card \<J>)
2 powr real (card \<J>) \<noteq> 1

goal (1 subgoal):
 1. log 2 (2 powr real (card \<J>)) = real (card \<J>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
log 2 (2 powr real (card \<J>)) = real (card \<J>)

goal (1 subgoal):
 1. card UNIV \<noteq> 1 \<Longrightarrow> real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
log 2 (2 powr real (card \<J>)) = real (card \<J>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
log 2 (2 powr real (card \<J>)) = real (card \<J>)

goal (1 subgoal):
 1. real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
using UNIV_card_powr_2
[PROOF STATE]
proof (prove)
using this:
log 2 (2 powr real (card \<J>)) = real (card \<J>)
real (card UNIV) = 2 powr real (card \<J>)

goal (1 subgoal):
 1. real (card \<J>) = log 2 (real (card UNIV))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (card \<J>) = log 2 (real (card UNIV))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l12_18_d:
  assumes "Cong A B C D" and
    "Cong B C D A" and
    "\<not> Col A B C" and
    "B \<noteq> D" and
    "Col A P C" and
    "Col B P D"
  shows "A C TS B D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A C TS B D
[PROOF STEP]
by (metis (no_types, lifting) Col_cases TS_def assms(1) assms(2) assms(3) assms(4) assms(5) assms(6) l12_18_c not_col_distincts not_cong_2143 not_cong_4321)


[STATEMENT]
lemma gso_scalar_zero:
  assumes "k < m" "i < k"
  shows "(gso k) \<bullet> (fs ! i) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gso k \<bullet> fs ! i = (0::'a)
[PROOF STEP]
by (subst comm_scalar_prod[OF gso_carrier]; (subst fi_scalar_prod_gso)?,
  insert assms, auto simp: \<mu>.simps)


[STATEMENT]
lemma sample_bits_fusion:
  fixes v :: nat
  assumes "0 < v"
  shows
  "bind_pmf (pmf_of_set {..<v}) (\<lambda>c. bind_pmf (pmf_of_set UNIV) (\<lambda>b. f (2 * c + (if b then 1 else 0)))) =
   bind_pmf (pmf_of_set {..<2 * v}) f"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = pmf_of_set {..<2 * v} \<bind> f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = pmf_of_set {..<2 * v} \<bind> f
[PROOF STEP]
have "?lhs = bind_pmf (map_pmf (\<lambda>(c, b). (2 * c + (if b then 1 else 0))) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV))) f"
    (is "_ = bind_pmf (map_pmf ?f _) _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV)) \<bind> f
[PROOF STEP]
by(simp add: pair_pmf_def bind_map_pmf bind_assoc_pmf bind_return_pmf)
[PROOF STATE]
proof (state)
this:
pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV)) \<bind> f

goal (1 subgoal):
 1. pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = pmf_of_set {..<2 * v} \<bind> f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV)) \<bind> f

goal (1 subgoal):
 1. pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = pmf_of_set {..<2 * v} \<bind> f
[PROOF STEP]
have "map_pmf ?f (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV)) = pmf_of_set {..<2 * v}"
    (is "?l = ?r" is "map_pmf ?f ?p = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV)) = pmf_of_set {..<2 * v}
[PROOF STEP]
proof(rule pmf_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. pmf (map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV))) i = pmf (pmf_of_set {..<2 * v}) i
[PROOF STEP]
fix i :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. pmf (map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV))) i = pmf (pmf_of_set {..<2 * v}) i
[PROOF STEP]
have [simp]: "inj ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (\<lambda>(c, b). 2 * c + (if b then 1 else 0))
[PROOF STEP]
by(auto simp add: inj_on_def) arith+
[PROOF STATE]
proof (state)
this:
inj (\<lambda>(c, b). 2 * c + (if b then 1 else 0))

goal (1 subgoal):
 1. \<And>i. pmf (map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV))) i = pmf (pmf_of_set {..<2 * v}) i
[PROOF STEP]
define i' where "i' \<equiv> i div 2"
[PROOF STATE]
proof (state)
this:
i' \<equiv> i div 2

goal (1 subgoal):
 1. \<And>i. pmf (map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV))) i = pmf (pmf_of_set {..<2 * v}) i
[PROOF STEP]
define b where "b \<equiv> odd i"
[PROOF STATE]
proof (state)
this:
b \<equiv> odd i

goal (1 subgoal):
 1. \<And>i. pmf (map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV))) i = pmf (pmf_of_set {..<2 * v}) i
[PROOF STEP]
have i: "i = ?f (i', b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = (case (i', b) of (c, b) \<Rightarrow> 2 * c + (if b then 1 else 0))
[PROOF STEP]
by(simp add: i'_def b_def)
[PROOF STATE]
proof (state)
this:
i = (case (i', b) of (c, b) \<Rightarrow> 2 * c + (if b then 1 else 0))

goal (1 subgoal):
 1. \<And>i. pmf (map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV))) i = pmf (pmf_of_set {..<2 * v}) i
[PROOF STEP]
show "pmf ?l i = pmf ?r i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV))) i = pmf (pmf_of_set {..<2 * v}) i
[PROOF STEP]
by(subst i; subst pmf_map_inj')(simp_all add: pmf_pair i'_def assms lessThan_empty_iff split: split_indicator)
[PROOF STATE]
proof (state)
this:
pmf (map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV))) i = pmf (pmf_of_set {..<2 * v}) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
map_pmf (\<lambda>(c, b). 2 * c + (if b then 1 else 0)) (pair_pmf (pmf_of_set {..<v}) (pmf_of_set UNIV)) = pmf_of_set {..<2 * v}

goal (1 subgoal):
 1. pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = pmf_of_set {..<2 * v} \<bind> f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = pmf_of_set {..<2 * v} \<bind> f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = pmf_of_set {..<2 * v} \<bind> f

goal (1 subgoal):
 1. pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = pmf_of_set {..<2 * v} \<bind> f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
pmf_of_set {..<v} \<bind> (\<lambda>c. pmf_of_set UNIV \<bind> (\<lambda>b. f (2 * c + (if b then 1 else 0)))) = pmf_of_set {..<2 * v} \<bind> f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transfer_not [transfer_intro]: "p \<equiv> eventually P \<U> \<Longrightarrow> \<not> p \<equiv> eventually (\<lambda>n. \<not> P n) \<U>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<equiv> eventually P \<U> \<Longrightarrow> \<not> p \<equiv> \<forall>\<^sub>F n in \<U>. \<not> P n
[PROOF STEP]
by (simp only: FreeUltrafilterNat.eventually_not_iff)


[STATEMENT]
lemma mult_four_block_mat: assumes
  c1: "A1 \<in> carrier_mat nr1 n1" "B1 \<in> carrier_mat nr1 n2" "C1 \<in> carrier_mat nr2 n1" "D1 \<in> carrier_mat nr2 n2" and
  c2: "A2 \<in> carrier_mat n1 nc1" "B2 \<in> carrier_mat n1 nc2" "C2 \<in> carrier_mat n2 nc1" "D2 \<in> carrier_mat n2 nc2"
  shows "four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2
  = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2)
    (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)" (is "?M1 * ?M2 = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
note row = row_four_block_mat[OF c1]
[PROOF STATE]
proof (state)
this:
?i < nr1 \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i = row A1 ?i @\<^sub>v row B1 ?i
\<lbrakk>\<not> ?i < nr1; ?i < nr1 + nr2\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i = row C1 (?i - nr1) @\<^sub>v row D1 (?i - nr1)

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
note col = col_four_block_mat[OF c2]
[PROOF STATE]
proof (state)
this:
?j < nc1 \<Longrightarrow> col (four_block_mat A2 B2 C2 D2) ?j = col A2 ?j @\<^sub>v col C2 ?j
\<lbrakk>\<not> ?j < nc1; ?j < nc1 + nc2\<rbrakk> \<Longrightarrow> col (four_block_mat A2 B2 C2 D2) ?j = col B2 (?j - nc1) @\<^sub>v col D2 (?j - nc1)

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?j < nc1 \<Longrightarrow> col (four_block_mat A2 B2 C2 D2) ?j = col A2 ?j @\<^sub>v col C2 ?j
\<lbrakk>\<not> ?j < nc1; ?j < nc1 + nc2\<rbrakk> \<Longrightarrow> col (four_block_mat A2 B2 C2 D2) ?j = col B2 (?j - nc1) @\<^sub>v col D2 (?j - nc1)

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
assume i: "i < nr1" and j: "j < nc1"
[PROOF STATE]
proof (state)
this:
i < nr1
j < nc1

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
have "row ?M1 i \<bullet> col ?M2 j = row A1 i \<bullet> col A2 j + row B1 i \<bullet> col C2 j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (four_block_mat A1 B1 C1 D1) i \<bullet> col (four_block_mat A2 B2 C2 D2) j = row A1 i \<bullet> col A2 j + row B1 i \<bullet> col C2 j
[PROOF STEP]
unfolding row(1)[OF i] col(1)[OF j]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (row A1 i @\<^sub>v row B1 i) \<bullet> (col A2 j @\<^sub>v col C2 j) = row A1 i \<bullet> col A2 j + row B1 i \<bullet> col C2 j
[PROOF STEP]
by (rule scalar_prod_append[of _ n1 _ n2], insert c1 c2 i j, auto)
[PROOF STATE]
proof (state)
this:
row (four_block_mat A1 B1 C1 D1) i \<bullet> col (four_block_mat A2 B2 C2 D2) j = row A1 i \<bullet> col A2 j + row B1 i \<bullet> col C2 j

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < nr1; ?j2 < nc1\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row A1 ?i2 \<bullet> col A2 ?j2 + row B1 ?i2 \<bullet> col C2 ?j2

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < nr1; ?j2 < nc1\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row A1 ?i2 \<bullet> col A2 ?j2 + row B1 ?i2 \<bullet> col C2 ?j2

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < nr1; ?j2 < nc1\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row A1 ?i2 \<bullet> col A2 ?j2 + row B1 ?i2 \<bullet> col C2 ?j2

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
assume i: "\<not> i < nr1" "i < nr1 + nr2" and j: "j < nc1"
[PROOF STATE]
proof (state)
this:
\<not> i < nr1
i < nr1 + nr2
j < nc1

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
hence i': "i - nr1 < nr2"
[PROOF STATE]
proof (prove)
using this:
\<not> i < nr1
i < nr1 + nr2
j < nc1

goal (1 subgoal):
 1. i - nr1 < nr2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i - nr1 < nr2

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
have "row ?M1 i \<bullet> col ?M2 j = row C1 (i - nr1) \<bullet> col A2 j + row D1 (i - nr1) \<bullet> col C2 j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (four_block_mat A1 B1 C1 D1) i \<bullet> col (four_block_mat A2 B2 C2 D2) j = row C1 (i - nr1) \<bullet> col A2 j + row D1 (i - nr1) \<bullet> col C2 j
[PROOF STEP]
unfolding row(2)[OF i] col(1)[OF j]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (row C1 (i - nr1) @\<^sub>v row D1 (i - nr1)) \<bullet> (col A2 j @\<^sub>v col C2 j) = row C1 (i - nr1) \<bullet> col A2 j + row D1 (i - nr1) \<bullet> col C2 j
[PROOF STEP]
by (rule scalar_prod_append[of _ n1 _ n2], insert c1 c2 i i' j, auto)
[PROOF STATE]
proof (state)
this:
row (four_block_mat A1 B1 C1 D1) i \<bullet> col (four_block_mat A2 B2 C2 D2) j = row C1 (i - nr1) \<bullet> col A2 j + row D1 (i - nr1) \<bullet> col C2 j

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> ?i2 < nr1; ?i2 < nr1 + nr2; ?j2 < nc1\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row C1 (?i2 - nr1) \<bullet> col A2 ?j2 + row D1 (?i2 - nr1) \<bullet> col C2 ?j2

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> ?i2 < nr1; ?i2 < nr1 + nr2; ?j2 < nc1\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row C1 (?i2 - nr1) \<bullet> col A2 ?j2 + row D1 (?i2 - nr1) \<bullet> col C2 ?j2

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> ?i2 < nr1; ?i2 < nr1 + nr2; ?j2 < nc1\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row C1 (?i2 - nr1) \<bullet> col A2 ?j2 + row D1 (?i2 - nr1) \<bullet> col C2 ?j2

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
assume i: "i < nr1" and j: "\<not> j < nc1" "j < nc1 + nc2"
[PROOF STATE]
proof (state)
this:
i < nr1
\<not> j < nc1
j < nc1 + nc2

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
hence j': "j - nc1 < nc2"
[PROOF STATE]
proof (prove)
using this:
i < nr1
\<not> j < nc1
j < nc1 + nc2

goal (1 subgoal):
 1. j - nc1 < nc2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j - nc1 < nc2

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
have "row ?M1 i \<bullet> col ?M2 j = row A1 i \<bullet> col B2 (j - nc1) + row B1 i \<bullet> col D2 (j - nc1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (four_block_mat A1 B1 C1 D1) i \<bullet> col (four_block_mat A2 B2 C2 D2) j = row A1 i \<bullet> col B2 (j - nc1) + row B1 i \<bullet> col D2 (j - nc1)
[PROOF STEP]
unfolding row(1)[OF i] col(2)[OF j]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (row A1 i @\<^sub>v row B1 i) \<bullet> (col B2 (j - nc1) @\<^sub>v col D2 (j - nc1)) = row A1 i \<bullet> col B2 (j - nc1) + row B1 i \<bullet> col D2 (j - nc1)
[PROOF STEP]
by (rule scalar_prod_append[of _ n1 _ n2], insert c1 c2 i j' j, auto)
[PROOF STATE]
proof (state)
this:
row (four_block_mat A1 B1 C1 D1) i \<bullet> col (four_block_mat A2 B2 C2 D2) j = row A1 i \<bullet> col B2 (j - nc1) + row B1 i \<bullet> col D2 (j - nc1)

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < nr1; \<not> ?j2 < nc1; ?j2 < nc1 + nc2\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row A1 ?i2 \<bullet> col B2 (?j2 - nc1) + row B1 ?i2 \<bullet> col D2 (?j2 - nc1)

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < nr1; \<not> ?j2 < nc1; ?j2 < nc1 + nc2\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row A1 ?i2 \<bullet> col B2 (?j2 - nc1) + row B1 ?i2 \<bullet> col D2 (?j2 - nc1)

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < nr1; \<not> ?j2 < nc1; ?j2 < nc1 + nc2\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row A1 ?i2 \<bullet> col B2 (?j2 - nc1) + row B1 ?i2 \<bullet> col D2 (?j2 - nc1)

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
assume i: "\<not> i < nr1" "i < nr1 + nr2" and j: "\<not> j < nc1" "j < nc1 + nc2"
[PROOF STATE]
proof (state)
this:
\<not> i < nr1
i < nr1 + nr2
\<not> j < nc1
j < nc1 + nc2

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
hence i': "i - nr1 < nr2" and j': "j - nc1 < nc2"
[PROOF STATE]
proof (prove)
using this:
\<not> i < nr1
i < nr1 + nr2
\<not> j < nc1
j < nc1 + nc2

goal (1 subgoal):
 1. i - nr1 < nr2 &&& j - nc1 < nc2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i - nr1 < nr2
j - nc1 < nc2

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
have "row ?M1 i \<bullet> col ?M2 j = row C1 (i - nr1) \<bullet> col B2 (j - nc1) + row D1 (i - nr1) \<bullet> col D2 (j - nc1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (four_block_mat A1 B1 C1 D1) i \<bullet> col (four_block_mat A2 B2 C2 D2) j = row C1 (i - nr1) \<bullet> col B2 (j - nc1) + row D1 (i - nr1) \<bullet> col D2 (j - nc1)
[PROOF STEP]
unfolding row(2)[OF i] col(2)[OF j]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (row C1 (i - nr1) @\<^sub>v row D1 (i - nr1)) \<bullet> (col B2 (j - nc1) @\<^sub>v col D2 (j - nc1)) = row C1 (i - nr1) \<bullet> col B2 (j - nc1) + row D1 (i - nr1) \<bullet> col D2 (j - nc1)
[PROOF STEP]
by (rule scalar_prod_append[of _ n1 _ n2], insert c1 c2 i i' j' j, auto)
[PROOF STATE]
proof (state)
this:
row (four_block_mat A1 B1 C1 D1) i \<bullet> col (four_block_mat A2 B2 C2 D2) j = row C1 (i - nr1) \<bullet> col B2 (j - nc1) + row D1 (i - nr1) \<bullet> col D2 (j - nc1)

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> ?i2 < nr1; ?i2 < nr1 + nr2; \<not> ?j2 < nc1; ?j2 < nc1 + nc2\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row C1 (?i2 - nr1) \<bullet> col B2 (?j2 - nc1) + row D1 (?i2 - nr1) \<bullet> col D2 (?j2 - nc1)

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?i2 < nr1; ?j2 < nc1\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row A1 ?i2 \<bullet> col A2 ?j2 + row B1 ?i2 \<bullet> col C2 ?j2
\<lbrakk>\<not> ?i2 < nr1; ?i2 < nr1 + nr2; ?j2 < nc1\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row C1 (?i2 - nr1) \<bullet> col A2 ?j2 + row D1 (?i2 - nr1) \<bullet> col C2 ?j2
\<lbrakk>?i2 < nr1; \<not> ?j2 < nc1; ?j2 < nc1 + nc2\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row A1 ?i2 \<bullet> col B2 (?j2 - nc1) + row B1 ?i2 \<bullet> col D2 (?j2 - nc1)
\<lbrakk>\<not> ?i2 < nr1; ?i2 < nr1 + nr2; \<not> ?j2 < nc1; ?j2 < nc1 + nc2\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row C1 (?i2 - nr1) \<bullet> col B2 (?j2 - nc1) + row D1 (?i2 - nr1) \<bullet> col D2 (?j2 - nc1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i2 < nr1; ?j2 < nc1\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row A1 ?i2 \<bullet> col A2 ?j2 + row B1 ?i2 \<bullet> col C2 ?j2
\<lbrakk>\<not> ?i2 < nr1; ?i2 < nr1 + nr2; ?j2 < nc1\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row C1 (?i2 - nr1) \<bullet> col A2 ?j2 + row D1 (?i2 - nr1) \<bullet> col C2 ?j2
\<lbrakk>?i2 < nr1; \<not> ?j2 < nc1; ?j2 < nc1 + nc2\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row A1 ?i2 \<bullet> col B2 (?j2 - nc1) + row B1 ?i2 \<bullet> col D2 (?j2 - nc1)
\<lbrakk>\<not> ?i2 < nr1; ?i2 < nr1 + nr2; \<not> ?j2 < nc1; ?j2 < nc1 + nc2\<rbrakk> \<Longrightarrow> row (four_block_mat A1 B1 C1 D1) ?i2 \<bullet> col (four_block_mat A2 B2 C2 D2) ?j2 = row C1 (?i2 - nr1) \<bullet> col B2 (?j2 - nc1) + row D1 (?i2 - nr1) \<bullet> col D2 (?j2 - nc1)

goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)
[PROOF STEP]
by (intro eq_matI, insert c1 c2, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat A1 B1 C1 D1 * four_block_mat A2 B2 C2 D2 = four_block_mat (A1 * A2 + B1 * C2) (A1 * B2 + B1 * D2) (C1 * A2 + D1 * C2) (C1 * B2 + D1 * D2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma weight_less_iff: "weight_less s t \<Longrightarrow> weight_le s t \<and> weight s < weight t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weight_less s t \<Longrightarrow> weight_le s t \<and> weight s < weight t
[PROOF STEP]
by (auto simp: weight_le_def weight_less_def)


[STATEMENT]
lemma VSagree_supset:"A \<supseteq> B \<Longrightarrow> VSagree \<nu> \<nu>' A \<Longrightarrow> VSagree \<nu> \<nu>' B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>B \<subseteq> A; VSagree \<nu> \<nu>' A\<rbrakk> \<Longrightarrow> VSagree \<nu> \<nu>' B
[PROOF STEP]
by (auto simp add: VSagree_def)


[STATEMENT]
lemma bottom_join: "x \<in> carrier L \<Longrightarrow> \<bottom> \<squnion> x .= x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier L \<Longrightarrow> \<bottom> \<squnion> x .= x
[PROOF STEP]
by (metis bottom_least join_closed join_le join_right le_refl least_def weak_le_antisym)


[STATEMENT]
lemma listrelp_conj1: "listrelp (\<lambda>x y. R x y \<and> S x y) x y \<Longrightarrow> listrelp R x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listrelp (\<lambda>x y. R x y \<and> S x y) x y \<Longrightarrow> listrelp R x y
[PROOF STEP]
by (erule listrelp.induct) (auto intro: listrelp.intros)


[STATEMENT]
lemma fds_const_minus [simp]:
  "fds_const (a - b :: 'a :: cancel_comm_monoid_add) = fds_const a - fds_const b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_const (a - b) = fds_const a - fds_const b
[PROOF STEP]
by (simp add: fds_eq_iff fds_nth_const)


[STATEMENT]
lemma \<AA>\<^sub>3_language:
  "to_omega ` DCA.language (\<AA>\<^sub>3 xs ys) = L\<^sub>3 (set xs) (set ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_omega ` DCA.language (\<AA>\<^sub>3 xs ys) = L\<^sub>3 (set xs) (set ys)
[PROOF STEP]
by (simp add: \<AA>\<^sub>3_def L\<^sub>3_def set_eq_iff dca_language[OF \<AA>\<^sub>\<nu>_FG_language[OF GF_advice_\<nu>LTL(1)]])


[STATEMENT]
lemma Longest_common_prefix_longest:
  "L \<noteq> {} \<Longrightarrow> \<forall>xs\<in>L. prefix ps xs \<Longrightarrow> length ps \<le> length(Longest_common_prefix L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>L \<noteq> {}; \<forall>xs\<in>L. prefix ps xs\<rbrakk> \<Longrightarrow> length ps \<le> length (Longest_common_prefix L)
[PROOF STEP]
unfolding Longest_common_prefix_def arg_max_def is_arg_max_linorder
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>L \<noteq> {}; \<forall>xs\<in>L. prefix ps xs\<rbrakk> \<Longrightarrow> length ps \<le> length (SOME x. Ball L (prefix x) \<and> (\<forall>y. Ball L (prefix y) \<longrightarrow> length y \<le> length x))
[PROOF STEP]
by(rule someI2_ex[OF Longest_common_prefix_ex]) auto


[STATEMENT]
lemma (in Group) rcs_Unit1:"G \<guillemotright> H \<Longrightarrow>  H \<bullet> \<one> = H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G \<guillemotright> H  \<Longrightarrow> H \<bullet> \<one> = H
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. G \<guillemotright> H  \<Longrightarrow> H \<bullet> \<one> \<subseteq> H
 2. G \<guillemotright> H  \<Longrightarrow> H \<subseteq> H \<bullet> \<one>
[PROOF STEP]
apply (rule subsetI,
       simp add:rcs_def, erule bexE,
       frule_tac h = h in sg_subset_elem[of "H"], assumption+,
       simp add:r_unit)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G \<guillemotright> H  \<Longrightarrow> H \<subseteq> H \<bullet> \<one>
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>G \<guillemotright> H ; x \<in> H\<rbrakk> \<Longrightarrow> x \<in> H \<bullet> \<one>
[PROOF STEP]
apply (simp add:rcs_def,
       frule_tac h = x in sg_subset_elem[of "H"], assumption+,
       frule_tac a = x in r_unit, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma isPath_head2:
  "isPath u (e#p) v \<Longrightarrow> (p = [] \<or> (p \<noteq> [] \<and> fst (hd p) = snd e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isPath u (e # p) v \<Longrightarrow> p = [] \<or> p \<noteq> [] \<and> fst (hd p) = snd e
[PROOF STEP]
by (metis Graph.isPath_head list.collapse)


[STATEMENT]
lemma f1''_gr0[arith]: "f1'' > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < f1''
[PROOF STEP]
using f1_less_f1'' f1
[PROOF STATE]
proof (prove)
using this:
f1 < f1''
0 < f1

goal (1 subgoal):
 1. 0 < f1''
[PROOF STEP]
by linarith


[STATEMENT]
lemma (in Worder) Tw_func:"\<lbrakk>Worder T;
     \<forall>a\<in>carrier D. \<exists>b\<in>carrier T. ord_equiv (Iod D (segment D a))
         (Iod T (segment T b))\<rbrakk> \<Longrightarrow> Tw\<^bsub>D,T\<^esub> \<in> carrier D \<rightarrow> carrier T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder T; \<forall>a\<in>carrier D. \<exists>b\<in>carrier T. ord_equiv (Iod D (segment D a)) (Iod T (segment T b))\<rbrakk> \<Longrightarrow> Tw\<^bsub>D,T\<^esub> \<in> carrier D \<rightarrow> carrier T
[PROOF STEP]
apply (rule Pi_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Worder T; \<forall>a\<in>carrier D. \<exists>b\<in>carrier T. ord_equiv (Iod D (segment D a)) (Iod T (segment T b)); x \<in> carrier D\<rbrakk> \<Longrightarrow> (Tw\<^bsub>D,T\<^esub>) x \<in> carrier T
[PROOF STEP]
apply (simp add:Tw_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Worder T; \<forall>a\<in>carrier D. \<exists>b\<in>carrier T. ord_equiv (Iod D (segment D a)) (Iod T (segment T b)); x \<in> carrier D\<rbrakk> \<Longrightarrow> (SOME xa. xa \<in> carrier T \<and> ord_equiv (Iod D (segment D x)) (Iod T (segment T xa))) \<in> carrier T
[PROOF STEP]
apply (rule someI2_ex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>Worder T; \<forall>a\<in>carrier D. \<exists>b\<in>carrier T. ord_equiv (Iod D (segment D a)) (Iod T (segment T b)); x \<in> carrier D\<rbrakk> \<Longrightarrow> \<exists>a. a \<in> carrier T \<and> ord_equiv (Iod D (segment D x)) (Iod T (segment T a))
 2. \<And>x xa. \<lbrakk>Worder T; \<forall>a\<in>carrier D. \<exists>b\<in>carrier T. ord_equiv (Iod D (segment D a)) (Iod T (segment T b)); x \<in> carrier D; xa \<in> carrier T \<and> ord_equiv (Iod D (segment D x)) (Iod T (segment T xa))\<rbrakk> \<Longrightarrow> xa \<in> carrier T
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>Worder T; \<forall>a\<in>carrier D. \<exists>b\<in>carrier T. ord_equiv (Iod D (segment D a)) (Iod T (segment T b)); x \<in> carrier D; xa \<in> carrier T \<and> ord_equiv (Iod D (segment D x)) (Iod T (segment T xa))\<rbrakk> \<Longrightarrow> xa \<in> carrier T
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma total_onPI:
  "(\<And>x y. \<lbrakk> x \<in> A; y \<in> A \<rbrakk> \<Longrightarrow> r x y \<or> x = y \<or> r y x) \<Longrightarrow> total_onP A r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> r x y \<or> x = y \<or> r y x) \<Longrightarrow> total_onP A r
[PROOF STEP]
by(rule total_onI) simp


[STATEMENT]
lemma card3_eI: "3 \<le> card S \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<le> card S \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
proof goal_cases
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 3 \<le> card S \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
3 \<le> card S

goal (1 subgoal):
 1. 3 \<le> card S \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 \<le> card S
[PROOF STEP]
have "2 \<le> card S"
[PROOF STATE]
proof (prove)
using this:
3 \<le> card S

goal (1 subgoal):
 1. 2 \<le> card S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 \<le> card S

goal (1 subgoal):
 1. 3 \<le> card S \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
note card2_eI[OF this]
[PROOF STATE]
proof (state)
this:
\<exists>x y. x \<noteq> y \<and> x \<in> S \<and> y \<in> S

goal (1 subgoal):
 1. 3 \<le> card S \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x y. x \<noteq> y \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
obtain x y S' where xs: "S = {x,y} \<union> S' \<and> x \<notin> S' \<and> y \<notin> S' \<and> x \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
\<exists>x y. x \<noteq> y \<and> x \<in> S \<and> y \<in> S

goal (1 subgoal):
 1. (\<And>x y S'. S = {x, y} \<union> S' \<and> x \<notin> S' \<and> y \<notin> S' \<and> x \<noteq> y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Set.set_insert Un_insert_left insert_eq_iff insert_is_Un)
[PROOF STATE]
proof (state)
this:
S = {x, y} \<union> S' \<and> x \<notin> S' \<and> y \<notin> S' \<and> x \<noteq> y

goal (1 subgoal):
 1. 3 \<le> card S \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S = {x, y} \<union> S' \<and> x \<notin> S' \<and> y \<notin> S' \<and> x \<noteq> y
[PROOF STEP]
have "1 \<le> card S'"
[PROOF STATE]
proof (prove)
using this:
S = {x, y} \<union> S' \<and> x \<notin> S' \<and> y \<notin> S' \<and> x \<noteq> y

goal (1 subgoal):
 1. 1 \<le> card S'
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
S = {x, y} \<union> S' \<and> x \<notin> S' \<and> y \<notin> S' \<and> x \<noteq> y
3 \<le> card S

goal (1 subgoal):
 1. 1 \<le> card S'
[PROOF STEP]
by (metis One_nat_def Suc_leI Un_insert_left card_gt_0_iff insert_absorb numeral_3_eq_3 singleton_insert_inj_eq card.infinite card_insert_if finite_Un insert_is_Un le0 not_less_eq_eq)
[PROOF STATE]
proof (state)
this:
1 \<le> card S'

goal (1 subgoal):
 1. 3 \<le> card S \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
(* uuuh *)
[PROOF STATE]
proof (state)
this:
1 \<le> card S'

goal (1 subgoal):
 1. 3 \<le> card S \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> card S'
[PROOF STEP]
obtain z where "z \<in> S'"
[PROOF STATE]
proof (prove)
using this:
1 \<le> card S'

goal (1 subgoal):
 1. (\<And>z. z \<in> S' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
z \<in> S'

goal (1 subgoal):
 1. 3 \<le> card S \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> S'
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
z \<in> S'

goal (1 subgoal):
 1. \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
using xs
[PROOF STATE]
proof (prove)
using this:
z \<in> S'
S = {x, y} \<union> S' \<and> x \<notin> S' \<and> y \<notin> S' \<and> x \<noteq> y

goal (1 subgoal):
 1. \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> S \<and> y \<in> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_mdpc_compose: "map_mdpc f (map_mdpc g M) = map_mdpc (f \<circ> g) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_mdpc f (map_mdpc g M) = map_mdpc (f \<circ> g) M
[PROOF STEP]
by (intro mdpc_eqI)
     (auto simp add: states_map_mdpc image_comp actions_map_mdpc image_UN map_pmf_compose[symmetric]
                     vimage_comp[symmetric])